![]() |
![]() |
TI BLE-Stack for Bluetooth API Documentation
3.03.00.00
|
This module implements the Time of Flight (TOF) More...
Modules | |
TOF Security Structures | |
TOF Structures | |
Files | |
file | rfc_cmd_tof.h |
rf commands used by TOF module | |
file | TOF.h |
TOF interface. | |
file | tof_security.h |
ToF security module interface. | |
Data Structures | |
struct | rfc_CMD_READ_FS_CAL_s |
RF Read frequency calibration command Structure. More... | |
Macros | |
#define | CMD_READ_FS_CAL 0x000D |
Read frequency calibration command. | |
#define | CTR_DRBG_BLOCKLEN 16 |
Length of CTR DRBG Block. | |
#define | CTR_DRBG_INST_FLAG 0xAA |
CTR DRBG Flag. | |
#define | CTR_DRBG_SEEDLEN (CTR_DRBG_BLOCKLEN + CTR_DRBG_BLOCKLEN) |
Length of CTR DRBG Seed. | |
#define | FAILURE 0x01 |
Failure. | |
#define | IRQN_DOUBLE_SYNCWORD_BUFFER_SWITCH 11 |
Same as RF_EventTxBufferChange, use with care. | |
#define | IRQN_PARTIAL_READ_READY 15 |
Partial result readout is ready. | |
#define | NUM_ELEMENTS(x) (sizeof(x)/sizeof(x[0])) |
NUM_ELEMENTS calculates the num of elements in an array. | |
#define | RF_EventDoubleSyncWordBufferSwitch (1 << IRQN_DOUBLE_SYNCWORD_BUFFER_SWITCH) |
Double syncword buffer switch event bitmap. | |
#define | RF_EventPartialReadReady (1 << IRQN_PARTIAL_READ_READY) |
Partial result readout event bitmap. | |
#define | SUCCESS 0x00 |
SUCCESS. | |
#define | syncWordBufferOneReady 0x01 |
First buffer ready. | |
#define | syncWordBufferTwoReady 0x02 |
Second buffer ready. | |
#define | TICK_TO_METER (6.25 * 3) |
Clock tics to distance in meters conversion. | |
#define | TOF_COMPENSATION_CORRELATOR_COMP 2 |
use correlator compensation | |
#define | TOF_COMPENSATION_NO_COMP 0 |
don't use compensation | |
#define | TOF_COMPENSATION_STIM_COMP 1 |
use STIM compensation (experimental feature) | |
#define | TOF_FILL_1ST_BUFF TOF_SEC_FILL_1ST_BUFF |
Fill first buffers. | |
#define | TOF_FILL_2ND_BUFF TOF_SEC_FILL_2ND_BUFF |
Fill second buffers. | |
#define | TOF_FILL_BOTH_BUFF TOF_SEC_FILL_BOTH_BUFFS |
Fill both buffers. | |
#define | TOF_MAX_NUM_FREQ 20 |
Maximun number of frequencies. | |
#define | TOF_NUM_RFC_BURST_PKTS 32 |
Maximun number of packets in RF burst. | |
#define | TOF_PATCH_LOCATION 0x21000914 |
TOF patch location in memory. | |
#define | TOF_SEC_DBL_BUFF_SIZE 16 |
Size of ToF_securoty double buffer. | |
#define | TOF_SEC_FILL_1ST_BUFF 0x02 |
Fill first buffers. | |
#define | TOF_SEC_FILL_2ND_BUFF 0x03 |
Fill second buffers. | |
#define | TOF_SEC_FILL_BOTH_BUFFS 0x01 |
Fill both buffers. | |
#define | TOF_SEC_SYNCWORD_SIZE 8 |
Length of Syncword. | |
#define | TOF_SEEDLEN 32 |
Seed Length in Bytes. | |
#define | TOF_TIMEOUTVAL 0xFFFFFFFF |
TOF Timeout. | |
Typedefs | |
typedef struct __RFC_STRUCT rfc_CMD_READ_FS_CAL_s | rfc_CMD_READ_FS_CAL_t |
RF Read frequency calibration command Structure. | |
Functions | |
void | TOF_clearBuffers (ToF_Handle handle) |
Clean buffers for the specified ToF Handle. More... | |
void | TOF_close (ToF_Handle handle) |
Close the ToF and RF drivers. More... | |
uint8_t | TOF_genSeed (void) |
call ToF Security module to generate a true 128-bit random seed More... | |
void | TOF_getBurstStat (ToF_Handle handle, ToF_BurstStat **resultBuffer) |
Get the result for the last ToF burst (run) More... | |
uint8_t | TOF_getSeed (uint8_t *dst) |
copy 32 byte seed into dst More... | |
uint8_t | TOF_initSyncWords (void) |
Init sync words buffer, depends on user configuration. More... | |
ToF_Handle | TOF_open (ToF_Struct *tofStruct, ToF_Params *params) |
Initiate RF ToF params and open RF driver. More... | |
ToF_Status | TOF_run (ToF_Handle handle, uint32_t nextTaskTime) |
Start a ToF run. More... | |
uint8_t | TOF_setSeed (uint8_t *newSeed) |
call ToF Security module to restart the ctr drbg new 128-bit random seed More... | |
void | TOF_skipSyncWords (void) |
Skip some syncwords into the future (for synchronization purposes) More... | |
int | TOFSecurity_close (tofSecHandle_t *tofSecHandle) |
This function is used to close ToF Security and free buffers. More... | |
int | TOFSecurity_genSeed (tofSecHandle_t *tofSecHandle) |
use TRNG HW module to generate a true 128-bit random seed More... | |
int | TOFSecurity_genSyncWords (tofSecHandle_t *tofSecHandle, uint8_t bufferToFill) |
Will fill each Sync Word Buffer with numOfSyncWordsPerBuffer Sync Words. More... | |
int | TOFSecurity_open (tofSecHandle_t *tofSecHandle, tofSecCfgPrms_t *tofSecCfgPrms) |
This function is used to open the tof security module (to default or to presets defined in tofSecCfgPrms) and reset the AES engine. More... | |
int | TOFSecurity_setSeed (tofSecHandle_t *tofSecHandle, uint8_t *newSeed) |
This function is used to reseed the ctr drbg. More... | |
This module implements the Time of Flight (TOF)
void TOF_clearBuffers | ( | ToF_Handle | handle | ) |
Clean buffers for the specified ToF Handle.
handle | - ToF Handle. |
void TOF_close | ( | ToF_Handle | handle | ) |
Close the ToF and RF drivers.
handle | - ToF Handle. |
uint8_t TOF_genSeed | ( | void | ) |
call ToF Security module to generate a true 128-bit random seed
void TOF_getBurstStat | ( | ToF_Handle | handle, |
ToF_BurstStat ** | resultBuffer | ||
) |
Get the result for the last ToF burst (run)
handle | - ToF Handle. |
resultBuffer | - The ToF stats for the last run. |
uint8_t TOF_getSeed | ( | uint8_t * | dst | ) |
copy 32 byte seed into dst
dst | - destination to copy seed into. |
uint8_t TOF_initSyncWords | ( | void | ) |
Init sync words buffer, depends on user configuration.
ToF_Handle TOF_open | ( | ToF_Struct * | tofStruct, |
ToF_Params * | params | ||
) |
Initiate RF ToF params and open RF driver.
tofStruct | - ToF structure initiated by user application |
params | - User provided params |
ToF_Status TOF_run | ( | ToF_Handle | handle, |
uint32_t | nextTaskTime | ||
) |
Start a ToF run.
handle | - ToF Handle. |
nextTaskTime | - Time remaining until next Stack event. |
uint8_t TOF_setSeed | ( | uint8_t * | newSeed | ) |
call ToF Security module to restart the ctr drbg new 128-bit random seed
newSeed | - New seed handle. |
void TOF_skipSyncWords | ( | void | ) |
Skip some syncwords into the future (for synchronization purposes)
int TOFSecurity_close | ( | tofSecHandle_t * | tofSecHandle | ) |
This function is used to close ToF Security and free buffers.
input parameters
tofSecHandle | - A pointer to an empty tof security handle. |
output parameters
int TOFSecurity_genSeed | ( | tofSecHandle_t * | tofSecHandle | ) |
use TRNG HW module to generate a true 128-bit random seed
input parameters
tofSecHandle | - A pointer to the tof security state. |
output parameters
tofSecHandle | - A pointer to the tof security state. |
int TOFSecurity_genSyncWords | ( | tofSecHandle_t * | tofSecHandle, |
uint8_t | bufferToFill | ||
) |
Will fill each Sync Word Buffer with numOfSyncWordsPerBuffer Sync Words.
input parameters
bufferToFill | - An enum describing which buffers to fill |
tofSecHandle | - A pointer to the tof security state. |
output parameters
tofSecHandle | - A pointer to the tof security state. |
int TOFSecurity_open | ( | tofSecHandle_t * | tofSecHandle, |
tofSecCfgPrms_t * | tofSecCfgPrms | ||
) |
This function is used to open the tof security module (to default or to presets defined in tofSecCfgPrms) and reset the AES engine.
Note: This routine leaves CM3 Crypto interrupts disabled.
Note: This function allocates the key without specifying one. The key is loaded as needed without releases the key store.
input parameters
tofSecCfgPrms | - A pointer to the user-defined tof security preset values. |
tofSecHandle | - A pointer to an empty tof security handle. |
output parameters
tofSecHandle | - A pointer to the tof security state. |
int TOFSecurity_setSeed | ( | tofSecHandle_t * | tofSecHandle, |
uint8_t * | newSeed | ||
) |
This function is used to reseed the ctr drbg.
input parameters
tofSecHandle | - A pointer to the tof security state. |
newSeed | - A pointer to the 128-bit new seed with which to reinstantiate. |
output parameters
tofSecHandle | - A pointer to the tof security state. |