Radio Control Layer (RCL)
ble_cs.h File Reference
#include <ti/drivers/rcl/RCL_Command.h>
#include <ti/drivers/rcl/RCL_Buffer.h>
#include <ti/drivers/rcl/handlers/ble_cs.h>
#include <ti/drivers/utils/List.h>
+ Include dependency graph for ble_cs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RCL_CmdBleCs
 BLE Channel Sounding. More...
 
struct  RCL_CmdBleCs_Step
 BLE Channel Sounding Step. More...
 
struct  IQSample
 BLE Channel Sounding IQ Sample. More...
 
struct  MagnData
 BLE Channel Sounding QQ data. More...
 
struct  RCL_CmdBleCs_StepResult
 BLE Channel Sounding Step Result. More...
 
union  S2RSample
 BLE Channel Sounding S2R Sample type definition. More...
 
struct  RCL_CmdBleCs_S2r
 BLE Channel Sounding S2R IQ Data. More...
 
struct  RCL_CmdBleCs_Output
 BLE Channel Sounding Output Parameters. More...
 
struct  RCL_CMD_BLE_CS_t.mode
 
struct  RCL_CMD_BLE_CS_t.antennaConfig
 
struct  RCL_CMD_BLE_CS_t.timing
 
struct  RCL_CMD_BLE_CS_t.frontend
 
struct  RCL_CMD_BLE_CS_STEP_t.options
 

Macros

#define RCL_CMDID_BLE_CS   0x1001U
 
#define RCL_BLE_CS_US_TO_MCE_TIMER(x)   ((x)*48)
 
#define RCL_BLE_CS_US_TO_PBE_TIMER(x)   ((x)*4)
 
#define RCL_BLE_CS_MCE_TIMER_TO_US(x)   ((x)/48)
 
#define RCL_BLE_CS_PBE_TIMER_TO_US(x)   ((x)/4)
 
#define RCL_BLE_CS_MCE_TIMER_TO_PBE_TIMER(x)   ((x)/12)
 
#define RCL_BLE_CS_MAX_NUM_ANT   4
 
#define RCL_BLE_CS_MAX_NUM_ANT_PATH   5
 
#define RCL_BLE_CS_MAX_PAYLOAD_SIZE   4
 
#define RCL_BLE_CS_NUM_CORR   3
 
#define RCL_BLE_CS_NUM_STIM   2
 
#define RCL_BLE_CS_LEN_S2R   512
 
#define RCL_CmdBleCs_Default()
 
#define RCL_CmdBleCs_DefaultRuntime()   (RCL_CmdBleCs) RCL_CmdBleCs_Default()
 

Typedefs

typedef enum RCL_CMD_BLE_CS_Phy_e RCL_CmdBleCs_Phy
 
typedef enum RCL_CMD_BLE_CS_Role_e RCL_CmdBleCs_Role
 
typedef enum RCL_CMD_BLE_CS_StepMode_e RCL_CmdBleCs_StepMode
 
typedef enum RCL_CMD_BLE_CS_PacketResult_e RCL_CmdBleCs_PacketResult
 
typedef enum RCL_CMD_BLE_CS_Tfcs_e RCL_CmdBleCs_Tfcs
 
typedef enum RCL_CMD_BLE_CS_Tpm_e RCL_CmdBleCs_Tpm
 
typedef enum RCL_CMD_BLE_CS_Tip_e RCL_CmdBleCs_Tip
 
typedef enum RCL_CMD_BLE_CS_Tsw_e RCL_CmdBleCs_Tsw
 
typedef enum RCL_CMD_BLE_CS_AntennaConfig_e RCL_CmdBleCs_AntennaConfig
 
typedef enum RCL_CMD_BLE_CS_Payload_e RCL_CmdBleCs_Payload
 

Enumerations

enum  RCL_CMD_BLE_CS_Phy_e { RCL_CmdBleCs_Phy_1M, RCL_CmdBleCs_Phy_2M, RCL_CmdBleCs_Phy_Length }
 Enumerator of phy types. More...
 
enum  RCL_CMD_BLE_CS_Role_e { RCL_CmdBleCs_Role_Initiator, RCL_CmdBleCs_Role_Reflector, RCL_CmdBleCs_Role_Length }
 Enumerator of role types. More...
 
enum  RCL_CMD_BLE_CS_StepMode_e {
  RCL_CmdBleCs_StepMode_0, RCL_CmdBleCs_StepMode_1, RCL_CmdBleCs_StepMode_2, RCL_CmdBleCs_StepMode_3,
  RCL_CmdBleCs_StepMode_Length
}
 Enumerator of step types. More...
 
enum  RCL_CMD_BLE_CS_PacketResult_e {
  RCL_CmdBleCs_PacketResult_Error, RCL_CmdBleCs_PacketResult_Ok, RCL_CmdBleCs_PacketResult_BitError, RCL_CmdBleCs_PacketResult_Lost,
  RCL_CmdBleCs_PacketResult_Length
}
 Enumerator of packet status options. More...
 
enum  RCL_CMD_BLE_CS_Tfcs_e {
  RCL_CmdBleCs_Tfcs_80us, RCL_CmdBleCs_Tfcs_100us, RCL_CmdBleCs_Tfcs_120us, RCL_CmdBleCs_Tfcs_150us,
  RCL_CmdBleCs_Tfcs_Length
}
 Enumerator of tFcs duration options. More...
 
enum  RCL_CMD_BLE_CS_Tpm_e { RCL_CmdBleCs_Tpm_10us, RCL_CmdBleCs_Tpm_20us, RCL_CmdBleCs_Tpm_40us, RCL_CmdBleCs_Tpm_Length }
 Enumerator of tPm duration options. More...
 
enum  RCL_CMD_BLE_CS_Tip_e {
  RCL_CmdBleCs_Tip_40us, RCL_CmdBleCs_Tip_50us, RCL_CmdBleCs_Tip_60us, RCL_CmdBleCs_Tip_80us,
  RCL_CmdBleCs_Tip_145us, RCL_CmdBleCs_Tip_Length
}
 Enumerator of tIp duration. More...
 
enum  RCL_CMD_BLE_CS_Tsw_e {
  RCL_CmdBleCs_Tsw_0us, RCL_CmdBleCs_Tsw_1us, RCL_CmdBleCs_Tsw_2us, RCL_CmdBleCs_Tsw_4us,
  RCL_CmdBleCs_Tsw_10us, RCL_CmdBleCs_Tsw_Length
}
 Enumerator of antenna switch duration. More...
 
enum  RCL_CMD_BLE_CS_AntennaConfig_e {
  RCL_CmdBleCs_AntennaConfig_1x1, RCL_CmdBleCs_AntennaConfig_1x2, RCL_CmdBleCs_AntennaConfig_1x3, RCL_CmdBleCs_AntennaConfig_1x4,
  RCL_CmdBleCs_AntennaConfig_2x1, RCL_CmdBleCs_AntennaConfig_3x1, RCL_CmdBleCs_AntennaConfig_4x1, RCL_CmdBleCs_AntennaConfig_2x2,
  RCL_CmdBleCs_AntennaConfig_Length
}
 Enumerator of antenna configuration. More...
 
enum  RCL_CMD_BLE_CS_Payload_e {
  RCL_CmdBleCs_Payload_None, RCL_CmdBleCs_Payload_32bit, RCL_CmdBleCs_Payload_64bit, RCL_CmdBleCs_Payload_96bit,
  RCL_CmdBleCs_Payload_128bit, RCL_CmdBleCs_Payload_Length
}
 Enumerator of payload length. More...
 

Data Structure Documentation

◆ RCL_CMD_BLE_CS_t

struct RCL_CMD_BLE_CS_t

BLE Channel Sounding.

Command to execute a BLE Channel Sounding event

Data Fields
RCL_Command common
struct RCL_CMD_BLE_CS_t mode
struct RCL_CMD_BLE_CS_t antennaConfig
struct RCL_CMD_BLE_CS_t timing
struct RCL_CMD_BLE_CS_t frontend
uint16_t reserved1
RCL_CmdBleCs_Step * steps

Pointer to step list

RCL_CmdBleCs_StepResult * results

Pointer to result list

RCL_CmdBleCs_S2r * s2rResults

Pointer to container list

RCL_CmdBleCs_Output * output

Pointer to statistics

◆ RCL_CMD_BLE_CS_STEP_t

struct RCL_CMD_BLE_CS_STEP_t

BLE Channel Sounding Step.

Descriptor to configure a single step within the BLE Channel Sounding Event

Data Fields
uint16_t channelIdx

Integer index of channel information (0: 2400MHz)

uint16_t mode

Step mode RCL_CmdBleCs_StepMode

struct RCL_CMD_BLE_CS_STEP_t options
uint16_t foffErr

Internal! Used for frequency offset compensation

uint16_t tAdjustA

Internal! Used for timegrid adjustment

uint16_t tAdjustB

Internal! Used for timegrid adjustment

uint16_t reserved0
uint16_t payloadLen

Length of payload in units of 32bit words RCL_CmdBleCs_Payload

uint32_t payloadTx[RCL_BLE_CS_MAX_PAYLOAD_SIZE]

Payload to transmit containing random bit sequence (TX)

uint32_t payloadRx[RCL_BLE_CS_MAX_PAYLOAD_SIZE]

Expected payload to receive containing random bit sequence (RX)

uint32_t aaTx

Access Address to be transmitted

uint32_t aaRx

Access Address to be received

uint16_t antennaPermIdx

Index of entry to be used from the antenna permutation table RCL_CmdBleCs_AntennaConfig

uint16_t antennaSequence

Internal! Decoded antenna control sequence based on permutation table

uint16_t tStep

Internal! The total duration of step dynamically calculated

uint16_t tAntenna

Internal! The duration of optional payload, if any. Needed for antenna timing adjustment

◆ IQSample

struct IQSample

BLE Channel Sounding IQ Sample.

Container to store complex vectors

Data Fields
int16_t q

Sample Q-branch

int16_t i

Sample I-branch

◆ MagnData

struct MagnData

BLE Channel Sounding QQ data.

Container to store RSSI data for postprocess of the quality of tone

Data Fields
int16_t magnMin

Minimum of signal magnitude during TPM

int16_t magnMax

Maximum of signal magnitude during TPM

int16_t magnAvg

Average of signal magnitude during TPM

int16_t magnAvgdB

Average of signal magnitude during TPM in dB

◆ RCL_CMD_BLE_CS_STEP_RESULT_t

struct RCL_CMD_BLE_CS_STEP_RESULT_t

BLE Channel Sounding Step Result.

Container to store the results of a single step within the BLE Channel Sounding Event

+ Collaboration diagram for RCL_CmdBleCs_StepResult:
Data Fields
uint16_t pktResult

Result of packet reception RCL_CmdBleCs_PacketResult

int16_t foffMeasured

Frequency offset between devices (only set on Initiator Mode 0)

uint16_t rtt

RTT timestamp

uint16_t corr[RCL_BLE_CS_NUM_CORR]

Correlator values

uint16_t stim[RCL_BLE_CS_NUM_STIM]

STIM values: time offset, gardner error

IQSample dc

DC offset measured on packet

IQSample pct[RCL_BLE_CS_MAX_NUM_ANT_PATH]

Phase Correction Terms per antenna path (incl. extension)

uint32_t payload[RCL_BLE_CS_MAX_PAYLOAD_SIZE]

Payload containing random bit sequence (RX)

MagnData magn[RCL_BLE_CS_MAX_NUM_ANT_PATH]

Received magnitude data of tone per antenna path for quality estimation (incl. extension)

◆ S2RSample

union S2RSample

BLE Channel Sounding S2R Sample type definition.

One S2R sample can be interpreted multiple ways, depending of the signal source

+ Collaboration diagram for S2RSample:
Data Fields
uint32_t word

Sample format for copying data

uint8_t byte[4]

Sample format of the Decimation Stage

IQSample iq

Sample format of the Front End Stage

◆ RCL_CMD_BLE_CS_S2R_t

struct RCL_CMD_BLE_CS_S2R_t

BLE Channel Sounding S2R IQ Data.

Container to store raw S2R samples of a BLE Channel Sounding Step

+ Collaboration diagram for RCL_CmdBleCs_S2r:
Data Fields
uint16_t idx

The index of entry in the step list which the data belongs to

uint16_t length

Number of valid samples in data

S2RSample data[RCL_BLE_CS_LEN_S2R]

Raw samples captured

◆ RCL_CMD_BLE_CS_OUTPUT_t

struct RCL_CMD_BLE_CS_OUTPUT_t

BLE Channel Sounding Output Parameters.

Container to store the statistical outputs of the BLE Channel Sounding Event

Data Fields
uint16_t nStepsWritten

Number of steps sent to the PBE through the FIFO

uint16_t nResultsRead

Number of results read from the PBE through the FIFO

uint16_t nStepsDone

Number of steps have been executed by the PBE

uint16_t nRxOk

Number of steps where pktResult == OK, filled by the CM0

uint16_t nRxNok

Number of steps where pktResult != OK, filled by the CM0

uint8_t nS2RDone

Number of Samples-To-Ram containers filled by the CM0

int8_t lastRssi

Last valid RSSI received by the PBE

int16_t lastFoff

Last valid frequency offset received by the PBE

◆ RCL_CMD_BLE_CS_t.mode

struct RCL_CMD_BLE_CS_t.mode
Data Fields
uint16_t role:1

Role of the device RCL_CmdBleCs_Role

uint16_t phy:1

Phy used for packet exchange RCL_CmdBleCs_Phy

uint16_t repeatSteps:1

Enable continuous repetition of step list

uint16_t chFilterEnable:1

Enable filtering restricted channels (2402, 2403, 2425, 2426, 2427, 2479, 2480 MHz)

uint16_t nS2R:4

Total number of Samples-To-Ram containers in the list

uint16_t nSteps:8

Total number of steps within the BLE CS Sub-Event

◆ RCL_CMD_BLE_CS_t.antennaConfig

struct RCL_CMD_BLE_CS_t.antennaConfig
Data Fields
uint8_t select

Antenna pattern selection by index RCL_CmdBleCs_AntennaConfig

uint8_t gpoMask

Mask of GPOs on the LRF controlling the antennas

uint8_t gpoVal[RCL_BLE_CS_MAX_NUM_ANT]

GPOCTRL word for antenna path 0..3

◆ RCL_CMD_BLE_CS_t.timing

struct RCL_CMD_BLE_CS_t.timing
Data Fields
uint16_t tFcs

Config of time of Frequency Change period RCL_CmdBleCs_Tfcs

uint16_t tFm

Config of time of Frequency Measurement period

uint16_t tPm

Config of time of Phase Measurement Duration RCL_CmdBleCs_Tpm

uint16_t tIp1

Config of time of Interlude Period 1 RCL_CmdBleCs_Tip

uint16_t tIp2

Config of time of Interlude Period 2 RCL_CmdBleCs_Tip

uint16_t reserved
uint16_t tSw

Config of time of Antenna Switching duration RCL_CmdBleCs_Tsw

uint16_t tSwAdjustA

Time adjustment of first set of antenna switching within a step

uint16_t tSwAdjustB

Time adjustment of second set of antenna switching within a step

◆ RCL_CMD_BLE_CS_t.frontend

struct RCL_CMD_BLE_CS_t.frontend
Data Fields
uint8_t txPower

Index value of TX power

uint8_t rxGain

Index value of RX gain

uint8_t foffOverride

Frequency offset compensation override value in [4x FOFF] units.

uint8_t foffOverrideEnable:1

Disables automatic estimate foff estimation and enforces the use of the provided override

uint8_t reserved:7

◆ RCL_CMD_BLE_CS_STEP_t.options

struct RCL_CMD_BLE_CS_STEP_t.options
Data Fields
uint16_t toneExtension: 2

Configuration of tone extension

uint16_t reserved: 13
uint16_t infiniteRx: 1

Disable timeout on Reflector Mode 0

Macro Definition Documentation

◆ RCL_CMDID_BLE_CS

#define RCL_CMDID_BLE_CS   0x1001U

◆ RCL_BLE_CS_US_TO_MCE_TIMER

#define RCL_BLE_CS_US_TO_MCE_TIMER (   x)    ((x)*48)

◆ RCL_BLE_CS_US_TO_PBE_TIMER

#define RCL_BLE_CS_US_TO_PBE_TIMER (   x)    ((x)*4)

◆ RCL_BLE_CS_MCE_TIMER_TO_US

#define RCL_BLE_CS_MCE_TIMER_TO_US (   x)    ((x)/48)

◆ RCL_BLE_CS_PBE_TIMER_TO_US

#define RCL_BLE_CS_PBE_TIMER_TO_US (   x)    ((x)/4)

◆ RCL_BLE_CS_MCE_TIMER_TO_PBE_TIMER

#define RCL_BLE_CS_MCE_TIMER_TO_PBE_TIMER (   x)    ((x)/12)

◆ RCL_BLE_CS_MAX_NUM_ANT

#define RCL_BLE_CS_MAX_NUM_ANT   4

◆ RCL_BLE_CS_MAX_NUM_ANT_PATH

#define RCL_BLE_CS_MAX_NUM_ANT_PATH   5

◆ RCL_BLE_CS_MAX_PAYLOAD_SIZE

#define RCL_BLE_CS_MAX_PAYLOAD_SIZE   4

◆ RCL_BLE_CS_NUM_CORR

#define RCL_BLE_CS_NUM_CORR   3

◆ RCL_BLE_CS_NUM_STIM

#define RCL_BLE_CS_NUM_STIM   2

◆ RCL_BLE_CS_LEN_S2R

#define RCL_BLE_CS_LEN_S2R   512

◆ RCL_CmdBleCs_Default

#define RCL_CmdBleCs_Default ( )

◆ RCL_CmdBleCs_DefaultRuntime

#define RCL_CmdBleCs_DefaultRuntime ( )    (RCL_CmdBleCs) RCL_CmdBleCs_Default()

Typedef Documentation

◆ RCL_CmdBleCs_Phy

◆ RCL_CmdBleCs_Role

◆ RCL_CmdBleCs_StepMode

◆ RCL_CmdBleCs_PacketResult

◆ RCL_CmdBleCs_Tfcs

◆ RCL_CmdBleCs_Tpm

◆ RCL_CmdBleCs_Tip

◆ RCL_CmdBleCs_Tsw

◆ RCL_CmdBleCs_AntennaConfig

◆ RCL_CmdBleCs_Payload

Enumeration Type Documentation

◆ RCL_CMD_BLE_CS_Phy_e

Enumerator of phy types.

Describes the phy packets shall be transmitted

Enumerator
RCL_CmdBleCs_Phy_1M 
RCL_CmdBleCs_Phy_2M 
RCL_CmdBleCs_Phy_Length 

◆ RCL_CMD_BLE_CS_Role_e

Enumerator of role types.

Describes the role of the device during a BLE channel sounding event

Enumerator
RCL_CmdBleCs_Role_Initiator 
RCL_CmdBleCs_Role_Reflector 
RCL_CmdBleCs_Role_Length 

◆ RCL_CMD_BLE_CS_StepMode_e

Enumerator of step types.

Describes the available modes of a BLE CS step

Enumerator
RCL_CmdBleCs_StepMode_0 

(M) Pkt-Pkt-Tn

RCL_CmdBleCs_StepMode_1 

(M) Pkt-Pkt

RCL_CmdBleCs_StepMode_2 

(M) Tn-Tn

RCL_CmdBleCs_StepMode_3 

(O) Pkt-Tn-Tn-Pkt

RCL_CmdBleCs_StepMode_Length 

◆ RCL_CMD_BLE_CS_PacketResult_e

Enumerator of packet status options.

Describes the available packet status words

Enumerator
RCL_CmdBleCs_PacketResult_Error 

NA for mode 2 steps, otherwise command execution error.

RCL_CmdBleCs_PacketResult_Ok 

The packet reception was succesfull

RCL_CmdBleCs_PacketResult_BitError 

The packet was received with one or more bit errors

RCL_CmdBleCs_PacketResult_Lost 

The packet reception was terminated by timeout

RCL_CmdBleCs_PacketResult_Length 

◆ RCL_CMD_BLE_CS_Tfcs_e

Enumerator of tFcs duration options.

Describes the available durations for frequency change

Enumerator
RCL_CmdBleCs_Tfcs_80us 

(C.1)

RCL_CmdBleCs_Tfcs_100us 
RCL_CmdBleCs_Tfcs_120us 
RCL_CmdBleCs_Tfcs_150us 

(M)

RCL_CmdBleCs_Tfcs_Length 

◆ RCL_CMD_BLE_CS_Tpm_e

Enumerator of tPm duration options.

Describes the available durations for phase measurement

Enumerator
RCL_CmdBleCs_Tpm_10us 
RCL_CmdBleCs_Tpm_20us 
RCL_CmdBleCs_Tpm_40us 

(M)

RCL_CmdBleCs_Tpm_Length 

◆ RCL_CMD_BLE_CS_Tip_e

Enumerator of tIp duration.

Describes the available durations for interlude period

Enumerator
RCL_CmdBleCs_Tip_40us 

(C.1)

RCL_CmdBleCs_Tip_50us 
RCL_CmdBleCs_Tip_60us 
RCL_CmdBleCs_Tip_80us 

(C.1)

RCL_CmdBleCs_Tip_145us 

(M)

RCL_CmdBleCs_Tip_Length 

◆ RCL_CMD_BLE_CS_Tsw_e

Enumerator of antenna switch duration.

Describes the available durations for antenna switching transient

Enumerator
RCL_CmdBleCs_Tsw_0us 

(M) for 1x1

RCL_CmdBleCs_Tsw_1us 
RCL_CmdBleCs_Tsw_2us 
RCL_CmdBleCs_Tsw_4us 
RCL_CmdBleCs_Tsw_10us 

(M)

RCL_CmdBleCs_Tsw_Length 

◆ RCL_CMD_BLE_CS_AntennaConfig_e

Enumerator of antenna configuration.

Describes the available values for configuration of antenna control for PCT measurement.

Enumerator
RCL_CmdBleCs_AntennaConfig_1x1 

(M)

RCL_CmdBleCs_AntennaConfig_1x2 
RCL_CmdBleCs_AntennaConfig_1x3 
RCL_CmdBleCs_AntennaConfig_1x4 
RCL_CmdBleCs_AntennaConfig_2x1 
RCL_CmdBleCs_AntennaConfig_3x1 
RCL_CmdBleCs_AntennaConfig_4x1 
RCL_CmdBleCs_AntennaConfig_2x2 
RCL_CmdBleCs_AntennaConfig_Length 

◆ RCL_CMD_BLE_CS_Payload_e

Enumerator of payload length.

Describes the available payload lengths

Enumerator
RCL_CmdBleCs_Payload_None 
RCL_CmdBleCs_Payload_32bit 
RCL_CmdBleCs_Payload_64bit 
RCL_CmdBleCs_Payload_96bit 
RCL_CmdBleCs_Payload_128bit 
RCL_CmdBleCs_Payload_Length 
RCL_CMDID_BLE_CS
#define RCL_CMDID_BLE_CS
Definition: ble_cs.h:61
RCL_Command_Default
#define RCL_Command_Default(_id, _handler)
Definition: RCL_Command.h:174
RCL_Handler_BLE_CS
RCL_Events RCL_Handler_BLE_CS(RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEventsIn)
Definition: ble_cs.c:949