rl_device.c
1 /****************************************************************************************
2  * FileName : rl_device.c
3  *
4  * Description : This file defines the functions required to Control mmwave radar Device.
5  *
6  ****************************************************************************************
7  * (C) Copyright 2014, Texas Instruments Incorporated. - TI web address www.ti.com
8  *---------------------------------------------------------------------------------------
9  *
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  *
13  * Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * Neither the name of Texas Instruments Incorporated nor the names of its
21  * contributors may be used to endorse or promote products derived from this
22  * software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
28  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37  /*
38  ****************************************************************************************
39  * Revision History :
40  *---------------------------------------------------------------------------------------
41  * Version Date Author Defect No Description
42  *---------------------------------------------------------------------------------------
43  * 0.1.0 12May2015 Kaushal Kukkar - Initial Version
44  *
45  * 0.5.2 23Sep2016 Kaushal Kukkar AUTORADAR-541 xWR1642 Support
46  *
47  * 0.6.0 15Nov2016 Kaushal Kukkar AUTORADAR-666 Logging Feature
48  * Kaushal Kukkar AUTORADAR-716 Cascade API change
49  *
50  * 0.7.0 11May2017 Kaushal Kukkar MMWSDK-362 LDRA static analysis Issue Fix
51  *
52  * 0.8.6 24Jul2017 Jitendra Gupta MMWL-19 MSS Test pattern, Monitoring APIs
53  * Kaushal Kukkar MMWL-23 Big Endian Support
54  * Jitendra Gupta MMWL-26 MSS Data path Get APIs
55  *
56  * 0.9.1 - Jitendra Gupta MMWL-5 Code size optimization
57  *
58  * 1.2.3.9 21Mar2019 Pavan Penikalapti MMWL-179 Added design & requirement ID for
59  * rlDeviceSetRetryCount
60  ****************************************************************************************
61  */
62 
63 /******************************************************************************
64  * INCLUDE FILES
65  ******************************************************************************
66  */
67 #include <stdlib.h>
68 #include <string.h>
69 #include <ti/control/mmwavelink/mmwavelink.h>
70 #include <ti/control/mmwavelink/include/rl_device.h>
71 #include <ti/control/mmwavelink/include/rl_driver.h>
72 #include <ti/control/mmwavelink/include/rl_messages.h>
73 #include <ti/control/mmwavelink/include/rl_controller.h>
74 #include <ti/control/mmwavelink/include/rl_trace.h>
75 
76 /******************************************************************************
77  * GLOBAL VARIABLES/DATA-TYPES DEFINITIONS
78  ******************************************************************************
79  */
80 
81 /******************************************************************************
82  * FUNCTION DEFINITIONS
83  ******************************************************************************
84  */
85 
98 /* DesignId : MMWL_DesignId_004 */
99 /* Requirements : AUTORADAR_REQ-707 */
100 rlReturnVal_t rlDevicePowerOn(rlUInt8_t deviceMap, rlClientCbs_t clientCb)
101 {
102  rlReturnVal_t retVal;
103  rlUInt8_t index = 0U;
104  /* get rlDriver global structure pointer */
105  rlDriverData_t *rlDrvData = rlDriverGetHandle();
106 
107  /* if driver is already initialized */
108  if ((rlDrvData != NULL) && (rlDrvData->isDriverInitialized == 1U))
109  {
110  /* DeInitialize Device */
111  retVal = rlDevicePowerOff();
112  }
113  else
114  {
115  retVal = RL_RET_CODE_OK;
116  }
117 
118  /* if there is no error found from above conditioning then go ahead and poweron
119  mmwavelink & device */
120  if (retVal == RL_RET_CODE_OK)
121  {
122  /* Initialize Host Communication Protocol Driver */
123  if (rlDriverInit(deviceMap, clientCb) < 0)
124  {
125  /* if driver Init failed then set return error code */
126  retVal += RL_RET_CODE_RADAR_IF_ERROR;
127  }
128  else
129  {
130  /* Power up mmwave Device */
131  do
132  {
133  /* loop for all devices connected to device/Host */
134  if ((deviceMap & (1U << index)) != 0U)
135  {
136  /* Enable the 12xx device where it will power up the device and read
137  first Async Event */
138  if (clientCb.devCtrlCb.rlDeviceEnable(index) < 0)
139  {
140  /* set return error code */
141  retVal += RL_RET_CODE_RADAR_IF_ERROR;
142  RL_LOGE_ARG0("mmWaveLink: Enabling device failed \n");
143  /* if device enable is failed the de-init mmwavelink driver */
144  (void)rlDriverDeInit();
145  RL_LOGW_ARG0("mmWaveLink Driver DeInit done\n");
146  }
147  /* Reset device Index in DeviceMap for which device has been enabled */
148  deviceMap &= ~(1U << index);
149  }
150  /* increment device index */
151  index++;
152  }
153  while ((deviceMap != 0U) && (index < RL_DEVICE_CONNECTED_MAX));
154  }
155  }
156  RL_LOGV_ARG0("mmWaveLink Power Up completes\n");
157 
158  return retVal;
159 }
160 
173 /* DesignId : MMWL_DesignId_021 */
174 /* Requirements : AUTORADAR_REQ-757 */
175 rlReturnVal_t rlDeviceAddDevices(rlUInt8_t deviceMap)
176 {
177  rlReturnVal_t retVal;
178 
179  RL_LOGV_ARG0("rlDeviceAddDevices starts\n");
180 
181  /* add device for requested deviceMap */
182  retVal = rlDriverAddDevice(deviceMap);
183 
184  RL_LOGV_ARG0("rlDeviceAddDevices completes\n");
185 
186  return retVal;
187 }
188 
200 /* DesignId : MMWL_DesignId_034 */
201 /* Requirements : AUTORADAR_REQ-757 */
202 rlReturnVal_t rlDeviceRemoveDevices(rlUInt8_t deviceMap)
203 {
204  rlReturnVal_t retVal = RL_RET_CODE_OK;
205  rlUInt8_t index = 0U;
206  /* get rlDriver global structure pointer */
207  rlDriverData_t *rlDrvData = rlDriverGetHandle();
208 
209  /* if driver is already initialized and deviceDisable API is not NULL */
210  if ((rlDrvData != NULL) && (rlDrvData->isDriverInitialized == 1U) && \
211  (rlDrvData->clientCtx.devCtrlCb.rlDeviceDisable != RL_NULL_PTR))
212  {
213  rlUInt8_t lclDeviceMap = deviceMap;
214  do
215  {
216  /* loop for device index connected to device/Host */
217  if ((lclDeviceMap & (1U << index)) != 0U)
218  {
219  /* Enable the 12xx device where it will power up the
220  * device and read first Async Event
221  */
222  if (rlDrvData->clientCtx.devCtrlCb.rlDeviceDisable(index)
223  < 0)
224  {
225  /* Device Power Off Failed */
226  retVal += RL_RET_CODE_RADAR_IF_ERROR;
227  RL_LOGE_ARG0("mmWave device Power Off failed\n");
228  }
229  /* Reset device Index in DeviceMap for which device has been disabled */
230  lclDeviceMap &= ~(1U << index);
231  }
232  /* increment device index */
233  index++;
234  }
235  while ((lclDeviceMap != 0U) && (index < RL_DEVICE_CONNECTED_MAX));
236 
237  RL_LOGI_ARG0("mmwave device Power Off Successful\n");
238  /* Remove the devices from Driver */
239  retVal += rlDriverRemoveDevices(deviceMap);
240  }
241  else
242  {
243  /* set return error code */
244  retVal += RL_RET_CODE_SELF_ERROR;
245  RL_LOGD_ARG0("Either rlDrvData is NULL or not initialised\n");
246  }
247 
248  RL_LOGV_ARG0("rlDeviceRemoveDevices complete...\n");
249  return retVal;
250 }
251 
260 /* DesignId : MMWL_DesignId_005 */
261 /* Requirements : AUTORADAR_REQ-711 */
262 rlReturnVal_t rlDevicePowerOff(void)
263 {
264  rlReturnVal_t retVal = RL_RET_CODE_OK;
265  rlUInt8_t index = 0U;
266  /* get rlDriver global structure pointer */
267  rlDriverData_t *rlDrvData = rlDriverGetHandle();
268 
269  /* if driver is already initialized and deviceDisable API is not NULL */
270  if ((rlDrvData != NULL) && (rlDrvData->isDriverInitialized == 1U) && \
271  (rlDrvData->clientCtx.devCtrlCb.rlDeviceDisable != RL_NULL_PTR))
272  {
273  rlUInt8_t deviceMap = rlDrvData->deviceMap;
274  /* disable all connected devices */
275  do
276  {
277  /* if device Index is valid out of deviceMap */
278  if ((deviceMap & (1U << index)) != 0U)
279  {
280  /* Enable the 12xx device where it will power up the
281  * device and read first Async Event
282  */
283  if (rlDrvData->clientCtx.devCtrlCb.rlDeviceDisable(index)
284  < 0)
285  {
286  /* Device Power Off Failed */
287  retVal += RL_RET_CODE_RADAR_IF_ERROR;
288  RL_LOGE_ARG0("mmWave device Power Off failed\n");
289  }
290  /* Reset device Index in DeviceMap for which device has been disabled */
291  deviceMap &= ~(1U << index);
292  }
293  /* increment device index */
294  index++;
295  }
296  while ((deviceMap != 0U) || (index < RL_DEVICE_CONNECTED_MAX));
297 
298  RL_LOGI_ARG0("Power Off Successful\n");
299  /* DeInitialize Host Communication Protocol Driver */
300  retVal += rlDriverDeInit();
301  RL_LOGV_ARG0("Driver De-initialization complete\n");
302  }
303  else
304  {
305  /* set return error code */
306  retVal += RL_RET_CODE_SELF_ERROR;
307  RL_LOGD_ARG0("Either rlDrvData is NULL or not initialised\n");
308  }
309 
310  RL_LOGV_ARG0("Device power-off complete...\n");
311  return retVal;
312 }
313 
323 /* Sub block ID: 0x4000, ICD API: AWR_DEV_RFPOWERUP_SB */
324 /* DesignId : MMWL_DesignId_027 */
325 /* Requirements : AUTORADAR_REQ-761 */
326 rlReturnVal_t rlDeviceRfStart(rlUInt8_t deviceMap)
327 {
328  rlReturnVal_t retVal;
329 
330  RL_LOGV_ARG0("rlDeviceRfStart starts...\n");
331 
332  /* check if deviceIndex is out of defined value */
333  if (rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK)
334  {
335  /* set return error code */
336  retVal = RL_RET_CODE_INVALID_INPUT;
337  RL_LOGE_ARG0("Device map id is invalid\n");
338  }
339  else
340  {
341  /* Package the command with given data and send it to device */
342  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_POWERUP_MSG,
343  RL_SYS_RF_POWERUP_SB, NULL, 0U);
344  }
345 
346  RL_LOGV_ARG0("rlDeviceRfStart complete...\n");
347 
348  return retVal;
349 }
350 
364 /* Sub block ID: 0x4080, ICD API: AWR_DEV_FILE_DOWNLOAD_SB */
365 /* DesignId : MMWL_DesignId_006 */
366 /* Requirements : AUTORADAR_REQ-708 */
367 rlReturnVal_t rlDeviceFileDownload(rlUInt8_t deviceMap, rlFileData_t* data,
368  rlUInt16_t remChunks)
369 {
370  rlReturnVal_t retVal;
371 
372  /* check if deviceIndex is out of defined value */
373  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
374  (RL_NULL_PTR == data))
375  {
376  /* set error code if DeviceMAP is invalid or data pointer is null */
377  retVal = RL_RET_CODE_INVALID_INPUT;
378  RL_LOGE_ARG0("Invalid input");
379  }
380  /* This API is valid only when mmWaveLink instance is running on
381  External Host Processor */
382  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
383  {
384  /* set error code of Platform is not set to HOST */
385  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
386  }
387  else
388  {
389  /* LDRA waiver 8 D - DD data flow anomalies found- */
390  /* Initialize in-message structure to zero */
391  rlDriverMsg_t inMsg = {0};
392  /* Initialize out-message structure to zero */
393  rlDriverMsg_t outMsg = {0};
394  /* Initialize in-payload sub-block structure to zero */
395  rlPayloadSb_t inPayloadSb = {0};
396 
397  /* Construct command packet */
398  rlDriverConstructInMsg(RL_DEV_FILE_DOWNLOAD_MSG, &inMsg, &inPayloadSb);
399 
400  /* set the remaining chunk in command message */
401  inMsg.remChunks = remChunks;
402  /* Fill in-message Payload */
403  /* AR_CODE_REVIEW MR:R.11.1 <APPROVED> "conversion required." */
404  /*LDRA_INSPECTED 95 S */
405  rlDriverFillPayload(RL_DEV_FILE_DOWNLOAD_MSG, RL_SYS_FILE_DWLD_SB, &inPayloadSb,\
406  (rlUInt8_t*)&data->fData[0U], (rlUInt16_t)data->chunkLen);
407 
408  /* Send Command to mmWave Radar Device */
409  /* LDRA waiver 45 D - can't be NULL */
410  /* LDRA waiver 45 D - can't be NULL */
411  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
412  }
413  return retVal;
414 }
415 
427 /* Sub block ID: 0x40E0, ICD API: AWR_MSSVERSION_GET_SB */
428 rlReturnVal_t rlDeviceGetMssVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
429 {
430  rlReturnVal_t retVal;
431 
432  /* check for NULL pointer */
433  if (data == RL_NULL_PTR)
434  {
435  /* set error code if data pointer is passed NULL */
436  retVal = RL_RET_CODE_NULL_PTR;
437  }
438  /* This API is valid only when mmWaveLink instance is running on
439  External Host Processor */
440  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
441  {
442  /* set error code of Platform is not set to HOST */
443  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
444  }
445  else
446  {
447  /* Package the command with given data and send it to device */
448  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
449  RL_SYS_VERSION_SB, (rlUInt8_t*)data, 0U);
450  }
451 
452  return retVal;
453 }
454 
465 /* Sub block ID: 0x0220, ICD API: AWR_RF_VERSION_GET_SB */
466 rlReturnVal_t rlDeviceGetRfVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
467 {
468  rlReturnVal_t retVal;
469 
470  /* check for NULL pointer */
471  if (data == RL_NULL_PTR)
472  {
473  /* set error code if data pointer is passed NULL */
474  retVal = RL_RET_CODE_NULL_PTR;
475  }
476  else
477  {
478  /* Package the command with given data and send it to device */
479  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
480  RL_RF_RFVERSION_SB, (rlUInt8_t*)data, 0U);
481  }
482 
483  return retVal;
484 }
485 
496 /* DesignId : MMWL_DesignId_007 */
497 /* Requirements : AUTORADAR_REQ-709 */
498 rlReturnVal_t rlDeviceGetVersion(rlUInt8_t deviceMap, rlVersion_t* data)
499 {
500  rlReturnVal_t retVal;
501 
502  RL_LOGV_ARG0("rlDeviceGetVersion starts...\n");
503 
504  /* check if deviceIndex is out of defined value */
505  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
506  (RL_NULL_PTR == data))
507  {
508  /* set error code */
509  retVal = RL_RET_CODE_INVALID_INPUT;
510  RL_LOGE_ARG0("Invalid inputs");
511  }
512  else
513  {
514  /* If mmWaveLink is runing on ext host */
515  if (RL_PLATFORM_HOST == rlDriverGetPlatformId())
516  {
517  /* get mmwave MSS ROM or Application version */
518  retVal = rlDeviceGetMssVersion(deviceMap, &data->master);
519  }
520  else
521  {
522  /* if mmwavelink is not running on Host then no need to get MSS version */
523  retVal = RL_RET_CODE_OK;
524  RL_LOGD_ARG0(" rlPlatform is not host \n");
525  }
526 
527  if (retVal == RL_RET_CODE_OK)
528  {
529  /* get RF (RadarSS) version */
530  retVal += rlDeviceGetRfVersion(deviceMap, &data->rf);
531  }
532 
533  if (retVal == RL_RET_CODE_OK)
534  {
535  /* get mmwavelink library version */
536  retVal += rlDeviceGetMmWaveLinkVersion(&data->mmWaveLink);
537  }
538  }
539 
540  RL_LOGV_ARG0("rlDeviceGetVersion complete...\n");
541 
542  return retVal;
543 }
553 /* DesignId : MMWL_DesignId_008 */
554 /* Requirements : AUTORADAR_REQ-709 */
556 {
557  rlReturnVal_t retVal;
558 
559  RL_LOGV_ARG0("rlDeviceGetMmWaveLinkVersion starts...\n");
560 
561  if (RL_NULL_PTR != data)
562  {
563  /* mmWaveLink Version */
564  /* mmWaveLink SW Major verison */
565  data->major = RL_MMWAVELINK_VERSION_MAJOR;
566  /* mmWaveLink SW Minor verison */
567  data->minor = RL_MMWAVELINK_VERSION_MINOR;
568  /* mmWaveLink SW Build verison */
569  data->build = RL_MMWAVELINK_VERSION_BUILD;
570  /* mmWaveLink SW Debug verison */
571  data->debug = RL_MMWAVELINK_VERSION_DEBUG;
572  /* mmWaveLink SW Release Year */
573  data->year = RL_MMWAVELINK_VERSION_YEAR;
574  /* mmWaveLink SW Release Month */
575  data->month = RL_MMWAVELINK_VERSION_MONTH;
576  /* mmWaveLink SW Release date */
577  data->day = RL_MMWAVELINK_VERSION_DAY;
578  /* Set error code */
579  retVal = RL_RET_CODE_OK;
580  RL_LOGD_ARG0("Extracted MmWavelink version\n");
581  }
582  else
583  {
584  /* set error code */
585  retVal = RL_RET_CODE_INVALID_INPUT;
586  RL_LOGE_ARG0("rlDeviceGetMmWaveLinkVersion, Output param is NULL \n");
587  }
588 
589  RL_LOGV_ARG0("rlDeviceGetMmWaveLinkVersion complete...\n");
590 
591  return retVal;
592 }
593 
605 /* Sub block ID: 0x4041, ICD API: AWR_DEV_RX_DATA_FORMAT_CONF_SET_SB */
606 /* DesignId : MMWL_DesignId_104 */
607 /* Requirements : AUTORADAR_REQ-762 */
608 rlReturnVal_t rlDeviceSetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t* data)
609 {
610  rlReturnVal_t retVal;
611 
612  RL_LOGV_ARG0("rlDeviceSetDataFmtConfig starts...\n");
613 
614  /* check if deviceIndex is out of defined value */
615  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
616  (RL_NULL_PTR == data))
617  {
618  /* set error code if DeviceMAP is invalid or data pointer is null */
619  retVal = RL_RET_CODE_INVALID_INPUT;
620  RL_LOGE_ARG0("Invalid device mapping\n");
621  }
622  /* This API is valid only when mmWaveLink instance is running on
623  External Host Processor */
624  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
625  {
626  /* set error code of Platform is not set to HOST */
627  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
628  }
629  else
630  {
631  /* Package the command with given data and send it to device */
632  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
633  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB, (rlUInt8_t*)data,
634  (rlUInt16_t)sizeof(rlDevDataFmtCfg_t));
635  }
636 
637  RL_LOGV_ARG0("rlDeviceSetDataFmtConfig complete...\n");
638 
639  return retVal;
640 }
641 
654 /* Sub block ID: 0x4061, ICD API: AWR_DEV_RX_DATA_FORMAT_CONF_GET_SB */
655 /* DesignId : MMWL_DesignId_112 */
656 /* Requirements : AUTORADAR_REQ-762 */
657 rlReturnVal_t rlDeviceGetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t* data)
658 {
659  rlReturnVal_t retVal;
660 
661  RL_LOGV_ARG0("rlDeviceGetDataFmtConfig starts...\n");
662 
663  /* check if deviceIndex is out of defined value */
664  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
665  (RL_NULL_PTR == data))
666  {
667  /* set error code if DeviceMAP is invalid or data pointer is null */
668  retVal = RL_RET_CODE_INVALID_INPUT;
669  RL_LOGE_ARG0("rlDeviceGetDataFmtConfig, Invalid device map\n");
670  }
671  /* This API is valid only when mmWaveLink instance is running on
672  External Host Processor */
673  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
674  {
675  /* set error code of Platform is not set to HOST */
676  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
677  }
678  else
679  {
680  /* Package the command with given data and send it to device */
681  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
682  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB,
683  (rlUInt8_t*)data, 0U);
684  }
685 
686  RL_LOGV_ARG0("rlDeviceGetDataFmtConfig ends...\n");
687  return retVal;
688 }
689 
701 /* Sub block ID: 0x4042, ICD API: AWR_DEV_RX_DATA_PATH_CONF_SET_SB */
702 /* DesignId : MMWL_DesignId_105 */
703 /* Requirements : AUTORADAR_REQ-763, AUTORADAR_REQ-1071 */
704 rlReturnVal_t rlDeviceSetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t* data)
705 {
706  rlReturnVal_t retVal;
707 
708  RL_LOGV_ARG0("rlDeviceSetDataPathConfig starts...\n");
709 
710  /* check if deviceIndex is out of defined value */
711  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
712  (RL_NULL_PTR == data))
713  {
714  /* set error code if DeviceMAP is invalid or data pointer is null */
715  retVal = RL_RET_CODE_INVALID_INPUT;
716  RL_LOGE_ARG0("Invalid input");
717  }
718  /* This API is valid only when mmWaveLink instance is running on
719  External Host Processor */
720  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
721  {
722  /* set error code of Platform is not set to HOST */
723  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
724  }
725  else
726  {
727  /* Package the command with given data and send it to device */
728  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
729  RL_DEV_RX_DATA_PATH_CONF_SET_SB, (rlUInt8_t*)data,
730  (rlUInt16_t)sizeof(rlDevDataPathCfg_t));
731  }
732 
733  RL_LOGV_ARG0("rlDeviceSetDataPathConfig ends...\n");
734  return retVal;
735 }
736 
749 /* Sub block ID: 0x4062, ICD API: AWR_DEV_RX_DATA_PATH_CONF_GET_SB */
750 /* DesignId : MMWL_DesignId_113 */
751 /* Requirements : AUTORADAR_REQ-763, AUTORADAR_REQ-1071 */
752 rlReturnVal_t rlDeviceGetDataPathConfig(rlUInt8_t deviceMap,
753  rlDevDataPathCfg_t* data)
754 {
755  rlReturnVal_t retVal;
756 
757  RL_LOGV_ARG0("rlDeviceGetDataPathConfig starts...\n");
758 
759  /* check if deviceIndex is out of defined value */
760  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
761  (RL_NULL_PTR == data))
762  {
763  /* set error code if DeviceMAP is invalid or data pointer is null */
764  retVal = RL_RET_CODE_INVALID_INPUT;
765  RL_LOGE_ARG0("rlDeviceGetDataPathConfig, Invalid device map\n");
766  }
767  /* This API is valid only when mmWaveLink instance is running on
768  External Host Processor */
769  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
770  {
771  /* set error code of Platform is not set to HOST */
772  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
773  }
774  else
775  {
776  /* Package the command with given data and send it to device */
777  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
778  RL_DEV_RX_DATA_PATH_CONF_SET_SB,
779  (rlUInt8_t*)data, 0U);
780  }
781 
782  RL_LOGV_ARG0("rlDeviceGetDataPathConfig ends...\n");
783  return retVal;
784 }
785 
797 /* Sub block ID: 0x4043, ICD API: AWR_DEV_RX_DATA_PATH_LANEEN_SET_SB */
798 /* DesignId : MMWL_DesignId_033 */
799 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-764 */
800 rlReturnVal_t rlDeviceSetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t* data)
801 {
802  rlReturnVal_t retVal;
803 
804  RL_LOGV_ARG0("rlDeviceSetLaneConfig starts...\n");
805 
806  /* check if deviceIndex is out of defined value */
807  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
808  (RL_NULL_PTR == data))
809  {
810  /* set error code if DeviceMAP is invalid or data pointer is null */
811  retVal = RL_RET_CODE_INVALID_INPUT;
812  RL_LOGE_ARG0("Invalid input\n");
813  }
814  /* This API is valid only when mmWaveLink instance is running on
815  External Host Processor */
816  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
817  {
818  /* set error code of Platform is not set to HOST */
819  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
820  }
821  else
822  {
823  /* Package the command with given data and send it to device */
824  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
825  RL_DEV_DATA_PATH_LANEEN_SET_SB, (rlUInt8_t*)data,
826  (rlUInt16_t)sizeof(rlDevLaneEnable_t));
827  }
828  RL_LOGV_ARG0("rlDeviceSetLaneConfig ends...\n");
829 
830  return retVal;
831 }
832 
845 /* Sub block ID: 0x4063, ICD API: AWR_DEV_RX_DATA_PATH_LANEEN_GET_SB */
846 /* DesignId : MMWL_DesignId_115 */
847 /* Requirements : AUTORADAR_REQ-765, AUTORADAR_REQ-764 */
848 rlReturnVal_t rlDeviceGetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t* data)
849 {
850  rlReturnVal_t retVal;
851 
852  RL_LOGV_ARG0("rlDeviceGetLaneConfig starts...\n");
853 
854  /* check if deviceIndex is out of defined value */
855  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
856  (RL_NULL_PTR == data))
857  {
858  /* set error code if DeviceMAP is invalid or data pointer is null */
859  retVal = RL_RET_CODE_INVALID_INPUT;
860  RL_LOGE_ARG0("rlDeviceGetLaneConfig, Invalid device map\n");
861  }
862  /* This API is valid only when mmWaveLink instance is running on
863  External Host Processor */
864  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
865  {
866  /* set error code of Platform is not set to HOST */
867  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
868  }
869  else
870  {
871  /* Package the command with given data and send it to device */
872  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
873  RL_DEV_DATA_PATH_LANEEN_SET_SB,
874  (rlUInt8_t*)data, 0U);
875  }
876 
877  RL_LOGV_ARG0("rlDeviceGetLaneConfig ends...\n");
878  return retVal;
879 }
880 
893 /* Sub block ID: 0x4044, ICD API: AWR_DEV_RX_DATA_PATH_CLK_SET_SB */
894 /* DesignId : MMWL_DesignId_106 */
895 /* Requirements : AUTORADAR_REQ-764 */
896 rlReturnVal_t rlDeviceSetDataPathClkConfig(rlUInt8_t deviceMap,
897  rlDevDataPathClkCfg_t* data )
898 {
899  rlReturnVal_t retVal;
900 
901  RL_LOGV_ARG0("rlDeviceSetDataPathClkConfig starts...\n");
902 
903  /* check if deviceIndex is out of defined value */
904  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
905  {
906  /* set error code if DeviceMAP is invalid or data pointer is null */
907  retVal = RL_RET_CODE_INVALID_INPUT;
908  RL_LOGE_ARG0("Invalid input\n");
909  }
910  /* This API is valid only when mmWaveLink instance is running on
911  External Host Processor */
912  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
913  {
914  /* set error code of Platform is not set to HOST */
915  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
916  }
917  else
918  {
919  /* Package the command with given data and send it to device */
920  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
921  RL_DEV_DATA_PATH_CLOCK_SET_SB, (rlUInt8_t*)data,
922  (rlUInt16_t)sizeof(rlDevDataPathClkCfg_t));
923  }
924  RL_LOGV_ARG0("rlDeviceSetDataPathClkConfig ends...\n");
925 
926  return retVal;
927 }
928 
941 /* Sub block ID: 0x4064, ICD API: AWR_DEV_RX_DATA_PATH_CLK_GET_SB */
942 /* DesignId : MMWL_DesignId_114 */
943 /* Requirements : AUTORADAR_REQ-764 */
944 rlReturnVal_t rlDeviceGetDataPathClkConfig(rlUInt8_t deviceMap, rlDevDataPathClkCfg_t* data)
945 {
946  rlReturnVal_t retVal;
947 
948  RL_LOGV_ARG0("rlDeviceGetDataPathClkConfig starts...\n");
949 
950  /* check if deviceIndex is out of defined value */
951  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
952  (RL_NULL_PTR == data))
953  {
954  /* set error code if DeviceMAP is invalid or data pointer is null */
955  retVal = RL_RET_CODE_INVALID_INPUT;
956  RL_LOGE_ARG0("rlDeviceGetDataPathClkConfig, Invalid device map\n");
957  }
958  /* This API is valid only when mmWaveLink instance is running on
959  External Host Processor */
960  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
961  {
962  /* set error code of Platform is not set to HOST */
963  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
964  }
965  else
966  {
967  /* Package the command with given data and send it to device */
968  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
969  RL_DEV_DATA_PATH_CLOCK_SET_SB,
970  (rlUInt8_t*)data, 0U);
971  }
972 
973  RL_LOGV_ARG0("rlDeviceGetDataPathClkConfig ends...\n");
974  return retVal;
975 }
976 
988 /* Sub block ID: 0x4045, ICD API: AWR_DEV_LVDS_CFG_SET_SB */
989 /* DesignId : MMWL_DesignId_030 */
990 /* Requirements : AUTORADAR_REQ-767 */
991 rlReturnVal_t rlDeviceSetLvdsLaneConfig(rlUInt8_t deviceMap, rlDevLvdsLaneCfg_t* data)
992 {
993  rlReturnVal_t retVal;
994 
995  RL_LOGV_ARG0("rlDeviceSetLvdsLaneConfig starts...\n");
996 
997  /* check if deviceIndex is out of defined value */
998  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
999  (RL_NULL_PTR == data))
1000  {
1001  /* set error code if DeviceMAP is invalid or data pointer is null */
1002  retVal = RL_RET_CODE_INVALID_INPUT;
1003  RL_LOGE_ARG0("Invalid input\n");
1004  }
1005  /* This API is valid only when mmWaveLink instance is running on
1006  External Host Processor */
1007  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1008  {
1009  /* set error code of Platform is not set to HOST */
1010  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1011  }
1012  else
1013  {
1014  /* Package the command with given data and send it to device */
1015  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1016  RL_DEV_DATA_PATH_CFG_SET_SB, (rlUInt8_t*)data,
1017  (rlUInt16_t)sizeof(rlDevLvdsLaneCfg_t));
1018  }
1019 
1020  RL_LOGV_ARG0("rlDeviceSetLvdsLaneConfig ends...\n");
1021 
1022  return retVal;
1023 }
1024 
1037 /* Sub block ID: 0x4065, ICD API: AWR_DEV_LVDS_CFG_GET_SB */
1038 /* DesignId : MMWL_DesignId_116 */
1039 /* Requirements : AUTORADAR_REQ-767 */
1040 rlReturnVal_t rlDeviceGetLvdsLaneConfig(rlUInt8_t deviceMap, rlDevLvdsLaneCfg_t* data)
1041 {
1042  rlReturnVal_t retVal;
1043 
1044  RL_LOGV_ARG0("rlDeviceGetLvdsLaneConfig starts...\n");
1045 
1046  /* check if deviceIndex is out of defined value */
1047  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1048  (RL_NULL_PTR == data))
1049  {
1050  /* set error code if DeviceMAP is invalid or data pointer is null */
1051  retVal = RL_RET_CODE_INVALID_INPUT;
1052  RL_LOGE_ARG0("rlDeviceGetLvdsLaneConfig, Invalid device map\n");
1053  }
1054  /* This API is valid only when mmWaveLink instance is running on
1055  External Host Processor */
1056  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1057  {
1058  /* set error code of Platform is not set to HOST */
1059  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1060  }
1061  else
1062  {
1063  /* Package the command with given data and send it to device */
1064  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1065  RL_DEV_DATA_PATH_CFG_SET_SB,
1066  (rlUInt8_t*)data, 0U);
1067  }
1068 
1069  RL_LOGV_ARG0("rlDeviceGetLvdsLaneConfig ends...\n");
1070  return retVal;
1071 }
1072 
1089 /* Sub block ID: 0x4046, ICD API: AWR_DEV_RX_CONTSTREAMING_MODE_CONF_SET_SB */
1090 /* DesignId : MMWL_DesignId_040 */
1091 /* Requirements : AUTORADAR_REQ-829 */
1092 rlReturnVal_t rlDeviceSetContStreamingModeConfig(rlUInt8_t deviceMap,
1094 {
1095  rlReturnVal_t retVal;
1096 
1097  RL_LOGV_ARG0("rlDeviceSetContStreamingModeConfig ends...\n");
1098 
1099  /* check if deviceIndex is out of defined value */
1100  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1101  (RL_NULL_PTR == data))
1102  {
1103  /* set error code if DeviceMAP is invalid or data pointer is null */
1104  retVal = RL_RET_CODE_INVALID_INPUT;
1105  RL_LOGE_ARG0("Invalid input");
1106  }
1107  /* This API is valid only when mmWaveLink instance is running on
1108  External Host Processor */
1109  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1110  {
1111  /* set error code of Platform is not set to HOST */
1112  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1113  }
1114  else
1115  {
1116  /* Package the command with given data and send it to device */
1117  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1118  RL_DEV_RX_CONTSTREAMING_MODE_CONF_SET_SB,
1119  (rlUInt8_t*)data,
1120  (rlUInt16_t)sizeof(rlDevContStreamingModeCfg_t));
1121  }
1122 
1123  RL_LOGV_ARG0("rlDeviceSetContStreamingModeConfig ends...\n");
1124 
1125  return retVal;
1126 
1127 }
1128 
1142 /* Sub block ID: 0x4066, ICD API: AWR_DEV_RX_CONTSTREAMING_MODE_CONF_GET_SB */
1143 /* DesignId : MMWL_DesignId_121 */
1144 /* Requirements : AUTORADAR_REQ-829 */
1146  rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t* data)
1147 {
1148  rlReturnVal_t retVal;
1149 
1150  RL_LOGV_ARG0("rlDeviceGetContStreamingModeConfig starts...\n");
1151 
1152  /* check if deviceIndex is out of defined value */
1153  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1154  (RL_NULL_PTR == data))
1155  {
1156  /* set error code if DeviceMAP is invalid or data pointer is null */
1157  retVal = RL_RET_CODE_INVALID_INPUT;
1158  RL_LOGE_ARG0("rlDeviceGetContStreamingModeConfig, Invalid device map\n");
1159  }
1160  /* This API is valid only when mmWaveLink instance is running on
1161  External Host Processor */
1162  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1163  {
1164  /* set error code of Platform is not set to HOST */
1165  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1166  }
1167  else
1168  {
1169  /* Package the command with given data and send it to device */
1170  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1171  RL_DEV_RX_CONTSTREAMING_MODE_CONF_SET_SB,
1172  (rlUInt8_t*)data, 0U);
1173  }
1174 
1175  RL_LOGV_ARG0("rlDeviceGetContStreamingModeConfig ends...\n");
1176  return retVal;
1177 }
1178 
1190 /* Sub block ID: 0x4047, ICD API: AWR_DEV_CSI2_CFG_SET_SB */
1191 /* DesignId : MMWL_DesignId_048 */
1192 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-766 */
1193 rlReturnVal_t rlDeviceSetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t* data)
1194 {
1195  rlReturnVal_t retVal;
1196 
1197  RL_LOGV_ARG0("rlDeviceSetCsi2Config starts...\n");
1198 
1199  /* check if deviceIndex is out of defined value */
1200  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1201  (RL_NULL_PTR == data))
1202  {
1203  /* set error code if DeviceMAP is invalid or data pointer is null */
1204  retVal = RL_RET_CODE_INVALID_INPUT;
1205  RL_LOGE_ARG0("Invalid input");
1206  }
1207  /* This API is valid only when mmWaveLink instance is running on
1208  External Host Processor */
1209  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1210  {
1211  /* set error code of Platform is not set to HOST */
1212  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1213  }
1214  else
1215  {
1216  /* Package the command with given data and send it to device */
1217  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1218  RL_DEV_CSI2_CFG_SET_SB, (rlUInt8_t*)data,
1219  (rlUInt16_t)sizeof(rlDevCsi2Cfg_t));
1220  }
1221  RL_LOGV_ARG0("rlDeviceSetCsi2Config ends...\n");
1222 
1223  return retVal;
1224 }
1225 
1238 /* Sub block ID: 0x4067, ICD API: AWR_DEV_CSI2_CFG_GET_SB */
1239 /* DesignId : MMWL_DesignId_111 */
1240 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-766 */
1241 rlReturnVal_t rlDeviceGetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t* data)
1242 {
1243  rlReturnVal_t retVal;
1244 
1245  RL_LOGV_ARG0("rlDeviceGetCsi2Config starts...\n");
1246 
1247  /* check if deviceIndex is out of defined value */
1248  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1249  (RL_NULL_PTR == data))
1250  {
1251  /* set error code if DeviceMAP is invalid or data pointer is null */
1252  retVal = RL_RET_CODE_INVALID_INPUT;
1253  RL_LOGE_ARG0("rlDeviceGetCsi2Config, Invalid device map\n");
1254  }
1255  /* This API is valid only when mmWaveLink instance is running on
1256  External Host Processor */
1257  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1258  {
1259  /* set error code of Platform is not set to HOST */
1260  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1261  }
1262  else
1263  {
1264  /* Package the command with given data and send it to device */
1265  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1266  RL_DEV_CSI2_CFG_SET_SB,
1267  (rlUInt8_t*)data, 0U);
1268  }
1269 
1270  RL_LOGV_ARG0("rlDeviceGetCsi2Config ends...\n");
1271  return retVal;
1272 }
1273 
1288 /* Sub block ID: 0x4044, ICD API: AWR_DEV_RX_DATA_PATH_CLK_SET_SB */
1289 /* Sub block ID: 0x4042, ICD API: AWR_DEV_RX_DATA_PATH_CONF_SET_SB */
1290 /* Sub block ID: 0x4041, ICD API: AWR_DEV_RX_DATA_FORMAT_CONF_SET_SB */
1291 /* DesignId : MMWL_DesignId_020 */
1292 /* Requirements : AUTORADAR_REQ-756 */
1293 rlReturnVal_t rlDeviceSetHsiConfig(rlUInt8_t deviceMap,
1294  rlDevHsiCfg_t* data )
1295 {
1296  rlReturnVal_t retVal;
1297  /* Initialize Command and Response Sub Blocks */
1298  rlDriverMsg_t inMsg;
1299  rlDriverMsg_t outMsg = {0};
1300  rlUInt16_t sbcCnt = 0U;
1301 
1302  /* Initialize Command and Response Sub Blocks */
1303  rlPayloadSb_t inPayloadSb[3U] = {0};
1304 
1305  RL_LOGV_ARG0("rlDeviceSetHsiConfig starts...\n");
1306 
1307  /* check if deviceIndex is out of defined value */
1308  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1309  (RL_NULL_PTR == data) )
1310  {
1311  /* set error code if DeviceMAP is invalid or data pointer is null */
1312  retVal = RL_RET_CODE_INVALID_INPUT;
1313  RL_LOGE_ARG0("rlDeviceSetHsiConfig, Invalid input \n");
1314  }
1315  else
1316  {
1317  /* Data Format config SubBlock */
1318  if (RL_NULL_PTR != data->datafmt)
1319  {
1320  /* Fill in-message Payload */
1321  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1322  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB,
1323  &inPayloadSb[sbcCnt],
1324  (rlUInt8_t* )data->datafmt,
1325  (rlUInt16_t)sizeof(rlDevDataFmtCfg_t));
1326  /* increament Sub-block count */
1327  sbcCnt++;
1328  }
1329 
1330  /* Data Path Config SubBlock */
1331  if (RL_NULL_PTR != data->dataPath)
1332  {
1333  /* Fill in-message Payload */
1334  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1335  RL_DEV_RX_DATA_PATH_CONF_SET_SB,
1336  &inPayloadSb[sbcCnt],
1337  (rlUInt8_t* )data->dataPath,
1338  (rlUInt16_t)sizeof(rlDevDataPathCfg_t));
1339  /* increament Sub-block count */
1340  sbcCnt++;
1341  }
1342 
1343  /* Data Path clock Config SubBlock */
1344  if (RL_NULL_PTR != data->dataPathClk)
1345  {
1346  /* Fill in-message Payload */
1347  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1348  RL_DEV_DATA_PATH_CLOCK_SET_SB,
1349  &inPayloadSb[sbcCnt],
1350  (rlUInt8_t* )data->dataPathClk,
1351  (rlUInt16_t)sizeof(rlDevDataPathClkCfg_t));
1352  /* increament Sub-block count */
1353  sbcCnt++;
1354  }
1355 
1356  /* Construct command packet */
1357  rlDriverConstructInMsg(RL_DEV_CONFIG_SET_MSG, &inMsg, &inPayloadSb[0U]);
1358 
1359  if (sbcCnt > 0U)
1360  {
1361  /* setting num of sub-block to inMsg */
1362  inMsg.opcode.nsbc = sbcCnt;
1363 
1364  /* Send Command to mmWave Radar Device */
1365  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1366  }
1367  else
1368  {
1369  /* set error code if application doesn't pass any subBlock data */
1370  retVal = RL_RET_CODE_INVALID_INPUT;
1371  RL_LOGE_ARG0("sub block is NULL\n");
1372  }
1373  }
1374 
1375  RL_LOGV_ARG0("rlDeviceSetHsiConfig ends...\n");
1376 
1377  return retVal;
1378 }
1379 
1391 /* Sub block ID: 0x0085, ICD API: AWR_HIGHSPEEDINTFCLK_CONF_SET_SB */
1392 /* DesignId : MMWL_DesignId_101 */
1393 /* Requirements : AUTORADAR_REQ-765 */
1394 rlReturnVal_t rlDeviceSetHsiClk(rlUInt8_t deviceMap, rlDevHsiClk_t* data)
1395 {
1396  rlReturnVal_t retVal;
1397 
1398  RL_LOGV_ARG0("rlDeviceSetHsiClk starts...\n");
1399 
1400  /* check if deviceIndex is out of defined value */
1401  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1402  (RL_NULL_PTR == data))
1403  {
1404  /* set error code if DeviceMAP is invalid or data pointer is null */
1405  retVal = RL_RET_CODE_INVALID_INPUT;
1406  RL_LOGE_ARG0("Invalid input\n");
1407  }
1408  else
1409  {
1410  /* Package the command with given data and send it to device */
1411  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1412  RL_RF_HIGHSPEEDINTFCLK_CONF_SET_SB,
1413  (rlUInt8_t*)data,
1414  (rlUInt16_t)sizeof(rlDevHsiClk_t));
1415  }
1416  RL_LOGV_ARG0("rlDeviceSetHsiClk ends...\n");
1417 
1418  return retVal;
1419 }
1420 
1435 /* Sub block ID: 0x4040, ICD API: AWR_DEV_MCUCLOCK_CONF_SET_SB */
1436 /* DesignId : MMWL_DesignId_069 */
1437 /* Requirements : AUTORADAR_REQ-713 */
1438 rlReturnVal_t rlDeviceMcuClkConfig(rlUInt8_t deviceMap, rlMcuClkCfg_t * data)
1439 {
1440  rlReturnVal_t retVal;
1441 
1442  RL_LOGV_ARG0("rlDeviceMcuClkConfig starts...\n");
1443 
1444  /* check if deviceIndex is out of defined value */
1445  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1446  (RL_NULL_PTR == data))
1447  {
1448  /* set error code if DeviceMAP is invalid or data pointer is null */
1449  retVal = RL_RET_CODE_INVALID_INPUT;
1450  RL_LOGE_ARG0("Invalid input");
1451  }
1452  /* This API is valid only when mmWaveLink instance is running on
1453  External Host Processor */
1454  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1455  {
1456  /* set error code of Platform is not set to HOST */
1457  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1458  }
1459  else
1460  {
1461  /* Package the command with given data and send it to device */
1462  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1463  RL_DEV_MCUCLOCK_CONF_SET_SB, (rlUInt8_t*)data,
1464  (rlUInt16_t)sizeof(rlMcuClkCfg_t));
1465  }
1466  RL_LOGV_ARG0("rlDeviceMcuClkConfig ends...\n");
1467 
1468  return retVal;
1469 }
1470 
1484 /* Sub block ID: 0x4048, ICD API: AWR_DEV_PMICCLOCK_CONF_SET_SB */
1485 /* DesignId : MMWL_DesignId_070 */
1486 /* Requirements : AUTORADAR_REQ-907 */
1487 rlReturnVal_t rlDevicePmicClkConfig(rlUInt8_t deviceMap, rlPmicClkCfg_t * data)
1488 {
1489  rlReturnVal_t retVal;
1490 
1491  RL_LOGV_ARG0("rlDevicePmicClkConfig starts...\n");
1492 
1493  /* check if deviceIndex is out of defined value */
1494  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1495  (RL_NULL_PTR == data))
1496  {
1497  /* set error code if DeviceMAP is invalid or data pointer is null */
1498  retVal = RL_RET_CODE_INVALID_INPUT;
1499  RL_LOGE_ARG0("Invalid input");
1500  }
1501  /* This API is valid only when mmWaveLink instance is running on
1502  External Host Processor */
1503  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1504  {
1505  /* set error code of Platform is not set to HOST */
1506  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1507  }
1508  else
1509  {
1510  /* Package the command with given data and send it to device */
1511  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1512  RL_DEV_PMICCLOCK_CONF_SET_SB, (rlUInt8_t*)data,
1513  (rlUInt16_t)sizeof(rlPmicClkCfg_t));
1514  }
1515  RL_LOGV_ARG0("rlDevicePmicClkConfig ends...\n");
1516 
1517  return retVal;
1518 }
1519 
1541 /* Sub block ID: 0x404A, ICD API: AWR_MSS_LATENTFAULT_TEST_CONF_SB */
1542 /* DesignId : MMWL_DesignId_071 */
1543 /* Requirements : AUTORADAR_REQ-908 */
1544 rlReturnVal_t rlDeviceLatentFaultTests(rlUInt8_t deviceMap, rllatentFault_t * data)
1545 {
1546  rlReturnVal_t retVal;
1547 
1548  RL_LOGV_ARG0("rlDeviceLatentFaultTests starts...\n");
1549 
1550  /* check if deviceIndex is out of defined value */
1551  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1552  (RL_NULL_PTR == data))
1553  {
1554  /* set error code if DeviceMAP is invalid or data pointer is null */
1555  retVal = RL_RET_CODE_INVALID_INPUT;
1556  RL_LOGE_ARG0("Invalid input");
1557  }
1558  /* This API is valid only when mmWaveLink instance is running on
1559  External Host Processor */
1560  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1561  {
1562  /* set error code of Platform is not set to HOST */
1563  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1564  }
1565  else
1566  {
1567  /* Package the command with given data and send it to device */
1568  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1569  RL_DEV_LATENTFAULT_TEST_CONF_SB, (rlUInt8_t*)data,
1570  (rlUInt16_t)sizeof(rllatentFault_t));
1571  }
1572  RL_LOGV_ARG0("rlDeviceLatentFaultTests ends...\n");
1573 
1574  return retVal;
1575 }
1576 
1588 /* Sub block ID: 0x4049, ICD API: AWR_MSS_PERIODICTESTS_CONF_SB */
1589 /* DesignId : MMWL_DesignId_072 */
1590 /* Requirements : AUTORADAR_REQ-909 */
1591 rlReturnVal_t rlDeviceEnablePeriodicTests(rlUInt8_t deviceMap, rlperiodicTest_t * data)
1592 {
1593  rlReturnVal_t retVal;
1594 
1595  RL_LOGV_ARG0("rlDeviceEnablePeriodicTests starts...\n");
1596 
1597  /* check if deviceIndex is out of defined value */
1598  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1599  (RL_NULL_PTR == data))
1600  {
1601  /* set error code if DeviceMAP is invalid or data pointer is null */
1602  retVal = RL_RET_CODE_INVALID_INPUT;
1603  RL_LOGE_ARG0("Invalid input");
1604  }
1605  /* This API is valid only when mmWaveLink instance is running on
1606  External Host Processor */
1607  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1608  {
1609  /* set error code of Platform is not set to HOST */
1610  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1611  }
1612  else
1613  {
1614  /* Package the command with given data and send it to device */
1615  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1616  RL_DEV_PERIODICTESTS_CONF_SB, (rlUInt8_t*)data,
1617  (rlUInt16_t)sizeof(rlperiodicTest_t));
1618  }
1619  RL_LOGV_ARG0("rlDeviceEnablePeriodicTests ends...\n");
1620 
1621  return retVal;
1622 }
1623 
1636 /* Sub block ID: 0x404B, ICD API: AWR_DEV_TESTPATTERN_GEN_SET_SB */
1637 /* DesignId : MMWL_DesignId_103 */
1638 /* Requirements : AUTORADAR_REQ-910 */
1639 rlReturnVal_t rlDeviceSetTestPatternConfig(rlUInt8_t deviceMap, rltestPattern_t * data)
1640 {
1641  rlReturnVal_t retVal;
1642 
1643  RL_LOGV_ARG0("rlDeviceSetTestPatternConfig starts...\n");
1644 
1645  /* check if deviceIndex is out of defined value */
1646  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1647  (RL_NULL_PTR == data))
1648  {
1649  /* set error code if DeviceMAP is invalid or data pointer is null */
1650  retVal = RL_RET_CODE_INVALID_INPUT;
1651  RL_LOGE_ARG0("Invalid input");
1652  }
1653  /* This API is valid only when mmWaveLink instance is running on
1654  External Host Processor */
1655  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1656  {
1657  /* set error code of Platform is not set to HOST */
1658  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1659  }
1660  else
1661  {
1662  /* Package the command with given data and send it to device */
1663  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1664  RL_DEV_TESTPATTERN_GEN_SET_SB, (rlUInt8_t*)data,
1665  (rlUInt16_t)sizeof(rltestPattern_t));
1666  }
1667  RL_LOGV_ARG0("rlDeviceSetTestPatternConfig ends...\n");
1668 
1669  return retVal;
1670 }
1671 
1684 /* Sub block ID: 0x404C, ICD API: AWR_DEV_CONFIGURATION_SET_SB */
1685 /* DesignId : MMWL_DesignId_117 */
1686 /* Requirements : AUTORADAR_REQ-886, AUTORADAR_REQ-1037 */
1687 rlReturnVal_t rlDeviceSetMiscConfig(rlUInt8_t deviceMap, rlDevMiscCfg_t *data)
1688 {
1689  rlReturnVal_t retVal;
1690 
1691  RL_LOGV_ARG0("rlDeviceSetMiscConfig starts...\n");
1692 
1693  /* check if deviceIndex is out of defined value */
1694  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1695  (RL_NULL_PTR == data))
1696  {
1697  /* set error code if DeviceMAP is invalid or data pointer is null */
1698  retVal = RL_RET_CODE_INVALID_INPUT;
1699  RL_LOGE_ARG0("Invalid input");
1700  }
1701  /* This API is valid only when mmWaveLink instance is running on
1702  External Host Processor */
1703  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1704  {
1705  /* set error code of Platform is not set to HOST */
1706  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1707  }
1708  else
1709  {
1710  /* Package the command with given data and send it to device */
1711  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1712  RL_DEV_MISC_CFG_SET_SB, (rlUInt8_t*)data,
1713  (rlUInt16_t)sizeof(rlDevMiscCfg_t));
1714  }
1715  RL_LOGV_ARG0("rlDeviceSetMiscConfig ends...\n");
1716 
1717  return retVal;
1718 }
1719 
1733 /* Sub block ID: 0x404D, ICD API: AWR_DEV_RF_DEBUG_SIG_SET_SB */
1734 /* DesignId : MMWL_DesignId_127 */
1735 /* Requirements : AUTORADAR_REQ-949 */
1736 rlReturnVal_t rlDeviceSetDebugSigEnableConfig(rlUInt8_t deviceMap, rlDebugSigEnCfg_t *data)
1737 {
1738  rlReturnVal_t retVal;
1739 
1740  RL_LOGV_ARG0("rlDeviceSetDebugSigEnableConfig starts...\n");
1741 
1742  /* check if deviceIndex is out of defined value */
1743  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1744  (RL_NULL_PTR == data))
1745  {
1746  /* set error code if DeviceMAP is invalid or data pointer is null */
1747  retVal = RL_RET_CODE_INVALID_INPUT;
1748  RL_LOGE_ARG0("Invalid input");
1749  }
1750  /* This API is valid only when mmWaveLink instance is running on
1751  External Host Processor */
1752  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1753  {
1754  /* set error code of Platform is not set to HOST */
1755  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1756  }
1757  else
1758  {
1759  /* Package the command with given data and send it to device */
1760  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1761  RL_DEV_DEBUGSIG_EN_SET_SB, (rlUInt8_t*)data,
1762  (rlUInt16_t)sizeof(rlDebugSigEnCfg_t));
1763  }
1764  RL_LOGV_ARG0("rlDeviceSetDebugSigEnableConfig ends...\n");
1765 
1766  return retVal;
1767 }
1768 
1792 /* Sub block ID: 0x404E, ICD API: AWR_DEV_DEV_HSI_DELAY_DUMMY_CFG_SET_SB */
1793 /* DesignId : MMWL_DesignId_128 */
1794 /* Requirements : AUTORADAR_REQ-1049 */
1795 rlReturnVal_t rlDeviceSetHsiDelayDummyConfig(rlUInt8_t deviceMap, rlHsiDelayDummyCfg_t *data)
1796 {
1797  rlReturnVal_t retVal;
1798 
1799  RL_LOGV_ARG0("rlDeviceSetHsiDelayDummyConfig starts...\n");
1800 
1801  /* check if deviceIndex is out of defined value */
1802  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1803  (RL_NULL_PTR == data))
1804  {
1805  /* set error code if DeviceMAP is invalid or data pointer is null */
1806  retVal = RL_RET_CODE_INVALID_INPUT;
1807  RL_LOGE_ARG0("Invalid input");
1808  }
1809  /* This API is valid only when mmWaveLink instance is running on
1810  External Host Processor */
1811  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1812  {
1813  /* set error code of Platform is not set to HOST */
1814  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1815  }
1816  else
1817  {
1818  /* Package the command with given data and send it to device */
1819  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1820  RL_DEV_HSI_DELAY_DUMMY_CFG_SET_SB, (rlUInt8_t*)data,
1821  (rlUInt16_t)sizeof(rlHsiDelayDummyCfg_t));
1822  }
1823  RL_LOGV_ARG0("rlDeviceSetHsiDelayDummyConfig ends...\n");
1824 
1825  return retVal;
1826 }
1827 
1839 /* Sub block ID: 0x40E1, ICD API: AWR_MSSCPUFAULT_STATUS_GET_SB */
1840 /* DesignId : MMWL_DesignId_124 */
1841 /* Requirements : AUTORADAR_REQ-1040, AUTORADAR_REQ-1060 */
1842 rlReturnVal_t rlDeviceGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
1843 {
1844  rlReturnVal_t retVal;
1845 
1846  RL_LOGV_ARG0("rlDeviceGetCpuFault starts...\n");
1847 
1848  /* check if deviceIndex is out of defined value */
1849  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1850  (RL_NULL_PTR == data))
1851  {
1852  /* set error code if DeviceMAP is invalid or data pointer is null */
1853  retVal = RL_RET_CODE_INVALID_INPUT;
1854  RL_LOGE_ARG0("Invalid input");
1855  }
1856  /* This API is valid only when mmWaveLink instance is running on
1857  External Host Processor */
1858  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1859  {
1860  /* set error code of Platform is not set to HOST */
1861  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1862  }
1863  else
1864  {
1865  /* Package the command with given data and send it to device */
1866  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
1867  RL_SYS_CPUFAULT_STATUS_SB, (rlUInt8_t*)data,
1868  (rlUInt16_t)sizeof(rlCpuFault_t));
1869  }
1870  RL_LOGV_ARG0("rlDeviceGetCpuFault ends...\n");
1871 
1872  return retVal;
1873 }
1874 
1887 /* Sub block ID: 0x40E2, ICD API: AWR_MSSESMFAULT_STATUS_GET_SB */
1888 /* DesignId : MMWL_DesignId_124 */
1889 /* Requirements : AUTORADAR_REQ-1040 */
1890 rlReturnVal_t rlDeviceGetEsmFault(rlUInt8_t deviceMap, rlMssEsmFault_t *data)
1891 {
1892  rlReturnVal_t retVal;
1893 
1894  RL_LOGV_ARG0("rlDeviceGetEsmFault starts...\n");
1895 
1896  /* check if deviceIndex is out of defined value */
1897  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1898  (RL_NULL_PTR == data))
1899  {
1900  /* set error code if DeviceMAP is invalid or data pointer is null */
1901  retVal = RL_RET_CODE_INVALID_INPUT;
1902  RL_LOGE_ARG0("Invalid input");
1903  }
1904  /* This API is valid only when mmWaveLink instance is running on
1905  External Host Processor */
1906  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1907  {
1908  /* set error code of Platform is not set to HOST */
1909  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1910  }
1911  else
1912  {
1913  /* Package the command with given data and send it to device */
1914  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
1915  RL_SYS_ESMFAULT_STATUS_SB, (rlUInt8_t*)data,
1916  (rlUInt16_t)sizeof(rlMssEsmFault_t));
1917  }
1918  RL_LOGV_ARG0("rlDeviceGetEsmFault ends...\n");
1919 
1920  return retVal;
1921 }
1922 
1932 /* DesignId : MMWL_DesignId_028 */
1933 /* Requirements : AUTORADAR_REQ-710 */
1934 rlReturnVal_t rlDeviceConfigureCrc(rlCrcType_t crcType)
1935 {
1936  /* set CRC Type passed by application to rlDriver */
1937  return rlDriverConfigureCrc(crcType);
1938 }
1939 
1949 /* DesignId : MMWL_DesignId_028 */
1950 /* Requirements : AUTORADAR_REQ_710 */
1951 rlReturnVal_t rlDeviceConfigureAckTimeout(rlUInt32_t ackTimeout)
1952 {
1953  /* Set Ack Timeout value passed by applicatio to rlDriver */
1954  return rlDriverConfigureAckTimeout(ackTimeout);
1955 }
1956 
1967 /* DesignId : MMWL_DesignId_028 */
1968 /* Requirements : AUTORADAR_REQ_781 */
1969 rlReturnVal_t rlDeviceSetRetryCount(rlUInt8_t retryCnt)
1970 {
1971  /* Set command retry count to rlDriver */
1972  return rlDriverSetRetryCount(retryCnt);
1973 }
1974 
1989 /* SourceId : */
1990 /* DesignId : */
1991 /* Requirements : */
1992 rlReturnVal_t rlDeviceSetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t value)
1993 {
1994  rlReturnVal_t retVal;
1995  rlDevInternalCfg_t intCfg;
1996 
1997  RL_LOGV_ARG0("rlDeviceSetInternalConf starts...\n");
1998 
1999  /* check if deviceIndex is out of defined value */
2000  if (rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK)
2001  {
2002  /* set error code if DeviceMAP is invalid or data pointer is null */
2003  retVal = RL_RET_CODE_INVALID_INPUT;
2004  RL_LOGE_ARG0("Invalid device mapping\n");
2005  }
2006  /* This API is valid only when mmWaveLink instance is running on
2007  External Host Processor */
2008  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
2009  {
2010  /* set error code of Platform is not set to HOST */
2011  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
2012  }
2013  else
2014  {
2015  /* Fill SubBlock Data */
2016  intCfg.memAddr = memAddr;
2017  intCfg.value = value;
2018  /* Package the command with given data and send it to device */
2019  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_INTERNAL_CONF_SET_MSG,
2020  RL_DEV_MEM_REGISTER_SB, (rlUInt8_t*)&intCfg,
2021  (rlUInt16_t)sizeof(rlDevInternalCfg_t));
2022  }
2023 
2024  RL_LOGV_ARG0("rlDeviceSetInternalConf complete...\n");
2025 
2026  return retVal;
2027 }
2028 
2043 /* SourceId : */
2044 /* DesignId : */
2045 /* Requirements : */
2046 rlReturnVal_t rlDeviceGetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t* value)
2047 {
2048  rlReturnVal_t retVal;
2049 
2050  RL_LOGV_ARG0("rlDeviceGetInternalConf starts...\n");
2051 
2052  /* check if deviceIndex is out of defined value */
2053  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2054  (RL_NULL_PTR == (rlUInt32_t*)value))
2055  {
2056  /* set error code if DeviceMAP is invalid or data pointer is null */
2057  retVal = RL_RET_CODE_INVALID_INPUT;
2058  RL_LOGE_ARG0("Invalid device map\n");
2059  }
2060  /* This API is valid only when mmWaveLink instance is running on
2061  External Host Processor */
2062  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
2063  {
2064  /* set error code of Platform is not set to HOST */
2065  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
2066  }
2067  else
2068  {
2069  /* AR_CODE_REVIEW MR:R.2.2 <INSPECTED> "intCfg.memAddr will be populated from
2070  the response obtained from the device." */
2071  /*LDRA_INSPECTED 105 D */
2072  rlDevInternalCfg_t intCfg = { 0 };
2073  rlPayloadSb_t inPayloadSb = { 0 };
2074  rlPayloadSb_t outPayloadSb;
2075  /* Initialize Command and Response Sub Blocks */
2076  rlDriverMsg_t inMsg = { 0 };
2077  rlDriverMsg_t outMsg = { 0 };
2078 
2079  /* Construct command packet */
2080  rlDriverConstructInMsg(RL_DEV_INTERNAL_CONF_GET_MSG, &inMsg, &inPayloadSb);
2081  /* Fill in-message Payload */
2082  rlDriverFillPayload(RL_DEV_INTERNAL_CONF_GET_MSG, RL_DEV_MEM_REGISTER_SB, &inPayloadSb,
2083  (rlUInt8_t*)&memAddr, (rlUInt16_t)sizeof(rlUInt32_t));
2084 
2085  /* Set Command Sub Block*/
2086  outPayloadSb.sbid = RL_GET_UNIQUE_SBID(RL_DEV_INTERNAL_CONF_GET_MSG,
2087  RL_DEV_MEM_REGISTER_SB);
2088  outPayloadSb.len = (rlUInt16_t)sizeof(rlDevInternalCfg_t);
2089  outPayloadSb.pSblkData = (rlUInt8_t*)(&intCfg);
2090 
2091  /* Construct response packet */
2092  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2093 
2094  /* Send Command to mmWave Radar Device */
2095  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2096  /* Setting the received memAddr value */
2097  *value = intCfg.value;
2098  }
2099 
2100  RL_LOGV_ARG0("rlDeviceGetInternalConf ends...\n");
2101  return retVal;
2102 }
2103 
2115 /* Sub block ID: 0x40C1, ICD API: AWR_DEV_ADV_FRAME_CONFIG_APPLY_SB */
2116 /* DesignId : MMWL_DesignId_046 */
2117 /* Requirements : AUTORADAR_REQ-795 */
2118 rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t* data)
2119 {
2120  rlReturnVal_t retVal;
2121 
2122  RL_LOGV_ARG0("rlDeviceAdvFrameConfigApply starts...\n");
2123 
2124  /* check if deviceIndex is out of defined value */
2125  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2126  {
2127  /* set return error code */
2128  retVal = RL_RET_CODE_INVALID_INPUT;
2129  RL_LOGE_ARG0("rlDeviceAdvFrameConfigApply, Invalid device map\n");
2130  }
2131  else
2132  {
2133  /* Initialize Command and Response Sub Blocks */
2134  rlDriverMsg_t inMsg = {0};
2135  rlDriverMsg_t outMsg = {0};
2136  rlPayloadSb_t inPayloadSb = {0};
2137  /* Construct command packet */
2138  rlDriverConstructInMsg(RL_DEV_CONFIG_APPLY_MSG, &inMsg, &inPayloadSb);
2139  /* Fill in-message Payload */
2140  rlDriverFillPayload(RL_DEV_CONFIG_APPLY_MSG, RL_ADV_FRAME_DATA_CONFIG_SB,
2141  &inPayloadSb, (rlUInt8_t*)data,
2142  (rlUInt16_t)sizeof(rlAdvFrameDataCfg_t));
2143 
2144  /* Send Command to mmWave Radar Device */
2145  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2146  }
2147 
2148  RL_LOGV_ARG0("rlDeviceAdvFrameConfigApply ends...\n");
2149 
2150  return retVal;
2151 }
2152 
2164 /* Sub block ID: 0x40C0, ICD API: AWR_DEV_FRAME_CONFIG_APPLY_SB */
2165 /* DesignId : MMWL_DesignId_015 */
2166 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
2167  AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
2168 rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t* data)
2169 {
2170  rlReturnVal_t retVal;
2171 
2172  RL_LOGV_ARG0("rlDeviceFrameConfigApply starts...\n");
2173 
2174  /* check if deviceIndex is out of defined value */
2175  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2176  {
2177  /* set return error code */
2178  retVal = RL_RET_CODE_INVALID_INPUT;
2179  RL_LOGE_ARG0("rlDeviceFrameConfigApply, Invalid device map\n");
2180  }
2181  else
2182  {
2183  /* Initialize Command and Response Sub Blocks */
2184  rlDriverMsg_t inMsg = {0};
2185  rlDriverMsg_t outMsg = {0};
2186  rlPayloadSb_t inPayloadSb = {0};
2187  /* Construct command packet */
2188  rlDriverConstructInMsg(RL_DEV_CONFIG_APPLY_MSG, &inMsg, &inPayloadSb);
2189  /* Fill in-message Payload */
2190  rlDriverFillPayload(RL_DEV_CONFIG_APPLY_MSG, RL_SYS_CONFIG_APPLY_SB,
2191  &inPayloadSb, (rlUInt8_t*)data,
2192  (rlUInt16_t)sizeof(rlFrameApplyCfg_t));
2193 
2194  /* Send Command to mmWave Radar Device */
2195  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2196  }
2197 
2198  RL_LOGV_ARG0("rlDeviceFrameConfigApply ends...\n");
2199 
2200  return retVal;
2201 }
2202 
2222 /* DesignId : MMWL_DesignId_132 */
2223 /* Requirements : AUTORADAR_REQ-1050 */
2224 /*AR_CODE_REVIEW MR:R.2.2 <INSPECTED> "addrOffset is assigned based on different conditions"*/
2225 /*LDRA_INSPECTED 8 D */
2226 rlReturnVal_t rlDevSetFillLUTBuff(rlFillLUTParams_t *fillLUTParams, rlInt8_t *inData,
2227  rlInt8_t *outData, rlUInt16_t *LUTAddrOffset)
2228 {
2229  rlReturnVal_t retVal = RL_RET_CODE_OK;
2230  rlUInt16_t addrOffset = 0U;
2231  rlUInt16_t idx, alignIdx;
2232 
2233  RL_LOGV_ARG0("rlDevSetFillLUTBuff starts...\n");
2234 
2235  /* check if input parameters are valid */
2236  if ((RL_NULL_PTR == fillLUTParams) || (RL_NULL_PTR == outData) || \
2237  (RL_NULL_PTR == inData) || (RL_NULL_PTR == LUTAddrOffset))
2238  {
2239  /* set return error code */
2240  retVal = RL_RET_CODE_INVALID_INPUT;
2241  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid input parameters\n");
2242  }
2243  else
2244  {
2245  /* Profile ID */
2246  if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_PROFILE_VAR)
2247  {
2248  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2249  {
2250  if ((idx % 2U) == 0U)
2251  {
2252  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2253  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2254  outData[idx/2] = (rlInt8_t)(((rlUInt8_t)inData[idx]) & 0xFU);
2255  }
2256  else
2257  {
2258  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2259  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2260  /*AR_CODE_REVIEW MR:R.10.1, 10.2 <INSPECTED> "outData cannot be -ve"*/
2261  /*LDRA_INSPECTED 329 S */
2262  outData[idx/2] |= (rlInt8_t)((((rlUInt8_t)inData[idx]) & 0xFU) << 4U);
2263  }
2264  }
2265  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2266  fillLUTParams->inputSize;
2267  alignIdx = fillLUTParams->inputSize;
2268  /* fill up the remaining bytes to make it 4 bytes aligned */
2269  for (idx = alignIdx; idx < addrOffset; idx++)
2270  {
2271  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2272  /*LDRA_INSPECTED 436 S */
2273  outData[idx] = 0;
2274  }
2275  }
2276  /* Start Frequency */
2277  else if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_FREQ_START_VAR)
2278  {
2279  /* 4 Bytes of size */
2280  if (fillLUTParams->chirpParamSize == 0U)
2281  {
2282  (void)memcpy(outData, inData, fillLUTParams->inputSize * 4U);
2283  addrOffset = fillLUTParams->inputSize * 4U;
2284  alignIdx = fillLUTParams->inputSize * 4U;
2285  }
2286  /* 2 Bytes of size */
2287  else if (fillLUTParams->chirpParamSize == 1U)
2288  {
2289  (void)memcpy(outData, inData, fillLUTParams->inputSize * 2U);
2290  addrOffset = ((rlUInt16_t)(abs((fillLUTParams->inputSize * 2U) - 4U)) % 4U) + \
2291  (fillLUTParams->inputSize * 2U);
2292  alignIdx = fillLUTParams->inputSize * 2U;
2293  }
2294  /* 1 Bytes of size */
2295  else if (fillLUTParams->chirpParamSize == 2U)
2296  {
2297 #ifndef MMWL_BIG_ENDIAN
2298  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2299 #else
2300  /* For the big-endian host, we need to swap each of the 2 bytes */
2301  for (idx = 0U; idx < fillLUTParams->inputSize; idx += 2U)
2302  {
2303  outData[idx + 1U] = inData[idx];
2304  outData[idx] = inData[idx + 1U];
2305  }
2306 #endif
2307  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2308  fillLUTParams->inputSize;
2309  alignIdx = fillLUTParams->inputSize;
2310  }
2311  /* Invalid chirp param size */
2312  else
2313  {
2314  /* set return error code */
2315  retVal = (rlReturnVal_t)RL_RET_CODE_LUT_CHIRP_PAR_SCALE_SIZE_INVALID;
2316  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter size\n");
2317  addrOffset = 0U;
2318  alignIdx = 0U;
2319  }
2320  /* fill up the remaining bytes to make 4 bytes aligned */
2321  for (idx = alignIdx; idx < addrOffset; idx++)
2322  {
2323  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2324  /*LDRA_INSPECTED 436 S */
2325  outData[idx] = 0;
2326  }
2327  }
2328  /* Frequency Slope */
2329  else if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_FREQ_SLOPE_VAR)
2330  {
2331  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2332  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2333  fillLUTParams->inputSize;
2334  alignIdx = fillLUTParams->inputSize;
2335  /* fill up the remaining bytes to make 4 bytes aligned */
2336  for (idx = alignIdx; idx < addrOffset; idx++)
2337  {
2338  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2339  /*LDRA_INSPECTED 436 S */
2340  outData[idx] = 0;
2341  }
2342  }
2343  /* Idle Time / ADC Start Time */
2344  else if ((fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_IDLE_TIME_VAR) || \
2345  (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_ADC_START_TIME_VAR))
2346  {
2347  /* 2 Bytes of size */
2348  if (fillLUTParams->chirpParamSize == 0U)
2349  {
2350  (void)memcpy(outData, inData, fillLUTParams->inputSize * 2U);
2351  addrOffset = ((rlUInt16_t)(abs((fillLUTParams->inputSize * 2U) - 4U)) % 4U) + \
2352  (fillLUTParams->inputSize * 2U);
2353  alignIdx = fillLUTParams->inputSize * 2U;
2354  }
2355  /* 1 Bytes of size */
2356  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2357  /*LDRA_INSPECTED 370 S */
2358  else if (fillLUTParams->chirpParamSize == 1U)
2359  {
2360 #ifndef MMWL_BIG_ENDIAN
2361  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2362 #else
2363  /* For the big-endian host, we need to swap each of the 2 bytes */
2364  for (idx = 0U; idx < fillLUTParams->inputSize; idx += 2U)
2365  {
2366  outData[idx + 1U] = inData[idx];
2367  outData[idx] = inData[idx + 1U];
2368  }
2369 #endif
2370  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2371  fillLUTParams->inputSize;
2372  alignIdx = fillLUTParams->inputSize;
2373  }
2374  /* Invalid chirp param size */
2375  else
2376  {
2377  /* set return error code */
2378  retVal = (rlReturnVal_t)RL_RET_CODE_LUT_CHIRP_PAR_SCALE_SIZE_INVALID;
2379  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter size\n");
2380  addrOffset = 0U;
2381  alignIdx = 0U;
2382  }
2383  /* fill up the remaining bytes to make 4 bytes aligned */
2384  for (idx = alignIdx; idx < addrOffset; idx++)
2385  {
2386  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2387  /*LDRA_INSPECTED 436 S */
2388  outData[idx] = 0;
2389  }
2390  }
2391  /* Tx Enable / BPM Enable */
2392  else if ((fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_TX_EN_VAR) || \
2393  (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_BPM_VAL_VAR))
2394  {
2395  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2396  {
2397  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2398  /*LDRA_INSPECTED 370 S */
2399  if ((idx % 2U) == 0U)
2400  {
2401  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2402  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2403  outData[idx/2] = (rlInt8_t)(((rlUInt8_t)inData[idx]) & 0x7U);
2404  }
2405  else
2406  {
2407  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2408  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2409  /*AR_CODE_REVIEW MR:R.10.1, 10.2 <INSPECTED> "outData cannot be -ve"*/
2410  /*LDRA_INSPECTED 329 S */
2411  outData[idx/2] |= (rlInt8_t)((((rlUInt8_t)inData[idx]) & 0x7U) << 4U);
2412  }
2413  }
2414  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2415  fillLUTParams->inputSize;
2416  alignIdx = fillLUTParams->inputSize;
2417  /* fill up the remaining bytes to make 4 bytes aligned */
2418  for (idx = alignIdx; idx < addrOffset; idx++)
2419  {
2420  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2421  /*LDRA_INSPECTED 436 S */
2422  outData[idx] = 0;
2423  }
2424  }
2425  /* TX0/TX1/TX2 Phase shifter */
2426  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2427  /*LDRA_INSPECTED 370 S */
2428  else if ((fillLUTParams->chirpParamIndex == RL_LUT_TX0_PHASE_SHIFT_VAR) || \
2429  (fillLUTParams->chirpParamIndex == RL_LUT_TX1_PHASE_SHIFT_VAR) || \
2430  (fillLUTParams->chirpParamIndex == RL_LUT_TX2_PHASE_SHIFT_VAR))
2431  {
2432  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2433  {
2434  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2435  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2436  outData[idx] = (rlInt8_t)(((rlUInt8_t)inData[idx]) << 2U);
2437  }
2438 
2439  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2440  fillLUTParams->inputSize;
2441  alignIdx = fillLUTParams->inputSize;
2442  /* fill up the remaining bytes to make 4 bytes aligned */
2443  for (idx = alignIdx; idx < addrOffset; idx++)
2444  {
2445  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2446  /*LDRA_INSPECTED 436 S */
2447  outData[idx] = 0;
2448  }
2449  }
2450  /* Invalid chirp parameter index */
2451  else
2452  {
2453  /* set return error code */
2454  retVal = (rlReturnVal_t)RL_RET_CODE_CHIRP_PARAM_IND_INVALID;
2455  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter index\n");
2456  }
2457  }
2458 
2459  if (retVal == RL_RET_CODE_OK)
2460  {
2461  /* Update the chirp LUT address offset */
2462  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "addrOffset is always greater than zero"*/
2463  /*LDRA_INSPECTED 124 D */
2464  *LUTAddrOffset = addrOffset + fillLUTParams->lutGlobalOffset;
2465  }
2466 
2467  RL_LOGV_ARG0("rlDevSetFillLUTBuff ends...\n");
2468 
2469  return retVal;
2470 }
2471 
2472 /*
2473  * END OF rl_device.c FILE
2474  */
rlReturnVal_t rlDevicePmicClkConfig(rlUInt8_t deviceMap, rlPmicClkCfg_t *data)
Sets the configurations for PMIC clock.
Definition: rl_device.c:1487
rlReturnVal_t rlDeviceSetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t *data)
Sets LVDS/CSI2 Data output format.
Definition: rl_device.c:608
rlUInt16_t lutGlobalOffset
LUT offset within the entire 12kB buffer .
Definition: rl_device.h:1258
rlReturnVal_t rlDeviceRfStart(rlUInt8_t deviceMap)
Enables mmwave RF/Analog Sub system.
Definition: rl_device.c:326
mmWaveLink client callback structure
Definition: mmwavelink.h:1523
rlReturnVal_t rlDeviceMcuClkConfig(rlUInt8_t deviceMap, rlMcuClkCfg_t *data)
Sets the configurations to setup the desired frequency of the MCU Clock.
Definition: rl_device.c:1438
rlReturnVal_t rlDeviceGetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t *data)
Gets Csi2 data format Configuration.
Definition: rl_device.c:1241
rlInt32_t(* rlDeviceEnable)(rlUInt8_t deviceIndex)
Bring mmWave radar device out of Reset.
Definition: mmwavelink.h:1398
rlReturnVal_t rlDeviceLatentFaultTests(rlUInt8_t deviceMap, rllatentFault_t *data)
Sets the configurations for latent fault test.
Definition: rl_device.c:1544
rlReturnVal_t rlDriverConfigureCrc(rlCrcType_t crcType)
Configures the CRC Type in mmwavelink Driver.
Definition: rl_driver.c:2867
mmWaveLink firmware version structure
Definition: mmwavelink.h:2528
rlReturnVal_t rlDeviceGetMmWaveLinkVersion(rlSwVersionParam_t *data)
Get mmWaveLink Version.
Definition: rl_device.c:555
void rlDriverConstructOutMsg(rlUInt16_t numSblk, rlDriverMsg_t *outMsg, rlPayloadSb_t *payloadPtr)
: Construct command packet based on given message-ID and payload
Definition: rl_driver.c:3068
rlReturnVal_t rlDeviceSetTestPatternConfig(rlUInt8_t deviceMap, rltestPattern_t *data)
Setup for test pattern to be generated.
Definition: rl_device.c:1639
rlReturnVal_t rlDeviceSetDataPathClkConfig(rlUInt8_t deviceMap, rlDevDataPathClkCfg_t *data)
Sets LVDS Clock Configuration.
Definition: rl_device.c:896
Structure used for filling chirp LUT parameter buffer for Advanced chirp configuration....
Definition: rl_device.h:1239
rlReturnVal_t rlDeviceSetContStreamingModeConfig(rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t *data)
Sets Continous Streaming Mode Configuration.
Definition: rl_device.c:1092
rlReturnVal_t rlDeviceRemoveDevices(rlUInt8_t deviceMap)
Removes connected mmwave devices.
Definition: rl_device.c:202
rlUInt8_t rlDriverGetPlatformId(void)
Returns RL Platform ID (i.e. where mmWaveLink is executing)
Definition: rl_driver.c:2357
rlDevDataPathCfg_t * dataPath
Data path config.
Definition: rl_device.h:1057
mmwave radar data path config.
Definition: rl_device.h:665
rlReturnVal_t rlDeviceSetHsiClk(rlUInt8_t deviceMap, rlDevHsiClk_t *data)
Sets High Speed Interface Clock.
Definition: rl_device.c:1394
Continous streaming mode configuration.
Definition: rl_device.h:935
rlReturnVal_t rlDeviceEnablePeriodicTests(rlUInt8_t deviceMap, rlperiodicTest_t *data)
Sets the configurations for periodic test.
Definition: rl_device.c:1591
rlFwVersionParam_t master
Master Sub System version.
Definition: mmwavelink.h:2749
mmwave radar high speed Data path configuraiton
Definition: rl_device.h:1048
DataPath clock configuration.
Definition: rl_device.h:845
mmwave radar high speed clock configuration
Definition: rl_device.h:1027
mmwave radar device latent fault test
Definition: rl_device.h:328
rlUInt8_t minor
SW version minor number.
Definition: mmwavelink.h:2680
void rlDriverConstructInMsg(rlUInt16_t msgId, rlDriverMsg_t *inMsg, rlPayloadSb_t *payloadPtr)
: Construct command packet (inMsg) based on given message-ID and payload
Definition: rl_driver.c:3033
mmwave radar device config
Definition: rl_device.h:1067
rlReturnVal_t rlDeviceGetRfVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
Get mmWave RF ROM and patch version.
Definition: rl_device.c:466
mmwave radar Driver Global Structure
Definition: rl_driver.h:241
LVDS Lane configuration.
Definition: rl_device.h:893
rlReturnVal_t rlDeviceGetMssVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
Get mmWave Master SS version.
Definition: rl_device.c:428
rlUInt8_t isDriverInitialized
Driver Status.
Definition: rl_driver.h:250
rlUInt16_t chirpParamIndex
Chirp Parameter Index Valid range: 0 to 9 .
Definition: rl_device.h:1245
rlUInt16_t nsbc
Number of Sub Blocks in Payload.
Definition: rl_driver.h:349
rlSwVersionParam_t mmWaveLink
mmWaveLink version
Definition: mmwavelink.h:2757
Frame config API parameters.
Definition: rl_sensor.h:1255
rlUInt8_t month
Software Release Month.
Definition: mmwavelink.h:2696
rlReturnVal_t rlDeviceFileDownload(rlUInt8_t deviceMap, rlFileData_t *data, rlUInt16_t remChunks)
Download mmwave Firmware/Patches over SPI.
Definition: rl_device.c:367
rlReturnVal_t rlDriverExecuteGetApi(rlUInt8_t deviceMap, rlUInt16_t msgId, rlUInt16_t sbcID, rlUInt8_t *msgData, rlUInt16_t inLen)
: Construct get message and invoke command.
Definition: rl_driver.c:3132
mmwave radar test pattern config
Definition: rl_device.h:464
rlReturnVal_t rlDriverSetRetryCount(rlUInt8_t retryCnt)
: Set the retry count for re-sending command
Definition: rl_driver.c:3230
rlReturnVal_t rlDeviceSetHsiDelayDummyConfig(rlUInt8_t deviceMap, rlHsiDelayDummyCfg_t *data)
This API can be used to increase the time between the availability of chirp data and the transfer of ...
Definition: rl_device.c:1795
rlReturnVal_t rlDeviceSetDebugSigEnableConfig(rlUInt8_t deviceMap, rlDebugSigEnCfg_t *data)
Information to enable the pin-mux to bring out debug signals for the chirp cycle.
Definition: rl_device.c:1736
CSI2 configuration.
Definition: rl_device.h:950
rlDevDataPathClkCfg_t * dataPathClk
Data path clock configuration.
Definition: rl_device.h:1061
rlReturnVal_t rlDriverDeInit(void)
De Initializes the mmwave radar Driver.
Definition: rl_driver.c:2274
rlDriverData_t * rlDriverGetHandle(void)
Returns mmwave radar Driver Global Structure.
Definition: rl_driver.c:2341
rlReturnVal_t rlDeviceConfigureAckTimeout(rlUInt32_t ackTimeout)
Configures the Acknowledgement timeout in mmWaveLink Driver.
Definition: rl_device.c:1951
rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t *data)
Sets Advance Frame data path Configuration.
Definition: rl_device.c:2118
rlUInt16_t inputSize
No of elements/data in the buffer .
Definition: rl_device.h:1254
mmwave radar data path lane enable
Definition: rl_device.h:817
Debug signals enable structure.
Definition: rl_device.h:1119
rlReturnVal_t rlDeviceSetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t *data)
Sets Lane enable Configuration.
Definition: rl_device.c:800
rlFwVersionParam_t rf
RF Sub System version.
Definition: mmwavelink.h:2753
rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t *data)
Sets Frame data path Configuration.
Definition: rl_device.c:2168
rlReturnVal_t rlDeviceGetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t *data)
Gets data path Configuration.
Definition: rl_device.c:752
rlReturnVal_t rlDeviceSetHsiConfig(rlUInt8_t deviceMap, rlDevHsiCfg_t *data)
: This function sets the High Speed Interface(LVDS/CSI2) clock, lane, data rate and data format
Definition: rl_device.c:1293
RHCP Payload Structure.
Definition: rl_driver.h:161
rlReturnVal_t rlDriverCmdInvoke(rlUInt8_t deviceMap, rlDriverMsg_t inMsg, rlDriverMsg_t *outMsg)
Invokes a command to mmwave radar Device. Implements mmwave radar Host Communication Protocol(RHCP)
Definition: rl_driver.c:2739
mmwave radar periodicity test config
Definition: rl_device.h:414
rlReturnVal_t rlDeviceSetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t *data)
Sets CSI2 data format Configuration.
Definition: rl_device.c:1193
rlUInt32_t chunkLen
File data length.
Definition: rl_device.h:90
mmwave radar data format config
Definition: rl_device.h:597
mmwave radar device MCU Clock output
Definition: rl_device.h:101
mmwave radar Driver Payload
Definition: rl_driver.h:355
HSI delay dummy structure.
Definition: rl_device.h:1155
mmwave radar device PMIC Clock output
Definition: rl_device.h:175
Structure to hold the MSS ESM Fault data structure for event RL_DEV_AE_MSS_ESMFAULT_SB.
Definition: mmwavelink.h:1767
rlReturnVal_t rlDeviceSetMiscConfig(rlUInt8_t deviceMap, rlDevMiscCfg_t *data)
Setup misc. device configurations.
Definition: rl_device.c:1687
void rlDriverFillPayload(rlUInt16_t msgId, rlUInt16_t sbcID, rlPayloadSb_t *payloadPtr, rlUInt8_t *data, rlUInt16_t inLen)
: Fill payload based on given message-ID, sub-block ID and data.
Definition: rl_driver.c:3099
rlReturnVal_t rlDevicePowerOn(rlUInt8_t deviceMap, rlClientCbs_t clientCb)
Bring mmwave Device Out of Reset.
Definition: rl_device.c:100
rlReturnVal_t rlDriverConfigureAckTimeout(rlUInt32_t ackTimeout)
Configures the Acknowledgement timeout in mmwavelink Driver.
Definition: rl_driver.c:2901
rlUInt8_t major
SW version major number.
Definition: mmwavelink.h:2676
rlReturnVal_t rlDeviceGetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t *value)
Reads Internal Configuration Memory.
Definition: rl_device.c:2046
rlUInt16_t chirpParamSize
Chirp Parameter Size Mainly applicable for Start Frequency, Idle Time and ADC Start Time .
Definition: rl_device.h:1250
mmwavelink software version structure
Definition: mmwavelink.h:2670
rlReturnVal_t rlDriverRemoveDevices(rlUInt8_t deviceMap)
Disconnects the mmwave radar devices.
Definition: rl_driver.c:2229
rlReturnVal_t rlDeviceGetEsmFault(rlUInt8_t deviceMap, rlMssEsmFault_t *data)
Get MasterSS ESM fault status.
Definition: rl_device.c:1890
rlReturnVal_t rlDevicePowerOff(void)
Shutdown mmwave Device.
Definition: rl_device.c:262
File Dowload data structure.
Definition: rl_device.h:85
Structure to hold the MSS/radarSS CPU Fault data strucutre for event RL_DEV_AE_MSS_CPUFAULT_SB and RL...
Definition: mmwavelink.h:2358
Radar Internal configuration.
Definition: rl_device.h:1229
rlInt32_t(* rlDeviceDisable)(rlUInt8_t deviceIndex)
Power off mmWave radar device.
Definition: mmwavelink.h:1412
rlUInt16_t fData[RL_CMD_PL_LEN_MAX/2U]
File data buffer.
Definition: rl_device.h:94
mmwavelink version structure
Definition: mmwavelink.h:2744
rlClientCbs_t clientCtx
Client context.
Definition: rl_driver.h:294
rlReturnVal_t rlDeviceSetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t *data)
Sets LVDS/CSI2 Path Configuration.
Definition: rl_device.c:704
rlReturnVal_t rlDeviceGetContStreamingModeConfig(rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t *data)
Gets continuous Streaming Mode Configuration.
Definition: rl_device.c:1145
rlDeviceCtrlCbs_t devCtrlCb
Device Control Callback.
Definition: mmwavelink.h:1540
rlUInt8_t debug
SW version debug number.
Definition: mmwavelink.h:2688
rlReturnVal_t rlDriverAddDevice(rlUInt8_t deviceMap)
Adds mmwave radar device.
Definition: rl_driver.c:2136
rlReturnVal_t rlDeviceGetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t *data)
Gets LVDS/CSI2 Data output format.
Definition: rl_device.c:657
Advance Frame data config API parameters. This structure is only applicable when mmWaveLink instance ...
Definition: rl_sensor.h:1343
rlReturnVal_t rlDeviceConfigureCrc(rlCrcType_t crcType)
Configures the CRC Type in mmWaveLink Driver.
Definition: rl_device.c:1934
rlUInt8_t deviceMap
Bitmap of devices connected radarSS/DSS Mailbox in case of 16xx autonomous.
Definition: rl_driver.h:254
rlReturnVal_t rlDeviceSetRetryCount(rlUInt8_t retryCnt)
: Set the command retry count
Definition: rl_device.c:1969
rlReturnVal_t rlDevSetFillLUTBuff(rlFillLUTParams_t *fillLUTParams, rlInt8_t *inData, rlInt8_t *outData, rlUInt16_t *LUTAddrOffset)
Filling chirp LUT parameter buffer for Advanced chirp configuration.
Definition: rl_device.c:2226
rlReturnVal_t rlDeviceAddDevices(rlUInt8_t deviceMap)
Bring mmwave Device Out of Reset.
Definition: rl_device.c:175
rlUInt8_t year
Software Release Year.
Definition: mmwavelink.h:2692
rlReturnVal_t rlDeviceGetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t *data)
Gets Lane enable Configuration.
Definition: rl_device.c:848
rlDevDataFmtCfg_t * datafmt
Data format config.
Definition: rl_device.h:1053
rlUInt8_t day
Software Release Day.
Definition: mmwavelink.h:2700
rlUInt8_t build
SW version buid number.
Definition: mmwavelink.h:2684
rlReturnVal_t rlDeviceSetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t value)
Writes Internal Configuration Memory.
Definition: rl_device.c:1992
rlReturnVal_t rlDeviceGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
Get MasterSS CPU fault status.
Definition: rl_device.c:1842
rlReturnVal_t rlDriverExecuteSetApi(rlUInt8_t deviceMap, rlUInt16_t msgId, rlUInt16_t sbcID, rlUInt8_t *msgData, rlUInt16_t inLen)
: Construct set message and invoke command.
Definition: rl_driver.c:3188
rlReturnVal_t rlDeviceGetVersion(rlUInt8_t deviceMap, rlVersion_t *data)
Get mmWave Hardware, Firmware/patch and mmWaveLink version.
Definition: rl_device.c:498
rlReturnVal_t rlDriverIsDeviceMapValid(rlUInt8_t deviceMap)
Checks if given deviecMap is valid wrt to global DeviceMap set to mmWaveLink.
Definition: rl_driver.c:2394

Copyright 2020, Texas Instruments Incorporated