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 /* DesignId : MMWL_DesignId_027 */
324 /* Requirements : AUTORADAR_REQ-761 */
325 rlReturnVal_t rlDeviceRfStart(rlUInt8_t deviceMap)
326 {
327  rlReturnVal_t retVal;
328 
329  RL_LOGV_ARG0("rlDeviceRfStart starts...\n");
330 
331  /* check if deviceIndex is out of defined value */
332  if (rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK)
333  {
334  /* set return error code */
335  retVal = RL_RET_CODE_INVALID_INPUT;
336  RL_LOGE_ARG0("Device map id is invalid\n");
337  }
338  else
339  {
340  /* Package the command with given data and send it to device */
341  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_POWERUP_MSG,
342  RL_SYS_RF_POWERUP_SB, NULL, 0U);
343  }
344 
345  RL_LOGV_ARG0("rlDeviceRfStart complete...\n");
346 
347  return retVal;
348 }
349 
363 /* DesignId : MMWL_DesignId_006 */
364 /* Requirements : AUTORADAR_REQ-708 */
365 rlReturnVal_t rlDeviceFileDownload(rlUInt8_t deviceMap, rlFileData_t* data,
366  rlUInt16_t remChunks)
367 {
368  rlReturnVal_t retVal;
369 
370  /* check if deviceIndex is out of defined value */
371  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
372  (RL_NULL_PTR == data))
373  {
374  /* set error code if DeviceMAP is invalid or data pointer is null */
375  retVal = RL_RET_CODE_INVALID_INPUT;
376  RL_LOGE_ARG0("Invalid input");
377  }
378  /* This API is valid only when mmWaveLink instance is running on
379  External Host Processor */
380  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
381  {
382  /* set error code of Platform is not set to HOST */
383  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
384  }
385  else
386  {
387  /* LDRA waiver 8 D - DD data flow anomalies found- */
388  /* Initialize in-message structure to zero */
389  rlDriverMsg_t inMsg = {0};
390  /* Initialize out-message structure to zero */
391  rlDriverMsg_t outMsg = {0};
392  /* Initialize in-payload sub-block structure to zero */
393  rlPayloadSb_t inPayloadSb = {0};
394 
395  /* Construct command packet */
396  rlDriverConstructInMsg(RL_DEV_FILE_DOWNLOAD_MSG, &inMsg, &inPayloadSb);
397 
398  /* set the remaining chunk in command message */
399  inMsg.remChunks = remChunks;
400  /* Fill in-message Payload */
401  /* AR_CODE_REVIEW MR:R.11.1 <APPROVED> "conversion required." */
402  /*LDRA_INSPECTED 95 S */
403  rlDriverFillPayload(RL_DEV_FILE_DOWNLOAD_MSG, RL_SYS_FILE_DWLD_SB, &inPayloadSb,\
404  (rlUInt8_t*)&data->fData[0U], (rlUInt16_t)data->chunkLen);
405 
406  /* Send Command to mmWave Radar Device */
407  /* LDRA waiver 45 D - can't be NULL */
408  /* LDRA waiver 45 D - can't be NULL */
409  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
410  }
411  return retVal;
412 }
413 
425 rlReturnVal_t rlDeviceGetMssVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
426 {
427  rlReturnVal_t retVal;
428 
429  /* check for NULL pointer */
430  if (data == RL_NULL_PTR)
431  {
432  /* set error code if data pointer is passed NULL */
433  retVal = RL_RET_CODE_NULL_PTR;
434  }
435  /* This API is valid only when mmWaveLink instance is running on
436  External Host Processor */
437  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
438  {
439  /* set error code of Platform is not set to HOST */
440  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
441  }
442  else
443  {
444  /* Package the command with given data and send it to device */
445  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
446  RL_SYS_VERSION_SB, (rlUInt8_t*)data, 0U);
447  }
448 
449  return retVal;
450 }
451 
462 rlReturnVal_t rlDeviceGetRfVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
463 {
464  rlReturnVal_t retVal;
465 
466  /* check for NULL pointer */
467  if (data == RL_NULL_PTR)
468  {
469  /* set error code if data pointer is passed NULL */
470  retVal = RL_RET_CODE_NULL_PTR;
471  }
472  else
473  {
474  /* Package the command with given data and send it to device */
475  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
476  RL_RF_RFVERSION_SB, (rlUInt8_t*)data, 0U);
477  }
478 
479  return retVal;
480 }
481 
492 /* DesignId : MMWL_DesignId_007 */
493 /* Requirements : AUTORADAR_REQ-709 */
494 rlReturnVal_t rlDeviceGetVersion(rlUInt8_t deviceMap, rlVersion_t* data)
495 {
496  rlReturnVal_t retVal;
497 
498  RL_LOGV_ARG0("rlDeviceGetVersion starts...\n");
499 
500  /* check if deviceIndex is out of defined value */
501  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
502  (RL_NULL_PTR == data))
503  {
504  /* set error code */
505  retVal = RL_RET_CODE_INVALID_INPUT;
506  RL_LOGE_ARG0("Invalid inputs");
507  }
508  else
509  {
510  /* If mmWaveLink is runing on ext host */
511  if (RL_PLATFORM_HOST == rlDriverGetPlatformId())
512  {
513  /* get mmwave MSS ROM or Application version */
514  retVal = rlDeviceGetMssVersion(deviceMap, &data->master);
515  }
516  else
517  {
518  /* if mmwavelink is not running on Host then no need to get MSS version */
519  retVal = RL_RET_CODE_OK;
520  RL_LOGD_ARG0(" rlPlatform is not host \n");
521  }
522 
523  if (retVal == RL_RET_CODE_OK)
524  {
525  /* get RF (RadarSS) version */
526  retVal += rlDeviceGetRfVersion(deviceMap, &data->rf);
527  }
528 
529  if (retVal == RL_RET_CODE_OK)
530  {
531  /* get mmwavelink library version */
532  retVal += rlDeviceGetMmWaveLinkVersion(&data->mmWaveLink);
533  }
534  }
535 
536  RL_LOGV_ARG0("rlDeviceGetVersion complete...\n");
537 
538  return retVal;
539 }
549 /* DesignId : MMWL_DesignId_008 */
550 /* Requirements : AUTORADAR_REQ-709 */
552 {
553  rlReturnVal_t retVal;
554 
555  RL_LOGV_ARG0("rlDeviceGetMmWaveLinkVersion starts...\n");
556 
557  if (RL_NULL_PTR != data)
558  {
559  /* mmWaveLink Version */
560  /* mmWaveLink SW Major verison */
561  data->major = RL_MMWAVELINK_VERSION_MAJOR;
562  /* mmWaveLink SW Minor verison */
563  data->minor = RL_MMWAVELINK_VERSION_MINOR;
564  /* mmWaveLink SW Build verison */
565  data->build = RL_MMWAVELINK_VERSION_BUILD;
566  /* mmWaveLink SW Debug verison */
567  data->debug = RL_MMWAVELINK_VERSION_DEBUG;
568  /* mmWaveLink SW Release Year */
569  data->year = RL_MMWAVELINK_VERSION_YEAR;
570  /* mmWaveLink SW Release Month */
571  data->month = RL_MMWAVELINK_VERSION_MONTH;
572  /* mmWaveLink SW Release date */
573  data->day = RL_MMWAVELINK_VERSION_DAY;
574  /* Set error code */
575  retVal = RL_RET_CODE_OK;
576  RL_LOGD_ARG0("Extracted MmWavelink version\n");
577  }
578  else
579  {
580  /* set error code */
581  retVal = RL_RET_CODE_INVALID_INPUT;
582  RL_LOGE_ARG0("rlDeviceGetMmWaveLinkVersion, Output param is NULL \n");
583  }
584 
585  RL_LOGV_ARG0("rlDeviceGetMmWaveLinkVersion complete...\n");
586 
587  return retVal;
588 }
589 
601 /* DesignId : MMWL_DesignId_104 */
602 /* Requirements : AUTORADAR_REQ-762 */
603 rlReturnVal_t rlDeviceSetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t* data)
604 {
605  rlReturnVal_t retVal;
606 
607  RL_LOGV_ARG0("rlDeviceSetDataFmtConfig starts...\n");
608 
609  /* check if deviceIndex is out of defined value */
610  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
611  (RL_NULL_PTR == data))
612  {
613  /* set error code if DeviceMAP is invalid or data pointer is null */
614  retVal = RL_RET_CODE_INVALID_INPUT;
615  RL_LOGE_ARG0("Invalid device mapping\n");
616  }
617  /* This API is valid only when mmWaveLink instance is running on
618  External Host Processor */
619  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
620  {
621  /* set error code of Platform is not set to HOST */
622  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
623  }
624  else
625  {
626  /* Package the command with given data and send it to device */
627  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
628  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB, (rlUInt8_t*)data,
629  (rlUInt16_t)sizeof(rlDevDataFmtCfg_t));
630  }
631 
632  RL_LOGV_ARG0("rlDeviceSetDataFmtConfig complete...\n");
633 
634  return retVal;
635 }
636 
649 /* DesignId : MMWL_DesignId_112 */
650 /* Requirements : AUTORADAR_REQ-762 */
651 rlReturnVal_t rlDeviceGetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t* data)
652 {
653  rlReturnVal_t retVal;
654 
655  RL_LOGV_ARG0("rlDeviceGetDataFmtConfig starts...\n");
656 
657  /* check if deviceIndex is out of defined value */
658  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
659  (RL_NULL_PTR == data))
660  {
661  /* set error code if DeviceMAP is invalid or data pointer is null */
662  retVal = RL_RET_CODE_INVALID_INPUT;
663  RL_LOGE_ARG0("rlDeviceGetDataFmtConfig, Invalid device map\n");
664  }
665  /* This API is valid only when mmWaveLink instance is running on
666  External Host Processor */
667  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
668  {
669  /* set error code of Platform is not set to HOST */
670  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
671  }
672  else
673  {
674  /* Package the command with given data and send it to device */
675  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
676  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB,
677  (rlUInt8_t*)data, 0U);
678  }
679 
680  RL_LOGV_ARG0("rlDeviceGetDataFmtConfig ends...\n");
681  return retVal;
682 }
683 
695 /* DesignId : MMWL_DesignId_105 */
696 /* Requirements : AUTORADAR_REQ-763 */
697 rlReturnVal_t rlDeviceSetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t* data)
698 {
699  rlReturnVal_t retVal;
700 
701  RL_LOGV_ARG0("rlDeviceSetDataPathConfig starts...\n");
702 
703  /* check if deviceIndex is out of defined value */
704  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
705  (RL_NULL_PTR == data))
706  {
707  /* set error code if DeviceMAP is invalid or data pointer is null */
708  retVal = RL_RET_CODE_INVALID_INPUT;
709  RL_LOGE_ARG0("Invalid input");
710  }
711  /* This API is valid only when mmWaveLink instance is running on
712  External Host Processor */
713  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
714  {
715  /* set error code of Platform is not set to HOST */
716  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
717  }
718  else
719  {
720  /* Package the command with given data and send it to device */
721  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
722  RL_DEV_RX_DATA_PATH_CONF_SET_SB, (rlUInt8_t*)data,
723  (rlUInt16_t)sizeof(rlDevDataPathCfg_t));
724  }
725 
726  RL_LOGV_ARG0("rlDeviceSetDataPathConfig ends...\n");
727  return retVal;
728 }
729 
742 /* DesignId : MMWL_DesignId_113 */
743 /* Requirements : AUTORADAR_REQ-763 */
744 rlReturnVal_t rlDeviceGetDataPathConfig(rlUInt8_t deviceMap,
745  rlDevDataPathCfg_t* data)
746 {
747  rlReturnVal_t retVal;
748 
749  RL_LOGV_ARG0("rlDeviceGetDataPathConfig starts...\n");
750 
751  /* check if deviceIndex is out of defined value */
752  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
753  (RL_NULL_PTR == data))
754  {
755  /* set error code if DeviceMAP is invalid or data pointer is null */
756  retVal = RL_RET_CODE_INVALID_INPUT;
757  RL_LOGE_ARG0("rlDeviceGetDataPathConfig, Invalid device map\n");
758  }
759  /* This API is valid only when mmWaveLink instance is running on
760  External Host Processor */
761  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
762  {
763  /* set error code of Platform is not set to HOST */
764  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
765  }
766  else
767  {
768  /* Package the command with given data and send it to device */
769  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
770  RL_DEV_RX_DATA_PATH_CONF_SET_SB,
771  (rlUInt8_t*)data, 0U);
772  }
773 
774  RL_LOGV_ARG0("rlDeviceGetDataPathConfig ends...\n");
775  return retVal;
776 }
777 
789 /* DesignId : MMWL_DesignId_033 */
790 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-764 */
791 rlReturnVal_t rlDeviceSetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t* data)
792 {
793  rlReturnVal_t retVal;
794 
795  RL_LOGV_ARG0("rlDeviceSetLaneConfig starts...\n");
796 
797  /* check if deviceIndex is out of defined value */
798  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
799  (RL_NULL_PTR == data))
800  {
801  /* set error code if DeviceMAP is invalid or data pointer is null */
802  retVal = RL_RET_CODE_INVALID_INPUT;
803  RL_LOGE_ARG0("Invalid input\n");
804  }
805  /* This API is valid only when mmWaveLink instance is running on
806  External Host Processor */
807  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
808  {
809  /* set error code of Platform is not set to HOST */
810  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
811  }
812  else
813  {
814  /* Package the command with given data and send it to device */
815  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
816  RL_DEV_DATA_PATH_LANEEN_SET_SB, (rlUInt8_t*)data,
817  (rlUInt16_t)sizeof(rlDevLaneEnable_t));
818  }
819  RL_LOGV_ARG0("rlDeviceSetLaneConfig ends...\n");
820 
821  return retVal;
822 }
823 
836 /* DesignId : MMWL_DesignId_115 */
837 /* Requirements : AUTORADAR_REQ-765, AUTORADAR_REQ-764 */
838 rlReturnVal_t rlDeviceGetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t* data)
839 {
840  rlReturnVal_t retVal;
841 
842  RL_LOGV_ARG0("rlDeviceGetLaneConfig starts...\n");
843 
844  /* check if deviceIndex is out of defined value */
845  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
846  (RL_NULL_PTR == data))
847  {
848  /* set error code if DeviceMAP is invalid or data pointer is null */
849  retVal = RL_RET_CODE_INVALID_INPUT;
850  RL_LOGE_ARG0("rlDeviceGetLaneConfig, Invalid device map\n");
851  }
852  /* This API is valid only when mmWaveLink instance is running on
853  External Host Processor */
854  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
855  {
856  /* set error code of Platform is not set to HOST */
857  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
858  }
859  else
860  {
861  /* Package the command with given data and send it to device */
862  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
863  RL_DEV_DATA_PATH_LANEEN_SET_SB,
864  (rlUInt8_t*)data, 0U);
865  }
866 
867  RL_LOGV_ARG0("rlDeviceGetLaneConfig ends...\n");
868  return retVal;
869 }
870 
883 /* DesignId : MMWL_DesignId_106 */
884 /* Requirements : AUTORADAR_REQ-764 */
885 rlReturnVal_t rlDeviceSetDataPathClkConfig(rlUInt8_t deviceMap,
886  rlDevDataPathClkCfg_t* data )
887 {
888  rlReturnVal_t retVal;
889 
890  RL_LOGV_ARG0("rlDeviceSetDataPathClkConfig starts...\n");
891 
892  /* check if deviceIndex is out of defined value */
893  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
894  {
895  /* set error code if DeviceMAP is invalid or data pointer is null */
896  retVal = RL_RET_CODE_INVALID_INPUT;
897  RL_LOGE_ARG0("Invalid input\n");
898  }
899  /* This API is valid only when mmWaveLink instance is running on
900  External Host Processor */
901  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
902  {
903  /* set error code of Platform is not set to HOST */
904  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
905  }
906  else
907  {
908  /* Package the command with given data and send it to device */
909  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
910  RL_DEV_DATA_PATH_CLOCK_SET_SB, (rlUInt8_t*)data,
911  (rlUInt16_t)sizeof(rlDevDataPathClkCfg_t));
912  }
913  RL_LOGV_ARG0("rlDeviceSetDataPathClkConfig ends...\n");
914 
915  return retVal;
916 }
917 
930 /* DesignId : MMWL_DesignId_114 */
931 /* Requirements : AUTORADAR_REQ-764 */
932 rlReturnVal_t rlDeviceGetDataPathClkConfig(rlUInt8_t deviceMap, rlDevDataPathClkCfg_t* data)
933 {
934  rlReturnVal_t retVal;
935 
936  RL_LOGV_ARG0("rlDeviceGetDataPathClkConfig starts...\n");
937 
938  /* check if deviceIndex is out of defined value */
939  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
940  (RL_NULL_PTR == data))
941  {
942  /* set error code if DeviceMAP is invalid or data pointer is null */
943  retVal = RL_RET_CODE_INVALID_INPUT;
944  RL_LOGE_ARG0("rlDeviceGetDataPathClkConfig, Invalid device map\n");
945  }
946  /* This API is valid only when mmWaveLink instance is running on
947  External Host Processor */
948  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
949  {
950  /* set error code of Platform is not set to HOST */
951  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
952  }
953  else
954  {
955  /* Package the command with given data and send it to device */
956  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
957  RL_DEV_DATA_PATH_CLOCK_SET_SB,
958  (rlUInt8_t*)data, 0U);
959  }
960 
961  RL_LOGV_ARG0("rlDeviceGetDataPathClkConfig ends...\n");
962  return retVal;
963 }
964 
976 /* DesignId : MMWL_DesignId_030 */
977 /* Requirements : AUTORADAR_REQ-767 */
978 rlReturnVal_t rlDeviceSetLvdsLaneConfig(rlUInt8_t deviceMap, rlDevLvdsLaneCfg_t* data)
979 {
980  rlReturnVal_t retVal;
981 
982  RL_LOGV_ARG0("rlDeviceSetLvdsLaneConfig starts...\n");
983 
984  /* check if deviceIndex is out of defined value */
985  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
986  (RL_NULL_PTR == data))
987  {
988  /* set error code if DeviceMAP is invalid or data pointer is null */
989  retVal = RL_RET_CODE_INVALID_INPUT;
990  RL_LOGE_ARG0("Invalid input\n");
991  }
992  /* This API is valid only when mmWaveLink instance is running on
993  External Host Processor */
994  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
995  {
996  /* set error code of Platform is not set to HOST */
997  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
998  }
999  else
1000  {
1001  /* Package the command with given data and send it to device */
1002  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1003  RL_DEV_DATA_PATH_CFG_SET_SB, (rlUInt8_t*)data,
1004  (rlUInt16_t)sizeof(rlDevLvdsLaneCfg_t));
1005  }
1006 
1007  RL_LOGV_ARG0("rlDeviceSetLvdsLaneConfig ends...\n");
1008 
1009  return retVal;
1010 }
1011 
1024 /* DesignId : MMWL_DesignId_116 */
1025 /* Requirements : AUTORADAR_REQ-767 */
1026 rlReturnVal_t rlDeviceGetLvdsLaneConfig(rlUInt8_t deviceMap, rlDevLvdsLaneCfg_t* data)
1027 {
1028  rlReturnVal_t retVal;
1029 
1030  RL_LOGV_ARG0("rlDeviceGetLvdsLaneConfig starts...\n");
1031 
1032  /* check if deviceIndex is out of defined value */
1033  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1034  (RL_NULL_PTR == data))
1035  {
1036  /* set error code if DeviceMAP is invalid or data pointer is null */
1037  retVal = RL_RET_CODE_INVALID_INPUT;
1038  RL_LOGE_ARG0("rlDeviceGetLvdsLaneConfig, Invalid device map\n");
1039  }
1040  /* This API is valid only when mmWaveLink instance is running on
1041  External Host Processor */
1042  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1043  {
1044  /* set error code of Platform is not set to HOST */
1045  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1046  }
1047  else
1048  {
1049  /* Package the command with given data and send it to device */
1050  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1051  RL_DEV_DATA_PATH_CFG_SET_SB,
1052  (rlUInt8_t*)data, 0U);
1053  }
1054 
1055  RL_LOGV_ARG0("rlDeviceGetLvdsLaneConfig ends...\n");
1056  return retVal;
1057 }
1058 
1075 /* DesignId : MMWL_DesignId_040 */
1076 /* Requirements : AUTORADAR_REQ-829 */
1077 rlReturnVal_t rlDeviceSetContStreamingModeConfig(rlUInt8_t deviceMap,
1079 {
1080  rlReturnVal_t retVal;
1081 
1082  RL_LOGV_ARG0("rlDeviceSetContStreamingModeConfig ends...\n");
1083 
1084  /* check if deviceIndex is out of defined value */
1085  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1086  (RL_NULL_PTR == data))
1087  {
1088  /* set error code if DeviceMAP is invalid or data pointer is null */
1089  retVal = RL_RET_CODE_INVALID_INPUT;
1090  RL_LOGE_ARG0("Invalid input");
1091  }
1092  /* This API is valid only when mmWaveLink instance is running on
1093  External Host Processor */
1094  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1095  {
1096  /* set error code of Platform is not set to HOST */
1097  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1098  }
1099  else
1100  {
1101  /* Package the command with given data and send it to device */
1102  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1103  RL_DEV_RX_CONTSTREAMING_MODE_CONF_SET_SB,
1104  (rlUInt8_t*)data,
1105  (rlUInt16_t)sizeof(rlDevContStreamingModeCfg_t));
1106  }
1107 
1108  RL_LOGV_ARG0("rlDeviceSetContStreamingModeConfig ends...\n");
1109 
1110  return retVal;
1111 
1112 }
1113 
1127 /* DesignId : MMWL_DesignId_121 */
1128 /* Requirements : AUTORADAR_REQ-829 */
1130  rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t* data)
1131 {
1132  rlReturnVal_t retVal;
1133 
1134  RL_LOGV_ARG0("rlDeviceGetContStreamingModeConfig starts...\n");
1135 
1136  /* check if deviceIndex is out of defined value */
1137  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1138  (RL_NULL_PTR == data))
1139  {
1140  /* set error code if DeviceMAP is invalid or data pointer is null */
1141  retVal = RL_RET_CODE_INVALID_INPUT;
1142  RL_LOGE_ARG0("rlDeviceGetContStreamingModeConfig, Invalid device map\n");
1143  }
1144  /* This API is valid only when mmWaveLink instance is running on
1145  External Host Processor */
1146  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1147  {
1148  /* set error code of Platform is not set to HOST */
1149  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1150  }
1151  else
1152  {
1153  /* Package the command with given data and send it to device */
1154  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1155  RL_DEV_RX_CONTSTREAMING_MODE_CONF_SET_SB,
1156  (rlUInt8_t*)data, 0U);
1157  }
1158 
1159  RL_LOGV_ARG0("rlDeviceGetContStreamingModeConfig ends...\n");
1160  return retVal;
1161 }
1162 
1174 /* DesignId : MMWL_DesignId_048 */
1175 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-766 */
1176 rlReturnVal_t rlDeviceSetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t* data)
1177 {
1178  rlReturnVal_t retVal;
1179 
1180  RL_LOGV_ARG0("rlDeviceSetCsi2Config starts...\n");
1181 
1182  /* check if deviceIndex is out of defined value */
1183  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1184  (RL_NULL_PTR == data))
1185  {
1186  /* set error code if DeviceMAP is invalid or data pointer is null */
1187  retVal = RL_RET_CODE_INVALID_INPUT;
1188  RL_LOGE_ARG0("Invalid input");
1189  }
1190  /* This API is valid only when mmWaveLink instance is running on
1191  External Host Processor */
1192  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1193  {
1194  /* set error code of Platform is not set to HOST */
1195  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1196  }
1197  else
1198  {
1199  /* Package the command with given data and send it to device */
1200  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1201  RL_DEV_CSI2_CFG_SET_SB, (rlUInt8_t*)data,
1202  (rlUInt16_t)sizeof(rlDevCsi2Cfg_t));
1203  }
1204  RL_LOGV_ARG0("rlDeviceSetCsi2Config ends...\n");
1205 
1206  return retVal;
1207 }
1208 
1221 /* DesignId : MMWL_DesignId_111 */
1222 /* Requirements : AUTORADAR_REQ-756, AUTORADAR_REQ-766 */
1223 rlReturnVal_t rlDeviceGetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t* data)
1224 {
1225  rlReturnVal_t retVal;
1226 
1227  RL_LOGV_ARG0("rlDeviceGetCsi2Config starts...\n");
1228 
1229  /* check if deviceIndex is out of defined value */
1230  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1231  (RL_NULL_PTR == data))
1232  {
1233  /* set error code if DeviceMAP is invalid or data pointer is null */
1234  retVal = RL_RET_CODE_INVALID_INPUT;
1235  RL_LOGE_ARG0("rlDeviceGetCsi2Config, Invalid device map\n");
1236  }
1237  /* This API is valid only when mmWaveLink instance is running on
1238  External Host Processor */
1239  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1240  {
1241  /* set error code of Platform is not set to HOST */
1242  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1243  }
1244  else
1245  {
1246  /* Package the command with given data and send it to device */
1247  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_CONFIG_GET_MSG,
1248  RL_DEV_CSI2_CFG_SET_SB,
1249  (rlUInt8_t*)data, 0U);
1250  }
1251 
1252  RL_LOGV_ARG0("rlDeviceGetCsi2Config ends...\n");
1253  return retVal;
1254 }
1255 
1270 /* DesignId : MMWL_DesignId_020 */
1271 /* Requirements : AUTORADAR_REQ-756 */
1272 rlReturnVal_t rlDeviceSetHsiConfig(rlUInt8_t deviceMap,
1273  rlDevHsiCfg_t* data )
1274 {
1275  rlReturnVal_t retVal;
1276  /* Initialize Command and Response Sub Blocks */
1277  rlDriverMsg_t inMsg;
1278  rlDriverMsg_t outMsg = {0};
1279  rlUInt16_t sbcCnt = 0U;
1280 
1281  /* Initialize Command and Response Sub Blocks */
1282  rlPayloadSb_t inPayloadSb[3U] = {0};
1283 
1284  RL_LOGV_ARG0("rlDeviceSetHsiConfig starts...\n");
1285 
1286  /* check if deviceIndex is out of defined value */
1287  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1288  (RL_NULL_PTR == data) )
1289  {
1290  /* set error code if DeviceMAP is invalid or data pointer is null */
1291  retVal = RL_RET_CODE_INVALID_INPUT;
1292  RL_LOGE_ARG0("rlDeviceSetHsiConfig, Invalid input \n");
1293  }
1294  else
1295  {
1296  /* Data Format config SubBlock */
1297  if (RL_NULL_PTR != data->datafmt)
1298  {
1299  /* Fill in-message Payload */
1300  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1301  RL_DEV_RX_DATA_FORMAT_CONF_SET_SB,
1302  &inPayloadSb[sbcCnt],
1303  (rlUInt8_t* )data->datafmt,
1304  (rlUInt16_t)sizeof(rlDevDataFmtCfg_t));
1305  /* increament Sub-block count */
1306  sbcCnt++;
1307  }
1308 
1309  /* Data Path Config SubBlock */
1310  if (RL_NULL_PTR != data->dataPath)
1311  {
1312  /* Fill in-message Payload */
1313  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1314  RL_DEV_RX_DATA_PATH_CONF_SET_SB,
1315  &inPayloadSb[sbcCnt],
1316  (rlUInt8_t* )data->dataPath,
1317  (rlUInt16_t)sizeof(rlDevDataPathCfg_t));
1318  /* increament Sub-block count */
1319  sbcCnt++;
1320  }
1321 
1322  /* Data Path clock Config SubBlock */
1323  if (RL_NULL_PTR != data->dataPathClk)
1324  {
1325  /* Fill in-message Payload */
1326  rlDriverFillPayload(RL_DEV_CONFIG_SET_MSG,
1327  RL_DEV_DATA_PATH_CLOCK_SET_SB,
1328  &inPayloadSb[sbcCnt],
1329  (rlUInt8_t* )data->dataPathClk,
1330  (rlUInt16_t)sizeof(rlDevDataPathClkCfg_t));
1331  /* increament Sub-block count */
1332  sbcCnt++;
1333  }
1334 
1335  /* Construct command packet */
1336  rlDriverConstructInMsg(RL_DEV_CONFIG_SET_MSG, &inMsg, &inPayloadSb[0U]);
1337 
1338  if (sbcCnt > 0U)
1339  {
1340  /* setting num of sub-block to inMsg */
1341  inMsg.opcode.nsbc = sbcCnt;
1342 
1343  /* Send Command to mmWave Radar Device */
1344  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1345  }
1346  else
1347  {
1348  /* set error code if application doesn't pass any subBlock data */
1349  retVal = RL_RET_CODE_INVALID_INPUT;
1350  RL_LOGE_ARG0("sub block is NULL\n");
1351  }
1352  }
1353 
1354  RL_LOGV_ARG0("rlDeviceSetHsiConfig ends...\n");
1355 
1356  return retVal;
1357 }
1358 
1370 /* DesignId : MMWL_DesignId_101 */
1371 /* Requirements : AUTORADAR_REQ-765 */
1372 rlReturnVal_t rlDeviceSetHsiClk(rlUInt8_t deviceMap, rlDevHsiClk_t* data)
1373 {
1374  rlReturnVal_t retVal;
1375 
1376  RL_LOGV_ARG0("rlDeviceSetHsiClk starts...\n");
1377 
1378  /* check if deviceIndex is out of defined value */
1379  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1380  (RL_NULL_PTR == data))
1381  {
1382  /* set error code if DeviceMAP is invalid or data pointer is null */
1383  retVal = RL_RET_CODE_INVALID_INPUT;
1384  RL_LOGE_ARG0("Invalid input\n");
1385  }
1386  else
1387  {
1388  /* Package the command with given data and send it to device */
1389  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1390  RL_RF_HIGHSPEEDINTFCLK_CONF_SET_SB,
1391  (rlUInt8_t*)data,
1392  (rlUInt16_t)sizeof(rlDevHsiClk_t));
1393  }
1394  RL_LOGV_ARG0("rlDeviceSetHsiClk ends...\n");
1395 
1396  return retVal;
1397 }
1398 
1411 /* DesignId : MMWL_DesignId_069 */
1412 /* Requirements : AUTORADAR_REQ-713 */
1413 rlReturnVal_t rlDeviceMcuClkConfig(rlUInt8_t deviceMap, rlMcuClkCfg_t * data)
1414 {
1415  rlReturnVal_t retVal;
1416 
1417  RL_LOGV_ARG0("rlDeviceMcuClkConfig starts...\n");
1418 
1419  /* check if deviceIndex is out of defined value */
1420  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1421  (RL_NULL_PTR == data))
1422  {
1423  /* set error code if DeviceMAP is invalid or data pointer is null */
1424  retVal = RL_RET_CODE_INVALID_INPUT;
1425  RL_LOGE_ARG0("Invalid input");
1426  }
1427  /* This API is valid only when mmWaveLink instance is running on
1428  External Host Processor */
1429  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1430  {
1431  /* set error code of Platform is not set to HOST */
1432  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1433  }
1434  else
1435  {
1436  /* Package the command with given data and send it to device */
1437  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1438  RL_DEV_MCUCLOCK_CONF_SET_SB, (rlUInt8_t*)data,
1439  (rlUInt16_t)sizeof(rlMcuClkCfg_t));
1440  }
1441  RL_LOGV_ARG0("rlDeviceMcuClkConfig ends...\n");
1442 
1443  return retVal;
1444 }
1445 
1457 /* DesignId : MMWL_DesignId_070 */
1458 /* Requirements : AUTORADAR_REQ-907 */
1459 rlReturnVal_t rlDevicePmicClkConfig(rlUInt8_t deviceMap, rlPmicClkCfg_t * data)
1460 {
1461  rlReturnVal_t retVal;
1462 
1463  RL_LOGV_ARG0("rlDevicePmicClkConfig starts...\n");
1464 
1465  /* check if deviceIndex is out of defined value */
1466  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1467  (RL_NULL_PTR == data))
1468  {
1469  /* set error code if DeviceMAP is invalid or data pointer is null */
1470  retVal = RL_RET_CODE_INVALID_INPUT;
1471  RL_LOGE_ARG0("Invalid input");
1472  }
1473  /* This API is valid only when mmWaveLink instance is running on
1474  External Host Processor */
1475  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1476  {
1477  /* set error code of Platform is not set to HOST */
1478  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1479  }
1480  else
1481  {
1482  /* Package the command with given data and send it to device */
1483  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1484  RL_DEV_PMICCLOCK_CONF_SET_SB, (rlUInt8_t*)data,
1485  (rlUInt16_t)sizeof(rlPmicClkCfg_t));
1486  }
1487  RL_LOGV_ARG0("rlDevicePmicClkConfig ends...\n");
1488 
1489  return retVal;
1490 }
1491 
1513 /* DesignId : MMWL_DesignId_071 */
1514 /* Requirements : AUTORADAR_REQ-908 */
1515 rlReturnVal_t rlDeviceLatentFaultTests(rlUInt8_t deviceMap, rllatentFault_t * data)
1516 {
1517  rlReturnVal_t retVal;
1518 
1519  RL_LOGV_ARG0("rlDeviceLatentFaultTests starts...\n");
1520 
1521  /* check if deviceIndex is out of defined value */
1522  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1523  (RL_NULL_PTR == data))
1524  {
1525  /* set error code if DeviceMAP is invalid or data pointer is null */
1526  retVal = RL_RET_CODE_INVALID_INPUT;
1527  RL_LOGE_ARG0("Invalid input");
1528  }
1529  /* This API is valid only when mmWaveLink instance is running on
1530  External Host Processor */
1531  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1532  {
1533  /* set error code of Platform is not set to HOST */
1534  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1535  }
1536  else
1537  {
1538  /* Package the command with given data and send it to device */
1539  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1540  RL_DEV_LATENTFAULT_TEST_CONF_SB, (rlUInt8_t*)data,
1541  (rlUInt16_t)sizeof(rllatentFault_t));
1542  }
1543  RL_LOGV_ARG0("rlDeviceLatentFaultTests ends...\n");
1544 
1545  return retVal;
1546 }
1547 
1559 /* DesignId : MMWL_DesignId_072 */
1560 /* Requirements : AUTORADAR_REQ-909 */
1561 rlReturnVal_t rlDeviceEnablePeriodicTests(rlUInt8_t deviceMap, rlperiodicTest_t * data)
1562 {
1563  rlReturnVal_t retVal;
1564 
1565  RL_LOGV_ARG0("rlDeviceEnablePeriodicTests starts...\n");
1566 
1567  /* check if deviceIndex is out of defined value */
1568  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1569  (RL_NULL_PTR == data))
1570  {
1571  /* set error code if DeviceMAP is invalid or data pointer is null */
1572  retVal = RL_RET_CODE_INVALID_INPUT;
1573  RL_LOGE_ARG0("Invalid input");
1574  }
1575  /* This API is valid only when mmWaveLink instance is running on
1576  External Host Processor */
1577  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1578  {
1579  /* set error code of Platform is not set to HOST */
1580  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1581  }
1582  else
1583  {
1584  /* Package the command with given data and send it to device */
1585  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1586  RL_DEV_PERIODICTESTS_CONF_SB, (rlUInt8_t*)data,
1587  (rlUInt16_t)sizeof(rlperiodicTest_t));
1588  }
1589  RL_LOGV_ARG0("rlDeviceEnablePeriodicTests ends...\n");
1590 
1591  return retVal;
1592 }
1593 
1606 /* DesignId : MMWL_DesignId_103 */
1607 /* Requirements : AUTORADAR_REQ-910 */
1608 rlReturnVal_t rlDeviceSetTestPatternConfig(rlUInt8_t deviceMap, rltestPattern_t * data)
1609 {
1610  rlReturnVal_t retVal;
1611 
1612  RL_LOGV_ARG0("rlDeviceSetTestPatternConfig starts...\n");
1613 
1614  /* check if deviceIndex is out of defined value */
1615  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1616  (RL_NULL_PTR == data))
1617  {
1618  /* set error code if DeviceMAP is invalid or data pointer is null */
1619  retVal = RL_RET_CODE_INVALID_INPUT;
1620  RL_LOGE_ARG0("Invalid input");
1621  }
1622  /* This API is valid only when mmWaveLink instance is running on
1623  External Host Processor */
1624  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1625  {
1626  /* set error code of Platform is not set to HOST */
1627  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1628  }
1629  else
1630  {
1631  /* Package the command with given data and send it to device */
1632  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1633  RL_DEV_TESTPATTERN_GEN_SET_SB, (rlUInt8_t*)data,
1634  (rlUInt16_t)sizeof(rltestPattern_t));
1635  }
1636  RL_LOGV_ARG0("rlDeviceSetTestPatternConfig ends...\n");
1637 
1638  return retVal;
1639 }
1640 
1653 /* DesignId : MMWL_DesignId_117 */
1654 /* Requirements : AUTORADAR_REQ-886, AUTORADAR_REQ-1037 */
1655 rlReturnVal_t rlDeviceSetMiscConfig(rlUInt8_t deviceMap, rlDevMiscCfg_t *data)
1656 {
1657  rlReturnVal_t retVal;
1658 
1659  RL_LOGV_ARG0("rlDeviceSetMiscConfig starts...\n");
1660 
1661  /* check if deviceIndex is out of defined value */
1662  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1663  (RL_NULL_PTR == data))
1664  {
1665  /* set error code if DeviceMAP is invalid or data pointer is null */
1666  retVal = RL_RET_CODE_INVALID_INPUT;
1667  RL_LOGE_ARG0("Invalid input");
1668  }
1669  /* This API is valid only when mmWaveLink instance is running on
1670  External Host Processor */
1671  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1672  {
1673  /* set error code of Platform is not set to HOST */
1674  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1675  }
1676  else
1677  {
1678  /* Package the command with given data and send it to device */
1679  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1680  RL_DEV_MISC_CFG_SET_SB, (rlUInt8_t*)data,
1681  (rlUInt16_t)sizeof(rlDevMiscCfg_t));
1682  }
1683  RL_LOGV_ARG0("rlDeviceSetMiscConfig ends...\n");
1684 
1685  return retVal;
1686 }
1687 
1701 /* DesignId : MMWL_DesignId_127 */
1702 /* Requirements : AUTORADAR_REQ-949 */
1703 rlReturnVal_t rlDeviceSetDebugSigEnableConfig(rlUInt8_t deviceMap, rlDebugSigEnCfg_t *data)
1704 {
1705  rlReturnVal_t retVal;
1706 
1707  RL_LOGV_ARG0("rlDeviceSetDebugSigEnableConfig starts...\n");
1708 
1709  /* check if deviceIndex is out of defined value */
1710  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1711  (RL_NULL_PTR == data))
1712  {
1713  /* set error code if DeviceMAP is invalid or data pointer is null */
1714  retVal = RL_RET_CODE_INVALID_INPUT;
1715  RL_LOGE_ARG0("Invalid input");
1716  }
1717  /* This API is valid only when mmWaveLink instance is running on
1718  External Host Processor */
1719  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1720  {
1721  /* set error code of Platform is not set to HOST */
1722  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1723  }
1724  else
1725  {
1726  /* Package the command with given data and send it to device */
1727  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1728  RL_DEV_DEBUGSIG_EN_SET_SB, (rlUInt8_t*)data,
1729  (rlUInt16_t)sizeof(rlDebugSigEnCfg_t));
1730  }
1731  RL_LOGV_ARG0("rlDeviceSetDebugSigEnableConfig ends...\n");
1732 
1733  return retVal;
1734 }
1735 
1759 /* DesignId : MMWL_DesignId_128 */
1760 /* Requirements : AUTORADAR_REQ-1049 */
1761 rlReturnVal_t rlDeviceSetCsi2DelayDummyConfig(rlUInt8_t deviceMap, rlCsi2DelayDummyCfg_t *data)
1762 {
1763  rlReturnVal_t retVal;
1764 
1765  RL_LOGV_ARG0("rlDeviceSetCsi2DelayDummyConfig starts...\n");
1766 
1767  /* check if deviceIndex is out of defined value */
1768  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1769  (RL_NULL_PTR == data))
1770  {
1771  /* set error code if DeviceMAP is invalid or data pointer is null */
1772  retVal = RL_RET_CODE_INVALID_INPUT;
1773  RL_LOGE_ARG0("Invalid input");
1774  }
1775  /* This API is valid only when mmWaveLink instance is running on
1776  External Host Processor */
1777  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1778  {
1779  /* set error code of Platform is not set to HOST */
1780  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1781  }
1782  else
1783  {
1784  /* Package the command with given data and send it to device */
1785  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_CONFIG_SET_MSG,
1786  RL_DEV_CSI2_DELAY_DUMMY_CFG_SET_SB, (rlUInt8_t*)data,
1787  (rlUInt16_t)sizeof(rlCsi2DelayDummyCfg_t));
1788  }
1789  RL_LOGV_ARG0("rlDeviceSetCsi2DelayDummyConfig ends...\n");
1790 
1791  return retVal;
1792 }
1793 
1805 /* DesignId : MMWL_DesignId_124 */
1806 /* Requirements : AUTORADAR_REQ-1040, AUTORADAR_REQ-1060 */
1807 rlReturnVal_t rlDeviceGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
1808 {
1809  rlReturnVal_t retVal;
1810 
1811  RL_LOGV_ARG0("rlDeviceGetCpuFault starts...\n");
1812 
1813  /* check if deviceIndex is out of defined value */
1814  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1815  (RL_NULL_PTR == data))
1816  {
1817  /* set error code if DeviceMAP is invalid or data pointer is null */
1818  retVal = RL_RET_CODE_INVALID_INPUT;
1819  RL_LOGE_ARG0("Invalid input");
1820  }
1821  /* This API is valid only when mmWaveLink instance is running on
1822  External Host Processor */
1823  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1824  {
1825  /* set error code of Platform is not set to HOST */
1826  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1827  }
1828  else
1829  {
1830  /* Package the command with given data and send it to device */
1831  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
1832  RL_SYS_CPUFAULT_STATUS_SB, (rlUInt8_t*)data,
1833  (rlUInt16_t)sizeof(rlCpuFault_t));
1834  }
1835  RL_LOGV_ARG0("rlDeviceGetCpuFault ends...\n");
1836 
1837  return retVal;
1838 }
1839 
1852 /* DesignId : MMWL_DesignId_124 */
1853 /* Requirements : AUTORADAR_REQ-1040 */
1854 rlReturnVal_t rlDeviceGetEsmFault(rlUInt8_t deviceMap, rlMssEsmFault_t *data)
1855 {
1856  rlReturnVal_t retVal;
1857 
1858  RL_LOGV_ARG0("rlDeviceGetEsmFault starts...\n");
1859 
1860  /* check if deviceIndex is out of defined value */
1861  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1862  (RL_NULL_PTR == data))
1863  {
1864  /* set error code if DeviceMAP is invalid or data pointer is null */
1865  retVal = RL_RET_CODE_INVALID_INPUT;
1866  RL_LOGE_ARG0("Invalid input");
1867  }
1868  /* This API is valid only when mmWaveLink instance is running on
1869  External Host Processor */
1870  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1871  {
1872  /* set error code of Platform is not set to HOST */
1873  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1874  }
1875  else
1876  {
1877  /* Package the command with given data and send it to device */
1878  retVal = rlDriverExecuteGetApi(deviceMap, RL_DEV_STATUS_GET_MSG,
1879  RL_SYS_ESMFAULT_STATUS_SB, (rlUInt8_t*)data,
1880  (rlUInt16_t)sizeof(rlMssEsmFault_t));
1881  }
1882  RL_LOGV_ARG0("rlDeviceGetEsmFault ends...\n");
1883 
1884  return retVal;
1885 }
1886 
1896 /* DesignId : MMWL_DesignId_028 */
1897 /* Requirements : AUTORADAR_REQ-710 */
1898 rlReturnVal_t rlDeviceConfigureCrc(rlCrcType_t crcType)
1899 {
1900  /* set CRC Type passed by application to rlDriver */
1901  return rlDriverConfigureCrc(crcType);
1902 }
1903 
1913 /* DesignId : MMWL_DesignId_028 */
1914 /* Requirements : AUTORADAR_REQ_710 */
1915 rlReturnVal_t rlDeviceConfigureAckTimeout(rlUInt32_t ackTimeout)
1916 {
1917  /* Set Ack Timeout value passed by applicatio to rlDriver */
1918  return rlDriverConfigureAckTimeout(ackTimeout);
1919 }
1920 
1931 /* DesignId : MMWL_DesignId_028 */
1932 /* Requirements : AUTORADAR_REQ_781 */
1933 rlReturnVal_t rlDeviceSetRetryCount(rlUInt8_t retryCnt)
1934 {
1935  /* Set command retry count to rlDriver */
1936  return rlDriverSetRetryCount(retryCnt);
1937 }
1938 
1953 /* SourceId : */
1954 /* DesignId : */
1955 /* Requirements : */
1956 rlReturnVal_t rlDeviceSetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t value)
1957 {
1958  rlReturnVal_t retVal;
1959  rlDevInternalCfg_t intCfg;
1960 
1961  RL_LOGV_ARG0("rlDeviceSetInternalConf starts...\n");
1962 
1963  /* check if deviceIndex is out of defined value */
1964  if (rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK)
1965  {
1966  /* set error code if DeviceMAP is invalid or data pointer is null */
1967  retVal = RL_RET_CODE_INVALID_INPUT;
1968  RL_LOGE_ARG0("Invalid device mapping\n");
1969  }
1970  /* This API is valid only when mmWaveLink instance is running on
1971  External Host Processor */
1972  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
1973  {
1974  /* set error code of Platform is not set to HOST */
1975  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
1976  }
1977  else
1978  {
1979  /* Fill SubBlock Data */
1980  intCfg.memAddr = memAddr;
1981  intCfg.value = value;
1982  /* Package the command with given data and send it to device */
1983  retVal = rlDriverExecuteSetApi(deviceMap, RL_DEV_INTERNAL_CONF_SET_MSG,
1984  RL_DEV_MEM_REGISTER_SB, (rlUInt8_t*)&intCfg,
1985  (rlUInt16_t)sizeof(rlDevInternalCfg_t));
1986  }
1987 
1988  RL_LOGV_ARG0("rlDeviceSetInternalConf complete...\n");
1989 
1990  return retVal;
1991 }
1992 
2007 /* SourceId : */
2008 /* DesignId : */
2009 /* Requirements : */
2010 rlReturnVal_t rlDeviceGetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t* value)
2011 {
2012  rlReturnVal_t retVal;
2013 
2014  RL_LOGV_ARG0("rlDeviceGetInternalConf starts...\n");
2015 
2016  /* check if deviceIndex is out of defined value */
2017  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2018  (RL_NULL_PTR == (rlUInt32_t*)value))
2019  {
2020  /* set error code if DeviceMAP is invalid or data pointer is null */
2021  retVal = RL_RET_CODE_INVALID_INPUT;
2022  RL_LOGE_ARG0("Invalid device map\n");
2023  }
2024  /* This API is valid only when mmWaveLink instance is running on
2025  External Host Processor */
2026  else if (RL_PLATFORM_HOST != rlDriverGetPlatformId())
2027  {
2028  /* set error code of Platform is not set to HOST */
2029  retVal = RL_RET_CODE_API_NOT_SUPPORTED;
2030  }
2031  else
2032  {
2033  /* AR_CODE_REVIEW MR:R.2.2 <INSPECTED> "intCfg.memAddr will be populated from
2034  the response obtained from the device." */
2035  /*LDRA_INSPECTED 105 D */
2036  rlDevInternalCfg_t intCfg = { 0 };
2037  rlPayloadSb_t inPayloadSb = { 0 };
2038  rlPayloadSb_t outPayloadSb;
2039  /* Initialize Command and Response Sub Blocks */
2040  rlDriverMsg_t inMsg = { 0 };
2041  rlDriverMsg_t outMsg = { 0 };
2042 
2043  /* Construct command packet */
2044  rlDriverConstructInMsg(RL_DEV_INTERNAL_CONF_GET_MSG, &inMsg, &inPayloadSb);
2045  /* Fill in-message Payload */
2046  rlDriverFillPayload(RL_DEV_INTERNAL_CONF_GET_MSG, RL_DEV_MEM_REGISTER_SB, &inPayloadSb,
2047  (rlUInt8_t*)&memAddr, (rlUInt16_t)sizeof(rlUInt32_t));
2048 
2049  /* Set Command Sub Block*/
2050  outPayloadSb.sbid = RL_GET_UNIQUE_SBID(RL_DEV_INTERNAL_CONF_GET_MSG,
2051  RL_DEV_MEM_REGISTER_SB);
2052  outPayloadSb.len = (rlUInt16_t)sizeof(rlDevInternalCfg_t);
2053  outPayloadSb.pSblkData = (rlUInt8_t*)(&intCfg);
2054 
2055  /* Construct response packet */
2056  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2057 
2058  /* Send Command to mmWave Radar Device */
2059  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2060  /* Setting the received memAddr value */
2061  *value = intCfg.value;
2062  }
2063 
2064  RL_LOGV_ARG0("rlDeviceGetInternalConf ends...\n");
2065  return retVal;
2066 }
2067 
2079 /* DesignId : MMWL_DesignId_046 */
2080 /* Requirements : AUTORADAR_REQ-795 */
2081 rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t* data)
2082 {
2083  rlReturnVal_t retVal;
2084 
2085  RL_LOGV_ARG0("rlDeviceAdvFrameConfigApply starts...\n");
2086 
2087  /* check if deviceIndex is out of defined value */
2088  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2089  {
2090  /* set return error code */
2091  retVal = RL_RET_CODE_INVALID_INPUT;
2092  RL_LOGE_ARG0("rlDeviceAdvFrameConfigApply, Invalid device map\n");
2093  }
2094  else
2095  {
2096  /* Initialize Command and Response Sub Blocks */
2097  rlDriverMsg_t inMsg = {0};
2098  rlDriverMsg_t outMsg = {0};
2099  rlPayloadSb_t inPayloadSb = {0};
2100  /* Construct command packet */
2101  rlDriverConstructInMsg(RL_DEV_CONFIG_APPLY_MSG, &inMsg, &inPayloadSb);
2102  /* Fill in-message Payload */
2103  rlDriverFillPayload(RL_DEV_CONFIG_APPLY_MSG, RL_ADV_FRAME_DATA_CONFIG_SB,
2104  &inPayloadSb, (rlUInt8_t*)data,
2105  (rlUInt16_t)sizeof(rlAdvFrameDataCfg_t));
2106 
2107  /* Send Command to mmWave Radar Device */
2108  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2109  }
2110 
2111  RL_LOGV_ARG0("rlDeviceAdvFrameConfigApply ends...\n");
2112 
2113  return retVal;
2114 }
2115 
2127 /* DesignId : MMWL_DesignId_015 */
2128 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
2129  AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
2130 rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t* data)
2131 {
2132  rlReturnVal_t retVal;
2133 
2134  RL_LOGV_ARG0("rlDeviceFrameConfigApply starts...\n");
2135 
2136  /* check if deviceIndex is out of defined value */
2137  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2138  {
2139  /* set return error code */
2140  retVal = RL_RET_CODE_INVALID_INPUT;
2141  RL_LOGE_ARG0("rlDeviceFrameConfigApply, Invalid device map\n");
2142  }
2143  else
2144  {
2145  /* Initialize Command and Response Sub Blocks */
2146  rlDriverMsg_t inMsg = {0};
2147  rlDriverMsg_t outMsg = {0};
2148  rlPayloadSb_t inPayloadSb = {0};
2149  /* Construct command packet */
2150  rlDriverConstructInMsg(RL_DEV_CONFIG_APPLY_MSG, &inMsg, &inPayloadSb);
2151  /* Fill in-message Payload */
2152  rlDriverFillPayload(RL_DEV_CONFIG_APPLY_MSG, RL_SYS_CONFIG_APPLY_SB,
2153  &inPayloadSb, (rlUInt8_t*)data,
2154  (rlUInt16_t)sizeof(rlFrameApplyCfg_t));
2155 
2156  /* Send Command to mmWave Radar Device */
2157  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2158  }
2159 
2160  RL_LOGV_ARG0("rlDeviceFrameConfigApply ends...\n");
2161 
2162  return retVal;
2163 }
2164 
2184 /* DesignId : MMWL_DesignId_132 */
2185 /* Requirements : AUTORADAR_REQ-1050 */
2186 /*AR_CODE_REVIEW MR:R.2.2 <INSPECTED> "addrOffset is assigned based on different conditions"*/
2187 /*LDRA_INSPECTED 8 D */
2188 rlReturnVal_t rlDevSetFillLUTBuff(rlFillLUTParams_t *fillLUTParams, rlInt8_t *inData,
2189  rlInt8_t *outData, rlUInt16_t *LUTAddrOffset)
2190 {
2191  rlReturnVal_t retVal = RL_RET_CODE_OK;
2192  rlUInt16_t addrOffset = 0U;
2193  rlUInt16_t idx, alignIdx;
2194 
2195  RL_LOGV_ARG0("rlDevSetFillLUTBuff starts...\n");
2196 
2197  /* check if input parameters are valid */
2198  if ((RL_NULL_PTR == fillLUTParams) || (RL_NULL_PTR == outData) || \
2199  (RL_NULL_PTR == inData) || (RL_NULL_PTR == LUTAddrOffset))
2200  {
2201  /* set return error code */
2202  retVal = RL_RET_CODE_INVALID_INPUT;
2203  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid input parameters\n");
2204  }
2205  else
2206  {
2207  /* Profile ID */
2208  if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_PROFILE_VAR)
2209  {
2210  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2211  {
2212  if ((idx % 2U) == 0U)
2213  {
2214  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2215  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2216  outData[idx/2] = (rlInt8_t)(((rlUInt8_t)inData[idx]) & 0xFU);
2217  }
2218  else
2219  {
2220  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2221  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2222  /*AR_CODE_REVIEW MR:R.10.1, 10.2 <INSPECTED> "outData cannot be -ve"*/
2223  /*LDRA_INSPECTED 329 S */
2224  outData[idx/2] |= (rlInt8_t)((((rlUInt8_t)inData[idx]) & 0xFU) << 4U);
2225  }
2226  }
2227  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2228  fillLUTParams->inputSize;
2229  alignIdx = fillLUTParams->inputSize;
2230  /* fill up the remaining bytes to make it 4 bytes aligned */
2231  for (idx = alignIdx; idx < addrOffset; idx++)
2232  {
2233  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2234  /*LDRA_INSPECTED 436 S */
2235  outData[idx] = 0;
2236  }
2237  }
2238  /* Start Frequency */
2239  else if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_FREQ_START_VAR)
2240  {
2241  /* 4 Bytes of size */
2242  if (fillLUTParams->chirpParamSize == 0U)
2243  {
2244  (void)memcpy(outData, inData, fillLUTParams->inputSize * 4U);
2245  addrOffset = fillLUTParams->inputSize * 4U;
2246  alignIdx = fillLUTParams->inputSize * 4U;
2247  }
2248  /* 2 Bytes of size */
2249  else if (fillLUTParams->chirpParamSize == 1U)
2250  {
2251  (void)memcpy(outData, inData, fillLUTParams->inputSize * 2U);
2252  addrOffset = ((rlUInt16_t)(abs((fillLUTParams->inputSize * 2U) - 4U)) % 4U) + \
2253  (fillLUTParams->inputSize * 2U);
2254  alignIdx = fillLUTParams->inputSize * 2U;
2255  }
2256  /* 1 Bytes of size */
2257  else if (fillLUTParams->chirpParamSize == 2U)
2258  {
2259  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2260  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2261  fillLUTParams->inputSize;
2262  alignIdx = fillLUTParams->inputSize;
2263  }
2264  /* Invalid chirp param size */
2265  else
2266  {
2267  /* set return error code */
2268  retVal = (rlReturnVal_t)RL_RET_CODE_LUT_CHIRP_PAR_SCALE_SIZE_INVALID;
2269  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter size\n");
2270  addrOffset = 0U;
2271  alignIdx = 0U;
2272  }
2273  /* fill up the remaining bytes to make 4 bytes aligned */
2274  for (idx = alignIdx; idx < addrOffset; idx++)
2275  {
2276  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2277  /*LDRA_INSPECTED 436 S */
2278  outData[idx] = 0;
2279  }
2280  }
2281  /* Frequency Slope */
2282  else if (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_FREQ_SLOPE_VAR)
2283  {
2284  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2285  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2286  fillLUTParams->inputSize;
2287  alignIdx = fillLUTParams->inputSize;
2288  /* fill up the remaining bytes to make 4 bytes aligned */
2289  for (idx = alignIdx; idx < addrOffset; idx++)
2290  {
2291  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2292  /*LDRA_INSPECTED 436 S */
2293  outData[idx] = 0;
2294  }
2295  }
2296  /* Idle Time / ADC Start Time */
2297  else if ((fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_IDLE_TIME_VAR) || \
2298  (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_ADC_START_TIME_VAR))
2299  {
2300  /* 2 Bytes of size */
2301  if (fillLUTParams->chirpParamSize == 0U)
2302  {
2303  (void)memcpy(outData, inData, fillLUTParams->inputSize * 2U);
2304  addrOffset = ((rlUInt16_t)(abs((fillLUTParams->inputSize * 2U) - 4U)) % 4U) + \
2305  (fillLUTParams->inputSize * 2U);
2306  alignIdx = fillLUTParams->inputSize * 2U;
2307  }
2308  /* 1 Bytes of size */
2309  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2310  /*LDRA_INSPECTED 370 S */
2311  else if (fillLUTParams->chirpParamSize == 1U)
2312  {
2313  (void)memcpy(outData, inData, fillLUTParams->inputSize);
2314  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2315  fillLUTParams->inputSize;
2316  alignIdx = fillLUTParams->inputSize;
2317  }
2318  /* Invalid chirp param size */
2319  else
2320  {
2321  /* set return error code */
2322  retVal = (rlReturnVal_t)RL_RET_CODE_LUT_CHIRP_PAR_SCALE_SIZE_INVALID;
2323  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter size\n");
2324  addrOffset = 0U;
2325  alignIdx = 0U;
2326  }
2327  /* fill up the remaining bytes to make 4 bytes aligned */
2328  for (idx = alignIdx; idx < addrOffset; idx++)
2329  {
2330  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2331  /*LDRA_INSPECTED 436 S */
2332  outData[idx] = 0;
2333  }
2334  }
2335  /* Tx Enable / BPM Enable */
2336  else if ((fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_TX_EN_VAR) || \
2337  (fillLUTParams->chirpParamIndex == RL_LUT_CHIRP_BPM_VAL_VAR))
2338  {
2339  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2340  {
2341  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2342  /*LDRA_INSPECTED 370 S */
2343  if ((idx % 2U) == 0U)
2344  {
2345  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2346  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2347  outData[idx/2] = (rlInt8_t)(((rlUInt8_t)inData[idx]) & 0x7U);
2348  }
2349  else
2350  {
2351  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2352  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2353  /*AR_CODE_REVIEW MR:R.10.1, 10.2 <INSPECTED> "outData cannot be -ve"*/
2354  /*LDRA_INSPECTED 329 S */
2355  outData[idx/2] |= (rlInt8_t)((((rlUInt8_t)inData[idx]) & 0x7U) << 4U);
2356  }
2357  }
2358  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2359  fillLUTParams->inputSize;
2360  alignIdx = fillLUTParams->inputSize;
2361  /* fill up the remaining bytes to make 4 bytes aligned */
2362  for (idx = alignIdx; idx < addrOffset; idx++)
2363  {
2364  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2365  /*LDRA_INSPECTED 436 S */
2366  outData[idx] = 0;
2367  }
2368  }
2369  /* TX0/TX1/TX2 Phase shifter */
2370  /*AR_CODE_REVIEW <INSPECTED> "If condition is necessary" */
2371  /*LDRA_INSPECTED 370 S */
2372  else if ((fillLUTParams->chirpParamIndex == RL_LUT_TX0_PHASE_SHIFT_VAR) || \
2373  (fillLUTParams->chirpParamIndex == RL_LUT_TX1_PHASE_SHIFT_VAR) || \
2374  (fillLUTParams->chirpParamIndex == RL_LUT_TX2_PHASE_SHIFT_VAR))
2375  {
2376  for (idx = 0U; idx < fillLUTParams->inputSize; idx++)
2377  {
2378  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2379  /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 436 S */ /*LDRA_INSPECTED 444 S */
2380  outData[idx] = (rlInt8_t)(((rlUInt8_t)inData[idx]) << 2U);
2381  }
2382 
2383  addrOffset = ((rlUInt16_t)(abs(fillLUTParams->inputSize - 4U)) % 4U) + \
2384  fillLUTParams->inputSize;
2385  alignIdx = fillLUTParams->inputSize;
2386  /* fill up the remaining bytes to make 4 bytes aligned */
2387  for (idx = alignIdx; idx < addrOffset; idx++)
2388  {
2389  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
2390  /*LDRA_INSPECTED 436 S */
2391  outData[idx] = 0;
2392  }
2393  }
2394  /* Invalid chirp parameter index */
2395  else
2396  {
2397  /* set return error code */
2398  retVal = (rlReturnVal_t)RL_RET_CODE_CHIRP_PARAM_IND_INVALID;
2399  RL_LOGE_ARG0("rlDevSetFillLUTBuff, Invalid chirp parameter index\n");
2400  }
2401  }
2402 
2403  if (retVal == RL_RET_CODE_OK)
2404  {
2405  /* Update the chirp LUT address offset */
2406  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "addrOffset is always greater than zero"*/
2407  /*LDRA_INSPECTED 124 D */
2408  *LUTAddrOffset = addrOffset + fillLUTParams->lutGlobalOffset;
2409  }
2410 
2411  RL_LOGV_ARG0("rlDevSetFillLUTBuff ends...\n");
2412 
2413  return retVal;
2414 }
2415 
2416 /*
2417  * END OF rl_device.c FILE
2418  */
rlReturnVal_t rlDevicePmicClkConfig(rlUInt8_t deviceMap, rlPmicClkCfg_t *data)
Sets the configurations for PMIC clock.
Definition: rl_device.c:1459
rlReturnVal_t rlDeviceSetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t *data)
Sets LVDS/CSI2 Data output format.
Definition: rl_device.c:603
rlUInt16_t lutGlobalOffset
LUT offset within the entire 12kB buffer .
Definition: rl_device.h:1239
rlReturnVal_t rlDeviceRfStart(rlUInt8_t deviceMap)
Enables mmwave RF/Analog Sub system.
Definition: rl_device.c:325
mmWaveLink client callback structure
Definition: mmwavelink.h:1473
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:1413
rlReturnVal_t rlDeviceGetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t *data)
Gets Csi2 data format Configuration.
Definition: rl_device.c:1223
rlInt32_t(* rlDeviceEnable)(rlUInt8_t deviceIndex)
Bring mmWave radar device out of Reset.
Definition: mmwavelink.h:1348
rlReturnVal_t rlDeviceLatentFaultTests(rlUInt8_t deviceMap, rllatentFault_t *data)
Sets the configurations for latent fault test.
Definition: rl_device.c:1515
rlReturnVal_t rlDriverConfigureCrc(rlCrcType_t crcType)
Configures the CRC Type in mmwavelink Driver.
Definition: rl_driver.c:2812
mmWaveLink firmware version structure
Definition: mmwavelink.h:2443
rlReturnVal_t rlDeviceGetMmWaveLinkVersion(rlSwVersionParam_t *data)
Get mmWaveLink Version.
Definition: rl_device.c:551
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:3012
rlReturnVal_t rlDeviceSetTestPatternConfig(rlUInt8_t deviceMap, rltestPattern_t *data)
Setup for test pattern to be generated.
Definition: rl_device.c:1608
rlReturnVal_t rlDeviceSetDataPathClkConfig(rlUInt8_t deviceMap, rlDevDataPathClkCfg_t *data)
Sets LVDS Clock Configuration.
Definition: rl_device.c:885
Structure used for filling chirp LUT parameter buffer for Advanced chirp configuration....
Definition: rl_device.h:1220
rlReturnVal_t rlDeviceSetContStreamingModeConfig(rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t *data)
Sets Continous Streaming Mode Configuration.
Definition: rl_device.c:1077
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:2302
rlDevDataPathCfg_t * dataPath
Data path config.
Definition: rl_device.h:1047
mmwave radar data path config.
Definition: rl_device.h:657
rlReturnVal_t rlDeviceSetHsiClk(rlUInt8_t deviceMap, rlDevHsiClk_t *data)
Sets High Speed Interface Clock.
Definition: rl_device.c:1372
Continous streaming mode configuration.
Definition: rl_device.h:925
rlReturnVal_t rlDeviceEnablePeriodicTests(rlUInt8_t deviceMap, rlperiodicTest_t *data)
Sets the configurations for periodic test.
Definition: rl_device.c:1561
rlFwVersionParam_t master
Master Sub System version.
Definition: mmwavelink.h:2664
mmwave radar high speed Data path configuraiton
Definition: rl_device.h:1038
DataPath clock configuration.
Definition: rl_device.h:835
mmwave radar high speed clock configuration
Definition: rl_device.h:1017
CSI2 delay dummy structure.
Definition: rl_device.h:1137
mmwave radar device latent fault test
Definition: rl_device.h:320
rlUInt8_t minor
SW version minor number.
Definition: mmwavelink.h:2595
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:2977
mmwave radar device config
Definition: rl_device.h:1057
rlReturnVal_t rlDeviceGetRfVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
Get mmWave RF ROM and patch version.
Definition: rl_device.c:462
mmwave radar Driver Global Structure
Definition: rl_driver.h:235
LVDS Lane configuration.
Definition: rl_device.h:883
rlReturnVal_t rlDeviceGetMssVersion(rlUInt8_t deviceMap, rlFwVersionParam_t *data)
Get mmWave Master SS version.
Definition: rl_device.c:425
rlUInt8_t isDriverInitialized
Driver Status.
Definition: rl_driver.h:244
rlUInt16_t chirpParamIndex
Chirp Parameter Index Valid range: 0 to 9 .
Definition: rl_device.h:1226
rlUInt16_t nsbc
Number of Sub Blocks in Payload.
Definition: rl_driver.h:343
rlSwVersionParam_t mmWaveLink
mmWaveLink version
Definition: mmwavelink.h:2672
Frame config API parameters.
Definition: rl_sensor.h:1246
rlUInt8_t month
Software Release Month.
Definition: mmwavelink.h:2611
rlReturnVal_t rlDeviceFileDownload(rlUInt8_t deviceMap, rlFileData_t *data, rlUInt16_t remChunks)
Download mmwave Firmware/Patches over SPI.
Definition: rl_device.c:365
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:3076
mmwave radar test pattern config
Definition: rl_device.h:456
rlReturnVal_t rlDriverSetRetryCount(rlUInt8_t retryCnt)
: Set the retry count for re-sending command
Definition: rl_driver.c:3174
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:1703
CSI2 configuration.
Definition: rl_device.h:940
rlDevDataPathClkCfg_t * dataPathClk
Data path clock configuration.
Definition: rl_device.h:1051
rlReturnVal_t rlDriverDeInit(void)
De Initializes the mmwave radar Driver.
Definition: rl_driver.c:2219
rlDriverData_t * rlDriverGetHandle(void)
Returns mmwave radar Driver Global Structure.
Definition: rl_driver.c:2286
rlReturnVal_t rlDeviceConfigureAckTimeout(rlUInt32_t ackTimeout)
Configures the Acknowledgement timeout in mmWaveLink Driver.
Definition: rl_device.c:1915
rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t *data)
Sets Advance Frame data path Configuration.
Definition: rl_device.c:2081
rlUInt16_t inputSize
No of elements/data in the buffer .
Definition: rl_device.h:1235
mmwave radar data path lane enable
Definition: rl_device.h:807
Debug signals enable structure.
Definition: rl_device.h:1101
rlReturnVal_t rlDeviceSetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t *data)
Sets Lane enable Configuration.
Definition: rl_device.c:791
rlFwVersionParam_t rf
RF Sub System version.
Definition: mmwavelink.h:2668
rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t *data)
Sets Frame data path Configuration.
Definition: rl_device.c:2130
rlReturnVal_t rlDeviceGetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t *data)
Gets data path Configuration.
Definition: rl_device.c:744
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:1272
RHCP Payload Structure.
Definition: rl_driver.h:155
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:2684
mmwave radar periodicity test config
Definition: rl_device.h:406
rlReturnVal_t rlDeviceSetCsi2Config(rlUInt8_t deviceMap, rlDevCsi2Cfg_t *data)
Sets CSI2 data format Configuration.
Definition: rl_device.c:1176
rlUInt32_t chunkLen
File data length.
Definition: rl_device.h:90
mmwave radar data format config
Definition: rl_device.h:589
mmwave radar device MCU Clock output
Definition: rl_device.h:101
mmwave radar Driver Payload
Definition: rl_driver.h:349
mmwave radar device PMIC Clock output
Definition: rl_device.h:173
Structure to hold the MSS ESM Fault data structure for event RL_DEV_AE_MSS_ESMFAULT_SB.
Definition: mmwavelink.h:1703
rlReturnVal_t rlDeviceSetMiscConfig(rlUInt8_t deviceMap, rlDevMiscCfg_t *data)
Setup misc. device configurations.
Definition: rl_device.c:1655
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:3043
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:2846
rlUInt8_t major
SW version major number.
Definition: mmwavelink.h:2591
rlReturnVal_t rlDeviceGetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t *value)
Reads Internal Configuration Memory.
Definition: rl_device.c:2010
rlUInt16_t chirpParamSize
Chirp Parameter Size Mainly applicable for Start Frequency, Idle Time and ADC Start Time .
Definition: rl_device.h:1231
mmwavelink software version structure
Definition: mmwavelink.h:2585
rlReturnVal_t rlDeviceSetCsi2DelayDummyConfig(rlUInt8_t deviceMap, rlCsi2DelayDummyCfg_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:1761
rlReturnVal_t rlDriverRemoveDevices(rlUInt8_t deviceMap)
Disconnects the mmwave radar devices.
Definition: rl_driver.c:2174
rlReturnVal_t rlDeviceGetEsmFault(rlUInt8_t deviceMap, rlMssEsmFault_t *data)
Get MasterSS ESM fault status.
Definition: rl_device.c:1854
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:2273
Radar Internal configuration.
Definition: rl_device.h:1210
rlInt32_t(* rlDeviceDisable)(rlUInt8_t deviceIndex)
Power off mmWave radar device.
Definition: mmwavelink.h:1362
rlUInt16_t fData[RL_CMD_PL_LEN_MAX/2U]
File data buffer.
Definition: rl_device.h:94
mmwavelink version structure
Definition: mmwavelink.h:2659
rlClientCbs_t clientCtx
Client context.
Definition: rl_driver.h:288
rlReturnVal_t rlDeviceSetDataPathConfig(rlUInt8_t deviceMap, rlDevDataPathCfg_t *data)
Sets LVDS/CSI2 Path Configuration.
Definition: rl_device.c:697
rlReturnVal_t rlDeviceGetContStreamingModeConfig(rlUInt8_t deviceMap, rlDevContStreamingModeCfg_t *data)
Gets continuous Streaming Mode Configuration.
Definition: rl_device.c:1129
rlDeviceCtrlCbs_t devCtrlCb
Device Control Callback.
Definition: mmwavelink.h:1490
rlUInt8_t debug
SW version debug number.
Definition: mmwavelink.h:2603
rlReturnVal_t rlDriverAddDevice(rlUInt8_t deviceMap)
Adds mmwave radar device.
Definition: rl_driver.c:2081
rlReturnVal_t rlDeviceGetDataFmtConfig(rlUInt8_t deviceMap, rlDevDataFmtCfg_t *data)
Gets LVDS/CSI2 Data output format.
Definition: rl_device.c:651
Advance Frame data config API parameters. This structure is only applicable when mmWaveLink instance ...
Definition: rl_sensor.h:1334
rlReturnVal_t rlDeviceConfigureCrc(rlCrcType_t crcType)
Configures the CRC Type in mmWaveLink Driver.
Definition: rl_device.c:1898
rlUInt8_t deviceMap
Bitmap of devices connected radarSS/DSS Mailbox in case of 16xx autonomous.
Definition: rl_driver.h:248
rlReturnVal_t rlDeviceSetRetryCount(rlUInt8_t retryCnt)
: Set the command retry count
Definition: rl_device.c:1933
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:2188
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:2607
rlReturnVal_t rlDeviceGetLaneConfig(rlUInt8_t deviceMap, rlDevLaneEnable_t *data)
Gets Lane enable Configuration.
Definition: rl_device.c:838
rlDevDataFmtCfg_t * datafmt
Data format config.
Definition: rl_device.h:1043
rlUInt8_t day
Software Release Day.
Definition: mmwavelink.h:2615
rlUInt8_t build
SW version buid number.
Definition: mmwavelink.h:2599
rlReturnVal_t rlDeviceSetInternalConf(rlUInt8_t deviceMap, rlUInt32_t memAddr, rlUInt32_t value)
Writes Internal Configuration Memory.
Definition: rl_device.c:1956
rlReturnVal_t rlDeviceGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
Get MasterSS CPU fault status.
Definition: rl_device.c:1807
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:3132
rlReturnVal_t rlDeviceGetVersion(rlUInt8_t deviceMap, rlVersion_t *data)
Get mmWave Hardware, Firmware/patch and mmWaveLink version.
Definition: rl_device.c:494
rlReturnVal_t rlDriverIsDeviceMapValid(rlUInt8_t deviceMap)
Checks if given deviecMap is valid wrt to global DeviceMap set to mmWaveLink.
Definition: rl_driver.c:2339

Copyright 2020, Texas Instruments Incorporated