Radio Control Layer (RCL)
ble_cs.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <ti/log/Log.h>
#include <ti/drivers/rcl/RCL_Command.h>
#include <ti/drivers/rcl/RCL_Buffer.h>
#include <ti/drivers/rcl/RCL_Scheduler.h>
#include <ti/drivers/rcl/hal/hal.h>
#include <ti/drivers/rcl/commands/ble_cs.h>
#include <ti/devices/DeviceFamily.h>
+ Include dependency graph for ble_cs.c:

Data Structures

union  RCL_AntennaPath_t
 
struct  RCL_AntennaConfig_t
 
union  RCL_PctConfig_t
 
union  RCL_MagnConfig_t
 
struct  RCL_Tadjust_t
 
struct  RCL_PhyConfig_t
 
struct  .common
 
struct  .ble_cs
 
struct  RCL_AntennaPath_t.a
 
struct  RCL_PctConfig_t.__unnamed__
 
struct  RCL_MagnConfig_t.__unnamed__
 

Macros

#define BLE_CS_BASE_FREQ_MHZ   2400
 
#define BLE_CS_MIN_CHANNEL   2
 
#define BLE_CS_MAX_CHANNEL   80
 
#define BLE_CS_NUM_CHANNELS   90
 
#define BLE_CS_NUM_INVALID_CHANNELS   7
 
#define BLE_CS_SILENT_CHANNEL   100
 
#define BLE_CS_NUM_PERMUTATION   24
 
#define BLE_CS_S2R_OVERSAMPLE_RATE   4
 
#define BLE_CS_FIRST_BATCH_SIZE   1
 
#define DECODE_ANTENNA(x, y)   (((x) >> ((y)*2)) & 0x03)
 
#define ENCODE_ANTENNA(x, y)   (((x) << ((y)*4)))
 
#define TRD   240
 
#define TGD   480
 
#define TPLT   960
 
#define TPYL   0
 
#define T9   432
 
#define T8   384
 
#define BLE_CS_S2R_SAMPLE_INCREMENT   32
 
#define BLE_CS_S2R_SAMPLE_SIZE   4
 

Functions

static void RCL_Handler_BLE_CS_configureTxRxFIFO (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_fillTxBuffer (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_readRxBuffer (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_configureS2R (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_readS2RSamples (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_readStatistics (RCL_CmdBleCs *pCmd)
 
static void RCL_Handler_BLE_CS_preprocessCommand (RCL_CmdBleCs *pCmd)
 
static RCL_CmdBleCs_Step * RCL_Handler_BLE_CS_fetchNextStep (RCL_CmdBleCs *pCmd)
 
static RCL_CmdBleCs_Step * RCL_Handler_BLE_CS_preprocessStep (RCL_CmdBleCs *pCmd, RCL_CmdBleCs_Step *pStep)
 
static RCL_CmdBleCs_StepResult * RCL_Handler_BLE_CS_fetchNextStepResult (RCL_CmdBleCs *pCmd)
 
static RCL_CommandStatus RCL_Handler_BLE_CS_findPbeErrorEndStatus (uint16_t pbeEndStatus)
 
RCL_Events RCL_Handler_BLE_CS (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEventsIn)
 

Variables

struct {
   struct {
RCL_CommandStatus endStatus
 
   } common
 
   struct {
uint32_t startTime
 
   } ble_cs
 
bleCsHandlerState
 
uint32_t tStepLut [RCL_CmdBleCs_StepMode_Length+1]
 
uint16_t tAdjALut [RCL_CmdBleCs_StepMode_Length]
 
uint16_t tAdjBLut [RCL_CmdBleCs_StepMode_Length]
 
uint16_t tAntennaAdjLut [RCL_CmdBleCs_StepMode_Length]
 
uint16_t tInfiniteRxAdj
 
const RCL_AntennaPath_t antennaPermutation [BLE_CS_NUM_PERMUTATION]
 
const RCL_AntennaConfig_t antennaConfig [RCL_CmdBleCs_AntennaConfig_Length]
 
const RCL_PhyConfig_t phyConfigLut [RCL_CmdBleCs_Phy_Length]
 
const int8_t foffErrorLut [BLE_CS_NUM_CHANNELS]
 
const uint8_t channelFilter [BLE_CS_NUM_INVALID_CHANNELS]
 
const uint16_t payloadLut [RCL_CmdBleCs_Payload_Length]
 

Data Structure Documentation

◆ RCL_AntennaPath_t

union RCL_AntennaPath_t
Data Fields
struct RCL_AntennaPath_t a
uint8_t apn

◆ RCL_AntennaConfig_t

struct RCL_AntennaConfig_t
+ Collaboration diagram for RCL_AntennaConfig_t:
Data Fields
uint8_t numPath: 3

Total number of antenna path

uint8_t numPerm: 5

Total number of permutation possible with this configuration

uint8_t increment

How to index the permutation table

RCL_AntennaPath_t ap[2]

◆ RCL_PctConfig_t

union RCL_PctConfig_t
Data Fields
struct RCL_PctConfig_t __unnamed__
uint16_t val

◆ RCL_MagnConfig_t

union RCL_MagnConfig_t
Data Fields
struct RCL_MagnConfig_t __unnamed__
uint16_t val

◆ RCL_Tadjust_t

struct RCL_Tadjust_t
Data Fields
int16_t mode0[2]
int16_t mode1[2]
int16_t mode2[2]
int16_t mode3[2]

◆ RCL_PhyConfig_t

struct RCL_PhyConfig_t
+ Collaboration diagram for RCL_PhyConfig_t:
Data Fields
uint16_t baud
uint16_t symmap
uint16_t demmisc3
uint16_t tPostProcessDiv1

Duration set aside for post processing

uint16_t tPostProcessDiv12

Duration set aside for post processing

uint16_t tRxTimeoutI0

Initiator must terminate packet reception before end of step

uint16_t tRxTimeoutI3

Initiator must terminate packet reception before end of step

int16_t tPilotAdjust

Pilot tone need to be adjusted with shaper delay

uint16_t tStartup

Duration set aside for starting up the topSMs and start to emit a tone on the antenna

uint16_t tPacket

Duration of packet [preamble + AA + Trailer]

uint16_t tRxTimeoutRn

Reception timeout on reflector side

uint16_t tInfiniteRx
uint16_t tTr
uint16_t tCorr
uint16_t tDem
uint16_t tFidc
uint16_t tTxModDelay
uint16_t tAntennaAdj
RCL_PctConfig_t pctConfig[RCL_CmdBleCs_Tpm_Length]
RCL_MagnConfig_t magnConfig[RCL_CmdBleCs_Tpm_Length]
RCL_Tadjust_t tAdj[RCL_CmdBleCs_Role_Length]

◆ .common

struct .common
Data Fields
RCL_CommandStatus endStatus

◆ .ble_cs

struct .ble_cs
Data Fields
uint32_t startTime

◆ RCL_AntennaPath_t.a

struct RCL_AntennaPath_t.a
Data Fields
uint8_t a0: 2
uint8_t a1: 2
uint8_t a2: 2
uint8_t a3: 2

◆ RCL_PctConfig_t.__unnamed__

struct RCL_PctConfig_t.__unnamed__
Data Fields
uint8_t period: 2

Configures the accumulation period of DEMFIDC module

uint8_t numIteration: 2

Configures how many times to run the accumulator period

uint8_t fracWaitAdj: 4
uint8_t fracWait

◆ RCL_MagnConfig_t.__unnamed__

struct RCL_MagnConfig_t.__unnamed__
Data Fields
uint8_t magnIteration
uint8_t magnAvg

Macro Definition Documentation

◆ BLE_CS_BASE_FREQ_MHZ

#define BLE_CS_BASE_FREQ_MHZ   2400

◆ BLE_CS_MIN_CHANNEL

#define BLE_CS_MIN_CHANNEL   2

◆ BLE_CS_MAX_CHANNEL

#define BLE_CS_MAX_CHANNEL   80

◆ BLE_CS_NUM_CHANNELS

#define BLE_CS_NUM_CHANNELS   90

◆ BLE_CS_NUM_INVALID_CHANNELS

#define BLE_CS_NUM_INVALID_CHANNELS   7

◆ BLE_CS_SILENT_CHANNEL

#define BLE_CS_SILENT_CHANNEL   100

◆ BLE_CS_NUM_PERMUTATION

#define BLE_CS_NUM_PERMUTATION   24

◆ BLE_CS_S2R_OVERSAMPLE_RATE

#define BLE_CS_S2R_OVERSAMPLE_RATE   4

◆ BLE_CS_FIRST_BATCH_SIZE

#define BLE_CS_FIRST_BATCH_SIZE   1

◆ DECODE_ANTENNA

#define DECODE_ANTENNA (   x,
 
)    (((x) >> ((y)*2)) & 0x03)

◆ ENCODE_ANTENNA

#define ENCODE_ANTENNA (   x,
 
)    (((x) << ((y)*4)))

◆ TRD

#define TRD   240

◆ TGD

#define TGD   480

◆ TPLT

#define TPLT   960

◆ TPYL

#define TPYL   0

◆ T9

#define T9   432

◆ T8

#define T8   384

◆ BLE_CS_S2R_SAMPLE_INCREMENT

#define BLE_CS_S2R_SAMPLE_INCREMENT   32

◆ BLE_CS_S2R_SAMPLE_SIZE

#define BLE_CS_S2R_SAMPLE_SIZE   4

Function Documentation

◆ RCL_Handler_BLE_CS_configureTxRxFIFO()

static void RCL_Handler_BLE_CS_configureTxRxFIFO ( RCL_CmdBleCs *  pCmd)
static

Referenced by RCL_Handler_BLE_CS().

◆ RCL_Handler_BLE_CS_fillTxBuffer()

static void RCL_Handler_BLE_CS_fillTxBuffer ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_readRxBuffer()

static void RCL_Handler_BLE_CS_readRxBuffer ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_configureS2R()

static void RCL_Handler_BLE_CS_configureS2R ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_readS2RSamples()

void RCL_Handler_BLE_CS_readS2RSamples ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_readStatistics()

static void RCL_Handler_BLE_CS_readStatistics ( RCL_CmdBleCs *  pCmd)
static

Referenced by RCL_Handler_BLE_CS().

◆ RCL_Handler_BLE_CS_preprocessCommand()

◆ RCL_Handler_BLE_CS_fetchNextStep()

static RCL_CmdBleCs_Step * RCL_Handler_BLE_CS_fetchNextStep ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_preprocessStep()

◆ RCL_Handler_BLE_CS_fetchNextStepResult()

static RCL_CmdBleCs_StepResult * RCL_Handler_BLE_CS_fetchNextStepResult ( RCL_CmdBleCs *  pCmd)
static

◆ RCL_Handler_BLE_CS_findPbeErrorEndStatus()

◆ RCL_Handler_BLE_CS()

Variable Documentation

◆ bleCsHandlerState

struct { ... } bleCsHandlerState

Referenced by RCL_Handler_BLE_CS().

◆ tStepLut

◆ tAdjALut

◆ tAdjBLut

◆ tAntennaAdjLut

◆ tInfiniteRxAdj

◆ antennaPermutation

const RCL_AntennaPath_t antennaPermutation[BLE_CS_NUM_PERMUTATION]
Initial value:
= {
{{0,1,2,3}}, {{0,1,3,2}}, {{0,2,3,1}}, {{0,2,1,3}}, {{0,3,1,2}}, {{0,3,2,1}},
{{1,0,2,3}}, {{1,0,3,2}}, {{1,2,3,0}}, {{1,2,0,3}}, {{1,3,0,2}}, {{1,3,2,0}},
{{2,0,1,3}}, {{2,0,3,1}}, {{2,1,3,0}}, {{2,1,0,3}}, {{2,3,0,1}}, {{2,3,1,0}},
{{3,0,2,1}}, {{3,0,1,2}}, {{3,1,2,0}}, {{3,1,0,2}}, {{3,2,0,1}}, {{3,2,1,0}}
}

Referenced by RCL_Handler_BLE_CS_preprocessStep().

◆ antennaConfig

Initial value:
= {
{.numPath=1, .numPerm=1, .increment=0, .ap={{{0,0,0,0}}, {{0,0,0,0}}}},
{.numPath=2, .numPerm=2, .increment=6, .ap={{{0,0,0,0}}, {{0,1,0,0}}}},
{.numPath=3, .numPerm=6, .increment=3, .ap={{{0,0,0,0}}, {{0,1,2,0}}}},
{.numPath=4, .numPerm=24, .increment=1, .ap={{{0,0,0,0}}, {{0,1,2,3}}}},
{.numPath=2, .numPerm=2, .increment=6, .ap={{{0,1,0,0}}, {{0,0,0,0}}}},
{.numPath=3, .numPerm=6, .increment=3, .ap={{{0,1,2,0}}, {{0,0,0,0}}}},
{.numPath=4, .numPerm=24, .increment=1, .ap={{{0,1,2,3}}, {{0,0,0,0}}}},
{.numPath=4, .numPerm=24, .increment=1, .ap={{{0,0,1,1}}, {{0,1,1,0}}}}
}

Referenced by RCL_Handler_BLE_CS_preprocessCommand(), and RCL_Handler_BLE_CS_preprocessStep().

◆ phyConfigLut

◆ foffErrorLut

const int8_t foffErrorLut[BLE_CS_NUM_CHANNELS]
Initial value:
= {
38, 38, 38, 34, 34, 34, 30, 30, 30, 26,
26, 26, 26, 22, 22, 22, 18, 18, 18, 14,
14, 14, 10, 10, 10, 10, 6, 6, 6, 2,
2, 2, -2, -2, -2, -2, -6, -6, -6,-10,
-10,-10,-14,-14,-14,-14,-18,-18,-18,-22,
-22,-22,-26,-26,-26,-26,-30,-30,-30,-34,
-34,-34,-34,-38,-38,-38,-42,-42,-42,-46,
-46,-46,-46,-50,-50,-50,-54,-54,-54,-54,
-58,-58,-58,-62,-62,-62,-62,-66,-66,-66
}

Referenced by RCL_Handler_BLE_CS_preprocessStep().

◆ channelFilter

const uint8_t channelFilter[BLE_CS_NUM_INVALID_CHANNELS]
Initial value:
= {
2, 3, 25, 26, 27, 79, 80
}

Referenced by RCL_Handler_BLE_CS_preprocessStep().

◆ payloadLut

RCL_BLE_CS_US_TO_MCE_TIMER
#define RCL_BLE_CS_US_TO_MCE_TIMER(x)
Definition: ble_cs.h:64