TI BLE-Stack for Bluetooth API Documentation  3.03.02.00
Modules | Files | Macros | Functions
TOF

This module implements the Time of Flight (TOF) More...

Modules

 TOF Security Structures
 
 TOF Structures
 

Files

file  TOF.h
 TOF interface.
 
file  tof_security.h
 ToF security module interface.
 

Macros

#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_PATCH_LOCATION   0x21000914
 TOF patch location in memory.
 
#define TOF_SEC_DBL_BUFF_SIZE   16
 Size of ToF_security 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.
 

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...
 
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...
 
ToF_Handle TOF_open (ToF_Struct *tofStruct, ToF_Params *params)
 Initiate RF ToF params and open RF driver. More...
 
void TOF_roleSwitch (ToF_Role newRole)
 Switch ToF role. More...
 
ToF_Status TOF_run (ToF_Handle handle, uint32_t nextTaskTime)
 Start a ToF run. More...
 
int TOF_setSeed (uint8_t *newSeed)
 call ToF Security module to restart the ctr drbg new 128-bit random seed More...
 
int TOFSecurity_close (tofSecHandle_t *tofSecHandle)
 This function is used to close ToF Security and free buffers. 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, uint8_t *seed)
 This function is used to open AESCTRDRBG driver and, when needed, to generate 128-bit random seed. More...
 
int TOFSecurity_paramsInit (tofSecHandle_t *tofSecHandle, tofSecCfgPrms_t *tofSecCfgPrms)
 This function to initialize the tof security parameters. 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_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_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_roleSwitch()

void TOF_roleSwitch ( ToF_Role  newRole)

Switch ToF role.

Parameters
newRole- new role for this node to take
Returns
None

§ 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()

int TOF_setSeed ( uint8_t *  newSeed)

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

Note: This function can be used only by RTLS Passive and RTLS Slave. It cannot be used by RTLS Master.

Parameters
newSeed- New seed handle.
Returns
int - TOF_SEC_SUCCESS_E if succeeded, other if failed

§ 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
int - 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,
uint8_t *  seed 
)

This function is used to open AESCTRDRBG driver and, when needed, to generate 128-bit random seed.

input parameters

Parameters
tofSecHandle- A pointer to an empty tof security handle.
seed- NULL if need to generate seed, otherwise, a pointer to 128-bit random seed.

output parameters

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

§ TOFSecurity_paramsInit()

int TOFSecurity_paramsInit ( tofSecHandle_t tofSecHandle,
tofSecCfgPrms_t tofSecCfgPrms 
)

This function to initialize the tof security parameters.

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
int - NULL if failed, other if succeeded.
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale