TI-radar AWR1843 ARM-Cortex R4F core  1
mmWave_XSS.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * @file mmWave_XSS.h
3  * @brief This is the main common header file for both the MSS and DSS
4  * @author A. Astro, a.astro7x@gmail.com
5  * @date Jan 13 2020
6  * @version 0.1
7  *******************************************************************************/
8 
9 
10 #ifndef MMWAVE_XSS_H
11 #define MMWAVE_XSS_H
12 
13 /* To be enabled on MSS Core */
14 #define MSS
15 /* To be enabled on DSS Core */
16 //#define DSS
17 
18 /* MMWAVE Driver Include Files */
19 #include <ti/common/mmwave_error.h>
20 #include <ti/drivers/soc/soc.h>
21 #include <ti/drivers/crc/crc.h>
22 #include <ti/drivers/uart/UART.h>
23 #include <ti/drivers/pinmux/pinmux.h>
24 #include <ti/drivers/esm/esm.h>
25 #include <ti/drivers/soc/soc.h>
26 #include <ti/drivers/mailbox/mailbox.h>
27 #include <ti/control/mmwave/mmwave.h>
28 #include <ti/drivers/cbuff/cbuff.h>
29 #include <ti/drivers/adcbuf/ADCBuf.h>
30 #include <ti/drivers/edma/edma.h>
31 #include <ti/drivers/osal/DebugP.h>
32 
33 
34 /* BIOS/XDC Include Files */
35 #include <ti/sysbios/knl/Semaphore.h>
36 #include <ti/sysbios/knl/Event.h>
37 /* MMWAVE library Include Files */
38 #include <ti/control/mmwave/mmwave.h>
39 #include <common/app_cfg.h>
40 
41 /* MMW Demo Include Files */
42 #ifdef DSS
43 #include "dss_data_path.h"
44 #endif
45 
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
59 /*
60  #define MMWDEMO_CLI_SENSORSTART_EVT Event_Id_00
62 #define MMWDEMO_CLI_SENSORSTOP_EVT Event_Id_01
64 #define MMWDEMO_CLI_FRAMESTART_EVT Event_Id_02
66 #define MMWDEMO_BSS_CPUFAULT_EVT Event_Id_03
68 #define MMWDEMO_BSS_ESMFAULT_EVT Event_Id_04
70 #define MMWDEMO_BSS_MONITORING_REP_EVT Event_Id_05
72 #define MMWDEMO_BSS_CALIBRATION_REP_EVT Event_Id_06
74 #define MMWDEMO_DSS_START_COMPLETED_EVT Event_Id_07
76 #define MMWDEMO_DSS_STOP_COMPLETED_EVT Event_Id_08
78 #define MMWDEMO_DSS_START_FAILED_EVT Event_Id_09
79 */
80 
81 #define DSS_START_COMPLETED_EVT Event_Id_07
82 
83 
84 /* All CLI events */
85 #define MMWDEMO_CLI_EVENTS (MMWDEMO_CLI_SENSORSTART_EVT | \
86  MMWDEMO_CLI_SENSORSTOP_EVT | \
87  MMWDEMO_CLI_FRAMESTART_EVT)
88 
89 
90 /* All BSS faults events */
91 #define MMWDEMO_BSS_FAULT_EVENTS (MMWDEMO_BSS_CPUFAULT_EVT | \
92  MMWDEMO_BSS_ESMFAULT_EVT )
93 
94 
95 
96 
97 #ifdef DSS
98 
106 typedef enum MmwDemo_DSS_STATE_e
107 {
109  MmwDemo_DSS_STATE_INIT = 0,
110 
112  MmwDemo_DSS_STATE_STARTED,
113 
115  MmwDemo_DSS_STATE_STOPPED,
116 
119  MmwDemo_DSS_STATE_STOP_PENDING
120 
121 }MmwDemo_DSS_STATE;
122 
123 typedef struct MmwDemo_DSS_STATS_t
124 {
128  uint8_t configEvt;
129 
133  uint8_t startEvt;
134 
138  uint8_t stopEvt;
139 
141  uint32_t chirpIntSkipCounter;
142 
144  uint32_t frameIntSkipCounter;
145 
147  uint32_t chirpIntCounter;
148 
150  uint32_t frameStartIntCounter;
151 
154  uint32_t chirpEvt;
155 
158  uint32_t frameStartEvt;
159 
162  uint32_t frameTrigEvt;
163 
165  uint32_t numFailedTimingReports;
166 
168  uint32_t numCalibrationReports;
169 
172  uint32_t detObjLoggingSkip;
173 
176  uint32_t detObjLoggingErr;
177 }MmwDemo_DSS_STATS;
178 
179 #else
180 
187 typedef struct mmW_MSS_STATS_t
188 {
189 
192  uint8_t cliFrameStartEvt;
196  uint8_t datapathStopEvt;
199  uint32_t numCalibrationReports;
201 #endif
202 
211 typedef struct MCB_t
212 {
213 
214  SOC_Handle socHandle;
215  Mbox_Handle mboxHandle;
216  Semaphore_Handle mboxSemHandle;
217  SOC_SysIntListenerHandle chirpIntHandle;
218  SOC_SysIntListenerHandle frameStartIntHandle;
219  MMWave_Handle ctrlHandle;
224 #ifdef DSS
225  ADCBuf_Handle adcBufHandle;
226  MmwDemo_DSS_STATE state;
227  MmwDemo_DSS_STATS stats;
228  MmwDemo_DSS_DataPathObj dataPathObj[NUM_SUBFRAMES];
229  uint8_t loggingBufferAvailable;
230  uint8_t subframeIndx;
231  uint8_t interFrameProcToken;
232  uint8_t frameStartIntToken;
233  uint8_t chirpProcToken;
234  uint8_t mboxProcToken;
235  uint8_t frameProcToken;
236 
237 #else
238  Event_Handle eventHandle;
239  UART_Handle loggingUartHandle;
240  UART_Handle commandUartHandle;
242  bool cfgStatus;
245  int32_t frameStartToken;
248  int32_t chirpIntcumSum;
249  int32_t chirpInt;
251  int32_t subframeId;
252 #endif
253 
254 }MCB;
255 
256 extern MCB gMCB;
257 
258 #ifdef DSS
259 extern void _MmwDemo_dssAssert(int32_t expression, const char *file, int32_t line);
260 #define MmwDemo_dssAssert(expression) { \
261  _MmwDemo_dssAssert(expression, \
262  __FILE__, __LINE__); \
263  DebugP_assert(expression); \
264  }
265 #else
266 /*******************************************************************************************
267  * Extern CLI API:
268  *******************************************************************************************/
269 extern void MSS_CLIInit (void);
270 
271 #endif
272 
273 
274 /*******************************************************************************************
275  * Extern CFG API:
276  *******************************************************************************************/
277 extern void Cfg_AdvFrameCfgInitParams (rlAdvFrameCfg_t* ptrAdvFrameCfg);
278 extern void Cfg_FrameCfgInitParams (rlFrameCfg_t* ptrFrameCfg);
279 extern void Cfg_ProfileCfgInitParams (uint8_t profileNum, rlProfileCfg_t* ptrProfileCfg);
280 extern void Cfg_ChirpCfgInitParams (uint8_t chirpNum, rlChirpCfg_t* ptrChirpCfg);
281 extern void Cfg_LowPowerModeInitParams (rlLowPowerModeCfg_t* ptrLowPowerMode);
282 extern void Cfg_ChannelCfgInitParams (rlChanCfg_t* ptrChannelCfg);
283 extern void Cfg_ADCOutCfgInitParams (rlAdcOutCfg_t* ptrADCOutCfg);
284 
285 #ifdef __cplusplus
286 }
287 #endif
288 
289 #endif /* MMWAVE_XSS */
MSS_CLIInit
void MSS_CLIInit(void)
This is the CLI Execution Task.
Definition: mss_cli.c:311
MCB_t::chirpInt
int32_t chirpInt
! The total number of chirp available interrupts.
Definition: mmWave_XSS.h:248
MCB
struct MCB_t MCB
DSP-Subsystem (DSS) Master control block (MCB) The structure is used to hold handling information,...
MCB_t::isMMWaveOpen
bool isMMWaveOpen
! flag which indicates if the radar is transmitting or not
Definition: mmWave_XSS.h:243
MCB_t::commandUartHandle
UART_Handle commandUartHandle
! UART Logging Handle
Definition: mmWave_XSS.h:239
Cfg_ProfileCfgInitParams
void Cfg_ProfileCfgInitParams(uint8_t profileNum, rlProfileCfg_t *ptrProfileCfg)
The function initializes the profile configuration with the default parameters.
Definition: frame_cfg.c:168
MCB_t::numChirpsPerSubframe
int32_t numChirpsPerSubframe[NUM_SUBFRAMES]
! A counter for chirp interrupts. It is reset every subframe.
Definition: mmWave_XSS.h:249
mmW_MSS_STATS_t::datapathConfigEvt
uint8_t datapathConfigEvt
Definition: mmWave_XSS.h:193
MCB_t::chirpIntcumSum
int32_t chirpIntcumSum
! The number of subframes transmitted derived from the frame start interrupts.
Definition: mmWave_XSS.h:247
Cfg_ChirpCfgInitParams
void Cfg_ChirpCfgInitParams(uint8_t chirpNum, rlChirpCfg_t *ptrChirpCfg)
The function initializes the chirp configuration with the default parameters.
Definition: frame_cfg.c:205
MCB_t::mboxHandle
Mbox_Handle mboxHandle
! Handle to the SOC Module
Definition: mmWave_XSS.h:214
mmW_MSS_STATS_t::datapathStopEvt
uint8_t datapathStopEvt
! Counter which tracks the number of datapath start event detected
Definition: mmWave_XSS.h:195
mmW_MSS_STATS_t::cliFrameStartEvt
uint8_t cliFrameStartEvt
! CLI event for sensorStop
Definition: mmWave_XSS.h:191
MCB_t::subframeId
int32_t subframeId
! The number of chirps per subframe.
Definition: mmWave_XSS.h:250
Cfg_ChannelCfgInitParams
void Cfg_ChannelCfgInitParams(rlChanCfg_t *ptrChannelCfg)
The function initializes the channel configuration with the default parameters.
Definition: frame_cfg.c:286
MCB_t::frameStartIntHandle
SOC_SysIntListenerHandle frameStartIntHandle
! Handle to the SOC chirp interrupt listener Handle
Definition: mmWave_XSS.h:217
MCB_t::ctrlHandle
MMWave_Handle ctrlHandle
! Handle to the SOC frame interrupt listener Handle
Definition: mmWave_XSS.h:218
MCB_t::runningStatus
bool runningStatus
! flag which indicates if the mmWave link has been configured
Definition: mmWave_XSS.h:242
mmW_MSS_STATS_t::cliSensorStopEvt
uint8_t cliSensorStopEvt
! CLI event for sensorStar
Definition: mmWave_XSS.h:190
MCB_t::subframeCntFromChirpInt
int32_t subframeCntFromChirpInt
! token for frame start events.
Definition: mmWave_XSS.h:245
MCB_t::stats
mmW_MSS_STATS stats
! UART Command Handle used to interface with the CLI
Definition: mmWave_XSS.h:240
MCB_t::loggingUartHandle
UART_Handle loggingUartHandle
! MSS system event handle
Definition: mmWave_XSS.h:238
app_cfg.h
Cfg_ADCOutCfgInitParams
void Cfg_ADCOutCfgInitParams(rlAdcOutCfg_t *ptrADCOutCfg)
The function initializes the ADCOut configuration with the default parameters.
Definition: frame_cfg.c:309
MCB_t::chirpIntHandle
SOC_SysIntListenerHandle chirpIntHandle
! Semaphore handle for the mailbox communication
Definition: mmWave_XSS.h:216
MCB_t::subframeCntFromFrameStart
int32_t subframeCntFromFrameStart
! The number of sub-frames transmitted derived from chirp available interrupts.
Definition: mmWave_XSS.h:246
MCB_t::socHandle
SOC_Handle socHandle
Definition: mmWave_XSS.h:213
mmW_MSS_STATS_t::datapathStartEvt
uint8_t datapathStartEvt
! Counter which tracks the number of datapath config
Definition: mmWave_XSS.h:194
MCB_t::cfgStatus
bool cfgStatus
!mmWave stats
Definition: mmWave_XSS.h:241
gMCB
MCB gMCB
gMCB structure contains the tracking information required by the design is aligned using DATA_ALIGN p...
Definition: mss_main.c:163
mmW_MSS_STATS_t::numFailedTimingReports
uint32_t numFailedTimingReports
Definition: mmWave_XSS.h:197
mmW_MSS_STATS_t::numCalibrationReports
uint32_t numCalibrationReports
! Counter which tracks the number of failed calibration reports
Definition: mmWave_XSS.h:198
Cfg_LowPowerModeInitParams
void Cfg_LowPowerModeInitParams(rlLowPowerModeCfg_t *ptrLowPowerMode)
The function initializes the low power configuration with the default parameters.
Definition: frame_cfg.c:265
MCB_t
DSP-Subsystem (DSS) Master control block (MCB) The structure is used to hold handling information,...
Definition: mmWave_XSS.h:210
MCB_t::eventHandle
Event_Handle eventHandle
mmWave control handle use to initialize the link infrastructure, which allows communication between t...
Definition: mmWave_XSS.h:237
mmW_MSS_STATS_t::cliSensorStartEvt
uint8_t cliSensorStartEvt
Definition: mmWave_XSS.h:189
MCB_t::frameStartToken
int32_t frameStartToken
! flag which indicates if the basic radar configuration is completed.
Definition: mmWave_XSS.h:244
MCB_t::mboxSemHandle
Semaphore_Handle mboxSemHandle
! Handle to the peer Mailbox used to exchange messages between the MSS and DSS
Definition: mmWave_XSS.h:215
NUM_SUBFRAMES
#define NUM_SUBFRAMES
Definition: app_cfg.h:80
mmW_MSS_STATS
struct mmW_MSS_STATS_t mmW_MSS_STATS
The structure is used to hold the statistics information for the Millimeter Wave Application.
Cfg_AdvFrameCfgInitParams
void Cfg_AdvFrameCfgInitParams(rlAdvFrameCfg_t *ptrAdvFrameCfg)
The function initializes the frame configuration with the default parameters.
Definition: frame_cfg.c:43
mmW_MSS_STATS_t
The structure is used to hold the statistics information for the Millimeter Wave Application.
Definition: mmWave_XSS.h:186
Cfg_FrameCfgInitParams
void Cfg_FrameCfgInitParams(rlFrameCfg_t *ptrFrameCfg)
The function initializes the frame configuration with the default parameters.
Definition: frame_cfg.c:139