TI BLE-Stack for Bluetooth API Documentation  3.03.00.00
Modules | Files | Data Structures | Macros | Typedefs | Functions
TOF

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...
 

Detailed Description

This module implements the Time of Flight (TOF)

Function Documentation

§ TOF_clearBuffers()

void TOF_clearBuffers ( ToF_Handle  handle)

Clean buffers for the specified ToF Handle.

Parameters
handle- ToF Handle.
Returns
none

§ TOF_close()

void TOF_close ( ToF_Handle  handle)

Close the ToF and RF drivers.

Parameters
handle- ToF Handle.
Returns
none

§ TOF_genSeed()

uint8_t TOF_genSeed ( void  )

call ToF Security module to generate a true 128-bit random seed

Returns
None

§ TOF_getBurstStat()

void TOF_getBurstStat ( ToF_Handle  handle,
ToF_BurstStat **  resultBuffer 
)

Get the result for the last ToF burst (run)

Parameters
handle- ToF Handle.
resultBuffer- The ToF stats for the last run.
Returns
none

§ TOF_getSeed()

uint8_t TOF_getSeed ( uint8_t *  dst)

copy 32 byte seed into dst

Parameters
dst- destination to copy seed into.
Returns
None

§ TOF_initSyncWords()

uint8_t TOF_initSyncWords ( void  )

Init sync words buffer, depends on user configuration.

Returns
None

§ TOF_open()

ToF_Handle TOF_open ( ToF_Struct *  tofStruct,
ToF_Params params 
)

Initiate RF ToF params and open RF driver.

Parameters
tofStruct- ToF structure initiated by user application
params- User provided params
Returns
ToF Handle - Pointer to a ToF_Object

§ TOF_run()

ToF_Status TOF_run ( ToF_Handle  handle,
uint32_t  nextTaskTime 
)

Start a ToF run.

Parameters
handle- ToF Handle.
nextTaskTime- Time remaining until next Stack event.
Returns
ToF Status

§ TOF_setSeed()

uint8_t TOF_setSeed ( uint8_t *  newSeed)

call ToF Security module to restart the ctr drbg new 128-bit random seed

Parameters
newSeed- New seed handle.
Returns
None

§ TOF_skipSyncWords()

void TOF_skipSyncWords ( void  )

Skip some syncwords into the future (for synchronization purposes)

Returns
None

§ TOFSecurity_close()

int TOFSecurity_close ( tofSecHandle_t tofSecHandle)

This function is used to close ToF Security and free buffers.

input parameters

Parameters
tofSecHandle- A pointer to an empty tof security handle.

output parameters

Returns
uint8_t - NULL if failed, other if succeeded

§ TOFSecurity_genSeed()

int TOFSecurity_genSeed ( tofSecHandle_t tofSecHandle)

use TRNG HW module to generate a true 128-bit random seed

input parameters

Parameters
tofSecHandle- A pointer to the tof security state.

output parameters

Parameters
tofSecHandle- A pointer to the tof security state.
Returns
NULL if failed, other if succeeded

§ TOFSecurity_genSyncWords()

int TOFSecurity_genSyncWords ( tofSecHandle_t tofSecHandle,
uint8_t  bufferToFill 
)

Will fill each Sync Word Buffer with numOfSyncWordsPerBuffer Sync Words.

input parameters

Parameters
bufferToFill- An enum describing which buffers to fill
tofSecHandle- A pointer to the tof security state.

output parameters

Parameters
tofSecHandle- A pointer to the tof security state.
Returns
NULL if failed, other if succeeded

§ TOFSecurity_open()

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

Parameters
tofSecCfgPrms- A pointer to the user-defined tof security preset values.
tofSecHandle- A pointer to an empty tof security handle.

output parameters

Parameters
tofSecHandle- A pointer to the tof security state.
Returns
uint8_t - NULL if failed, other if succeeded

§ TOFSecurity_setSeed()

int TOFSecurity_setSeed ( tofSecHandle_t tofSecHandle,
uint8_t *  newSeed 
)

This function is used to reseed the ctr drbg.

input parameters

Parameters
tofSecHandle- A pointer to the tof security state.
newSeed- A pointer to the 128-bit new seed with which to reinstantiate.

output parameters

Parameters
tofSecHandle- A pointer to the tof security state.
Returns
int - NULL if failed, other if succeeded
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale