TI BLE-Stack for Bluetooth API Documentation  3.03.00.00
rfc_cmd_tof.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file rfc_cmd_tof.h
4 
5  @brief This file contains methods to rf commands used by TOF module
6  Group: WCS, BTS
7  $Target Device: DEVICES $
8 
9  ******************************************************************************
10  $License: BSD3 2018 $
11  ******************************************************************************
12  $Release Name: PACKAGE NAME $
13  $Release Date: PACKAGE RELEASE DATE $
14  *****************************************************************************/
15 
26 #ifndef RFC_CMD_TOF_H_
27 #define RFC_CMD_TOF_H_
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 #include <ti/devices/DeviceFamily.h>
35 #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
36 #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
37 #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
38 
39 #include "tof/TOF.h"
40 
41 #include <stdint.h>
42 
43 typedef struct
44 {
45  int32_t T1; // = [31..8].[7..0], T1 = time << 8 + compensation.
46  uint8_t freqIndex;
47  int8_t RSSI;
48 } rfc_CMD_TOF_sample_t;
49 
50 //Maximum number of different frequencies allowed
51 typedef struct
52 {
53  uint16_t freq; // The frequency to which this calibration data is valid
54  uint8_t mid; // Mid calibration data
55  uint8_t coarse; // Coarse calibration value
56  uint8_t kt; // TDC calibration kt result
57  uint16_t tdc; // TDC calibration inverse kt result
58 } rfc_CMD_TOF_synthCal_t;
59 
60 typedef struct {
61  uint16_t commandNo;
62  uint16_t status;
63  rfc_radioOp_t *pNextOp;
66  ratmr_t startTime;
67  struct {
68  uint8_t triggerType:4;
69  uint8_t bEnaCmd:1;
70  uint8_t triggerNo:2;
72  uint8_t pastTrig:1;
73  } startTrigger;
75  struct {
76  uint8_t rule:4;
77  uint8_t nSkip:4;
78  } condition;
79  uint16_t __dummy0;
80 
81  uint32_t endTime; // Timeout [0.250µs ticks] for each measurement
82  uint16_t numIterations; // Number of unique sync words that should be sent
83  uint8_t bMaster; // Boolean to decide if device is master(1), passive(2) or slave (0)
84  uint8_t mode; // 0 = 2 Mbps mode, 1 = 1 Mbps mode (2 Mbps recommended)
85 
86  uint8_t *pBufTx; // Pointer to TX buffer. RF core will blindly read numIterations or doubleBufferLen packets from this pointer. If NULL, it it not used.
87  uint8_t *pBufRx; // Pointer to RX buffer. RF core will blindly write numIterations or doubleBufferLen packets from this pointer. If NULL, it is not used.
88  rfc_CMD_TOF_sample_t* pT1RSSIBuf; // Contains the time measured, RSSI and frequency
89  uint32_t SW0Timestamp; // RAT timestamp for when SW[0] was found
90 
91  uint64_t *pSyncWord; // Pointer to sync word buffer 1, this is always used
92  uint64_t *pSyncWord2; // Pointer to sync word buffer 2, only used in double buffer
93  uint32_t doubleBufferLen; // Length (in syncwords) of double buffer. If doubleBufferLen = 0, then single buffer is used, i.e. size found from numIterations
94 
95  uint8_t bSync32; // Length of syncword, 1 = 32 bit or 2 = 64 bit (64 bit recommended)
96  uint8_t txPower; // Output Power
97  uint8_t bPreamble; // Boolean deciding 2 byte preamble (bPreamble2=0 is 1 byte, bPreamble2=1 is 2 byte)
98  uint8_t useCompensation; // If 1 then use STIM, if 2 then correlator compensation is used, else it's unused.
99 
100  uint16_t missedPktLimit; // Limit for missed packets. 0xFFFF is run forever IF missedSW0Limit == 0xFFFF
101  uint16_t missedSW0Limit; // Limit for missed SW[0]. When this is reached, command will return. 0xFFFF is run forever if missedPktLimit = 0xFFFF
102  uint16_t timeslotTimeout; // Timeslots timeout, in [0.250?s ticks]. Needs to be larger than time for transmission + timeout.
103  uint16_t syncTimeout; // How long first RX timeout should be in [0.250?s ticks] ticks. This is to enable a longer RX time for the first syncword
104 
105  uint8_t numFreq; // Number of frequencies used in the frequency hopping
106  uint8_t seed; // Seed for random number generator used for frequency hopping
107  uint8_t mask; // Mask for random number generator used for frequency hopping
108  uint8_t period; // Period for how often freq. should change, period in regards to sync words
109 
110  rfc_CMD_TOF_synthCal_t* freqCalibList;// Pointer to frequency calibration struct, used for the pre-calibration of the synth
111 
112  uint16_t freqCalibTime; // Time for frequency calibration in [0.250?s ticks], in the API due to calibration settings
113  uint16_t numResultsReady; // Variable telling how many results have been written to the result buffer. To be used with the partial result readout
114 
115  uint16_t resultReadyFrequency; // The frequency of which results are reported, where results are reported when each n*resultReadyFrequency results were collected
116  uint8_t syncwordBufferInUse; // Flag to say which of the two syncword buffer are in use.
117  uint8_t syncwordBufferReady; // Flag to say which of and if the double buffers are ready to be used.
118 
119  uint16_t txRxBufferLen; // Length of tx/rx payload buffer in bytes.
120  uint8_t LQIThreshold; // Threshold for filtering the magnitude of LQI. Will filter out slave responses in master node, and slave and master responses in passive node. Lower threshold will filter more.
121  uint8_t magnDiffThreshold; // Threshold for magnitude difference in standard packet (when tx/rx buffer values are not applied). Lower threshold will filter more.
122 
123 } rfc_CMD_TOF_t;
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* RFC_CMD_TOF_H_ */
130 
TOF interface.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale