39 #include <ti/drivers/rf/RF.h> 41 #include <ti/devices/DeviceFamily.h> 49 #define TOF_TIMEOUTVAL 0xFFFFFFFF 51 #define TOF_MAX_NUM_FREQ 20 53 #define TOF_SEEDLEN 32 55 #define TOF_NUM_RFC_BURST_PKTS 32 57 #define TOF_COMPENSATION_NO_COMP 0 58 #define TOF_COMPENSATION_STIM_COMP 1 59 #define TOF_COMPENSATION_CORRELATOR_COMP 2 62 #define IRQN_PARTIAL_READ_READY 15 63 #define IRQN_DOUBLE_SYNCWORD_BUFFER_SWITCH 11 64 #define RF_EventPartialReadReady (1 << IRQN_PARTIAL_READ_READY) 65 #define RF_EventDoubleSyncWordBufferSwitch (1 << IRQN_DOUBLE_SYNCWORD_BUFFER_SWITCH) 67 #define TOF_FILL_BOTH_BUFF TOF_SEC_FILL_BOTH_BUFFS 68 #define TOF_FILL_1ST_BUFF TOF_SEC_FILL_1ST_BUFF 69 #define TOF_FILL_2ND_BUFF TOF_SEC_FILL_2ND_BUFF 72 #define syncWordBufferOneReady 0x01 73 #define syncWordBufferTwoReady 0x02 75 #define TICK_TO_METER (6.25 * 3) 77 #define TOF_PATCH_LOCATION 0x21000914 84 #define CMD_ENABLE_DBG_CMDID 0x602 85 #define CMD_ENABLE_DBG_CONFIG ((0<<14) | (1<<12) | (1<<11) | (2<<9) | (1<<8) | (1<<6)) 129 uint16_t *pFrequencies;
130 uint8_t freqChangePeriod;
134 ToF_Sample *pT1RSSIBuf;
135 uint16_t numBurstSamples;
136 } ToF_Object, ToF_Struct, *ToF_Handle;
268 #define CMD_READ_FS_CAL 0x000D uint8_t TOF_setSeed(uint8_t *newSeed)
call ToF Security module to restart the ctr drbg new 128-bit random seed
TOF Burst Stats Structure.
Definition: TOF.h:167
uint8_t TOF_getSeed(uint8_t *dst)
copy 32 byte seed into dst
RF_EventMask rfEvent
RF Event.
Definition: TOF.h:170
uint8_t * pTxBuf
Pointer to Tx buffer.
Definition: TOF.h:145
ToF_Status TOF_run(ToF_Handle handle, uint32_t nextTaskTime)
Start a ToF run.
uint8_t constSyncwords
Generate syncwords only once.
Definition: TOF.h:154
ToF_Handle TOF_open(ToF_Struct *tofStruct, ToF_Params *params)
Initiate RF ToF params and open RF driver.
uint16_t freq
Frequency.
Definition: TOF.h:160
uint8_t mask
Mask for the LFSR.
Definition: TOF.h:150
uint8_t ktCal
KT calibration result.
Definition: TOF.h:277
TOF Parameters Structure.
Definition: TOF.h:140
uint16_t tdcCal
TDC calibration result.
Definition: TOF.h:278
uint16_t syncTimeout
How long to wait for first sync word.
Definition: TOF.h:152
void TOF_getBurstStat(ToF_Handle handle, ToF_BurstStat **resultBuffer)
Get the result for the last ToF burst (run)
ToF_Role tofRole
Slave or master.
Definition: TOF.h:142
#define TOF_MAX_NUM_FREQ
Maximun number of frequencies.
Definition: TOF.h:51
void TOF_skipSyncWords(void)
Skip some syncwords into the future (for synchronization purposes)
void TOF_clearBuffers(ToF_Handle handle)
Clean buffers for the specified ToF Handle.
TOF Burst Stats Structure.
Definition: TOF.h:158
uint8_t * ToF_RX_Buf
Pointer to RX buffer.
Definition: TOF.h:116
uint32_t numOk
Num of Ok Recieved.
Definition: TOF.h:163
uint8_t __dummy0
Reserved.
Definition: TOF.h:274
ToF_Sample * pT1RSSIBuf
Pointer to T1|RSSI result buffer.
Definition: TOF.h:143
void TOF_close(ToF_Handle handle)
Close the ToF and RF drivers.
uint8_t freqChangePeriod
How often should we change freq?
Definition: TOF.h:151
uint8_t midCal
Mid calibration result.
Definition: TOF.h:276
ToF_Role
Enumeration for TOF roles of operation.
Definition: TOF.h:102
uint16_t commandNo
The command ID number 0x0601.
Definition: TOF.h:273
double tick
Clock's time between ticks.
Definition: TOF.h:161
struct __RFC_STRUCT rfc_CMD_READ_FS_CAL_s rfc_CMD_READ_FS_CAL_t
RF Read frequency calibration command Structure.
Definition: TOF.h:280
uint16_t numBurstSamples
Number of bursts to be made (same as sync word length if using single buffer)
Definition: TOF.h:144
tofSecCfgPrms_t tofSecurityParams
TOF Security Configuration Paramaters.
Definition: TOF.h:149
rfc_CMD_TOF_sample_t ToF_Sample
TOF Sample.
Definition: TOF.h:110
uint8_t * ToF_TX_Buf
Pointer to TX buffer.
Definition: TOF.h:115
uint8_t coarseCal
Coarse calibration result.
Definition: TOF.h:275
RF Read frequency calibration command Structure.
Definition: TOF.h:271
ToF security module interface.
ToF Security Configuration Parameters.
Definition: tof_security.h:97
double tickVariance
Variance of tick value.
Definition: TOF.h:162
TOF_ApplicationCB pfnTofApplicationCB
Callback to application.
Definition: TOF.h:153
uint8_t TOF_initSyncWords(void)
Init sync words buffer, depends on user configuration.
uint8_t numFreq
Number of frequencies in above list.
Definition: TOF.h:148
uint16_t * pFrequencies
Pointer to Frequencies.
Definition: TOF.h:147
uint32_t freq
Frequency.
Definition: TOF.h:169
uint8_t * pRxBuf
Pointer to Rx buffer.
Definition: TOF.h:146
rf commands used by TOF module
rfc_CMD_TOF_synthCal_t ToF_SynthCal
Pointer to frequency calibration struct, used for the pre-calibration of the synth.
Definition: TOF.h:113
uint32_t ratSyncTime
RAT Sync Time.
Definition: TOF.h:171
void(* TOF_ApplicationCB)(void)
Callback to a handler supplied by the application.
Definition: TOF.h:119
uint8_t TOF_genSeed(void)
call ToF Security module to generate a true 128-bit random seed