rl_sensor.c
1 /****************************************************************************************
2  * FileName : rl_sensor.c
3  *
4  * Description : This file defines the functions to configure RF/Sensor in 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-540 Advance Frame APIs
46  *
47  * 0.6.0 15Nov2016 Kaushal Kukkar MMWSDK-206 Dynamic Power Save API
48  * Kaushal Kukkar AUTORADAR-571 Cascade Feature Support
49  *
50  * 0.7.0 11May2017 Jitendra Gupta MMWSDK-450 Calibration Config/Report APIs
51  * Jitendra Gupta MMWSDK-322 PS/PA/IF Loopback APIs
52  *
53  * 0.8.6 24Jul2017 Jitendra Gupta MMWL-30 RF/Analog Monitoring APIs
54  * Kaushal Kukkar MMWL-23 Big Endian Support
55  *
56  * 0.9.1 - Jitendra Gupta MMWL-5 Code size optimization
57  ****************************************************************************************
58  */
59 /******************************************************************************
60  * INCLUDE FILES
61  ******************************************************************************
62  */
63 #include <stdlib.h>
64 #include <string.h>
65 #include <ti/control/mmwavelink/mmwavelink.h>
66 #include <ti/control/mmwavelink/include/rl_driver.h>
67 #include <ti/control/mmwavelink/include/rl_messages.h>
68 #include <ti/control/mmwavelink/include/rl_controller.h>
69 #include <ti/control/mmwavelink/include/rl_sensor.h>
70 #include <ti/control/mmwavelink/include/rl_trace.h>
71 
72 
73 /******************************************************************************
74  * GLOBAL VARIABLES/DATA-TYPES DEFINITIONS
75  ******************************************************************************
76  */
77 
78 /******************************************************************************
79  * FUNCTION DEFINITIONS
80  ******************************************************************************
81  */
82 
104 /* DesignId : MMWL_DesignId_009 */
105 /* Requirements : AUTORADAR_REQ-752, AUTORADAR_REQ-757, AUTORADAR_REQ-970 */
106 rlReturnVal_t rlSetChannelConfig(rlUInt8_t deviceMap, rlChanCfg_t* data)
107 {
108  rlReturnVal_t retVal;
109 
110  /* check if deviceIndex is out of defined value */
111  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
112  {
113  /* set return error code */
114  retVal = RL_RET_CODE_INVALID_INPUT;
115  }
116  else
117  {
118  /* Package the command with given data and send it to device */
119  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
120  RL_RF_CHAN_CONF_SB, (rlUInt8_t*)data,
121  (rlUInt16_t)sizeof(rlChanCfg_t));
122  }
123 
124  RL_LOGV_ARG0("rlSetChannelConfig ends...\n");
125  return retVal;
126 
127 }
128 
149 /* DesignId : MMWL_DesignId_010 */
150 /* Requirements : AUTORADAR_REQ-753, AUTORADAR_REQ-754 */
151 rlReturnVal_t rlSetAdcOutConfig(rlUInt8_t deviceMap, rlAdcOutCfg_t* data)
152 {
153  rlReturnVal_t retVal;
154 
155  RL_LOGV_ARG0("rlSetAdcOutConfig starts...\n");
156 
157  /* check if deviceIndex is out of defined value */
158  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
159  (RL_NULL_PTR == data))
160  {
161  /* set return error code */
162  retVal = RL_RET_CODE_INVALID_INPUT;
163  RL_LOGE_ARG0("rlSetAdcOutConfig, Invalid device map\n");
164  }
165  else
166  {
167  /* Package the command with given data and send it to device */
168  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
169  RL_RF_ADCOUT_CONF_SB, (rlUInt8_t*)data,
170  (rlUInt16_t)sizeof(rlAdcOutCfg_t));
171  }
172 
173  RL_LOGV_ARG0("rlSetAdcOutConfig ends...\n");
174 
175  return retVal;
176 }
177 
194 /* DesignId : MMWL_DesignId_016 */
195 /* Requirements : AUTORADAR_REQ-724 */
196 rlReturnVal_t rlSetBpmCommonConfig(rlUInt8_t deviceMap, rlBpmCommonCfg_t* data)
197 {
198  rlReturnVal_t retVal;
199 
200  RL_LOGV_ARG0("rlSetBpmCommonConfig starts...\n");
201 
202  /* check if deviceIndex is out of defined value */
203  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
204  (RL_NULL_PTR == data))
205  {
206  /* set return error code */
207  retVal = RL_RET_CODE_INVALID_INPUT;
208  RL_LOGE_ARG0("rlSetBpmCommonConfig, Invalid device map\n");
209  }
210  else
211  {
212  /* Package the command with given data and send it to device */
213  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_ADVANCED_FEATURES_SET_MSG,
214  RL_RF_BPM_COMMON_CONF_SB, (rlUInt8_t*)data,
215  (rlUInt16_t)sizeof(rlBpmCommonCfg_t));
216  }
217  RL_LOGV_ARG0("rlSetBpmCommonConfig ends...\n");
218 
219  return retVal;
220 }
221 
235 /* DesignId : MMWL_DesignId_037 */
236 /* Requirements : AUTORADAR_REQ-727 */
237 rlReturnVal_t rlSetBpmChirpConfig(rlUInt8_t deviceMap, rlBpmChirpCfg_t* data)
238 {
239  rlReturnVal_t retVal;
240 
241  RL_LOGV_ARG0("rlSetBpmChirpConfig starts...\n");
242 
243  /* check if deviceIndex is out of defined value */
244  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
245  (RL_NULL_PTR == data))
246  {
247  /* set return error code */
248  retVal = RL_RET_CODE_INVALID_INPUT;
249  RL_LOGE_ARG0("rlSetBpmChirpConfig, Invalid device map\n");
250  }
251  else
252  {
253  /* Package the command with given data and send it to device */
254  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_ADVANCED_FEATURES_SET_MSG,
255  RL_RF_BPM_CHIRP_CONF_SB, (rlUInt8_t*)data,
256  (rlUInt16_t)sizeof(rlBpmChirpCfg_t));
257  }
258 
259  RL_LOGV_ARG0("rlSetBpmChirpConfig ends...\n");
260 
261  return retVal;
262 }
263 
278 /* DesignId : MMWL_DesignId_122 */
279 /* Requirements : AUTORADAR_REQ-727 */
280 rlReturnVal_t rlSetMultiBpmChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
281  rlBpmChirpCfg_t** data)
282 {
283  rlReturnVal_t retVal;
284  RL_LOGV_ARG0("rlSetMultiBpmChirpConfig starts...\n");
285 
286  /* check if deviceIndex is out of defined value */
287  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
288  (cnt == 0U))
289  {
290  /* set return error code */
291  retVal = RL_RET_CODE_INVALID_INPUT;
292  }
293  else
294  {
295  /* Initialize Command and Response Sub Blocks */
296  rlDriverMsg_t inMsg;
297  rlDriverMsg_t outMsg = {0};
298 
299  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
300  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
301 
302 
303  /* Initialize Command and Response Sub Blocks */
304  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlBpmChirpCfg_t) + \
305  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
306 
307  /* single sub-block length for chirp config API */
308  sbLen = (rlUInt16_t)(sizeof(rlBpmChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
309 
310  /* get Max Sub Block count */
311  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
312  /*LDRA_INSPECTED 127 D */
313  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
314 
315  retVal = RL_RET_CODE_OK;
316  /* if requested count of chirpConfig is within one Message packet */
317  if (cnt <= maxSbCntInMsg)
318  {
319  sbCntInMsg = cnt;
320  numChnkOfMsg = 1U;
321  lastSbCntInMsg = 0U;
322  }
323  else
324  {
325  sbCntInMsg = maxSbCntInMsg;
326  numChnkOfMsg = cnt / maxSbCntInMsg;
327  lastSbCntInMsg = cnt % maxSbCntInMsg;
328  }
329 
330  /* Fill in-message packet */
331  rlDriverConstructInMsg(RL_RF_ADVANCED_FEATURES_SET_MSG, &inMsg, &inPayloadSb[0]);
332 
333  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
334 
335  while (retVal == RL_RET_CODE_OK)
336  {
337  /* all full messages have been sent, then send last partial message */
338  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
339  {
340  inMsg.opcode.nsbc = lastSbCntInMsg;
341  }
342  else
343  {
344  inMsg.opcode.nsbc = sbCntInMsg;
345  }
346 
347  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
348  {
349  /* Set Command Sub Block*/
350  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
351  LDRA Tool Issue" */
352  /*LDRA_INSPECTED 105 D */
353  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_ADVANCED_FEATURES_SET_MSG,
354  RL_RF_BPM_CHIRP_CONF_SB);
355  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
356  LDRA Tool Issue" */
357  /*LDRA_INSPECTED 105 D */
358  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlBpmChirpCfg_t);
359  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
360  LDRA Tool Issue" */
361  /*LDRA_INSPECTED 105 D */
362  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
363 
364  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
365  next profile Config */
366  /*LDRA_INSPECTED 567 S */
367  data++;
368  }
369  /* Send Command to mmWave Radar Device */
370  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
371  loopCnt--;
372 
373  if (loopCnt == 0U)
374  {
375  break;
376  }
377  }
378  }
379  RL_LOGV_ARG0("rlSetMultiBpmChirpConfig ends...\n");
380 
381  return retVal;
382 }
383 
422 /* DesignId : MMWL_DesignId_013 */
423 /* Requirements : AUTORADAR_REQ-728, AUTORADAR_REQ-729, AUTORADAR_REQ-730, AUTORADAR_REQ-731,
424  AUTORADAR_REQ-732, AUTORADAR_REQ-733, AUTORADAR_REQ-734, AUTORADAR_REQ-735,
425  AUTORADAR_REQ-736, AUTORADAR_REQ-737, AUTORADAR_REQ-738, AUTORADAR_REQ-739,
426  AUTORADAR_REQ-740, AUTORADAR_REQ-741, AUTORADAR_REQ-742, AUTORADAR_REQ-743,
427  AUTORADAR_REQ-773
428  */
429 rlReturnVal_t rlSetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
430  rlProfileCfg_t* data)
431 {
432  rlReturnVal_t retVal;
433 
434  RL_LOGV_ARG0("rlSetProfileConfig starts...\n");
435 
436  /* check if deviceIndex is out of defined value */
437  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
438  (RL_NULL_PTR == data) || (cnt == 0U))
439  {
440  /* set return error code */
441  retVal = RL_RET_CODE_INVALID_INPUT;
442  RL_LOGE_ARG0("rlSetProfileConfig, Invalid device map\n");
443  }
444  else
445  {
446  rlDriverMsg_t inMsg = {0};
447  rlDriverMsg_t outMsg = {0};
448 
449  /* Initialize Command and Response Sub Blocks */
450  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlProfileCfg_t) + \
451  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
452  /* Variable to count message chunks */
453  rlUInt16_t indx;
454  rlUInt16_t sbCntInAllChunk = 0U;
455  rlUInt16_t maxSbInMsg = (RL_CMD_PL_LEN_MAX /(sizeof(rlProfileCfg_t) + \
456  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE));
457 
458  /* Construct command packet */
459  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
460 
461  retVal = RL_RET_CODE_OK;
462  /* Loop to copy all the command data to one message */
463  for (indx = 0U; (indx < cnt) && (retVal == RL_RET_CODE_OK); indx++)
464  {
465  /* Fill in-message payload */
466  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
467  next profile Config */
468  /*AR_CODE_REVIEW MR:R.18.4 <APPROVED> "require pointer increment to jump to
469  next profile Config */
470  /*LDRA_INSPECTED 87 S */
471  /*LDRA_INSPECTED 567 S */
472  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_SET_MSG, RL_RF_PROFILE_CONF_SB,
473  &inPayloadSb[indx], (rlUInt8_t*)(data + indx),
474  (rlUInt16_t)sizeof(rlProfileCfg_t));
475 
476  /* increment Sub-block count in one packet */
477  sbCntInAllChunk++;
478 
479  /* check if total payload length is going beyond defined limitation */
480  if ((maxSbInMsg == (indx + 1U)) || (cnt == sbCntInAllChunk))
481  {
482  /* setting of numSBC to inMsg */
483  inMsg.opcode.nsbc = (indx + 1U);
484  /* Send Command to mmWave Radar Device */
485  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
486  }
487  }
488  }
489 
490  RL_LOGV_ARG0("rlSetProfileConfig ends...\n");
491 
492  return retVal;
493 }
494 
508 /* DesignId : MMWL_DesignId_118 */
509 /* Requirements : AUTORADAR_REQ-728, AUTORADAR_REQ-729, AUTORADAR_REQ-730, AUTORADAR_REQ-731,
510 AUTORADAR_REQ-732, AUTORADAR_REQ-733, AUTORADAR_REQ-734, AUTORADAR_REQ-735,
511 AUTORADAR_REQ-736, AUTORADAR_REQ-737, AUTORADAR_REQ-738, AUTORADAR_REQ-739,
512 AUTORADAR_REQ-740, AUTORADAR_REQ-741, AUTORADAR_REQ-742, AUTORADAR_REQ-743,
513 AUTORADAR_REQ-773
514 */
515 rlReturnVal_t rlGetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t profileId, rlProfileCfg_t* data)
516 {
517  rlReturnVal_t retVal;
518 
519  RL_LOGV_ARG0("rlGetProfileConfig ends...\n");
520 
521  /* check if deviceIndex is out of defined value */
522  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
523  (RL_NULL_PTR == data))
524  {
525  /* set return error code */
526  retVal = RL_RET_CODE_INVALID_INPUT;
527  RL_LOGE_ARG0("rlGetProfileConfig, Invalid device map\n");
528  }
529  else
530  {
531  /* Initialize Command and Response Sub Blocks */
532  rlDriverMsg_t inMsg = {0};
533  rlDriverMsg_t outMsg = {0};
534  rlPayloadSb_t inPayloadSb = {0};
535  rlPayloadSb_t outPayloadSb = {0};
536  rlWordParam_t wordParam;
537  /* combine half words into WORD structure */
538  wordParam.halfWordOne = profileId;
539  wordParam.halfWordTwo = 0U;
540 
541  /* Construct command packet */
542  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
543  /* Fill in-message Payload */
544  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_PROFILE_CONF_SB, &inPayloadSb,
545  (rlUInt8_t*)&wordParam, (rlUInt16_t)sizeof(rlWordParam_t));
546 
547  /* Construct response packet */
548  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
549  /* Fill in-message Payload */
550  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)data, 0U);
551 
552  /* Send Command to mmWave Radar Device */
553  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
554  }
555 
556  RL_LOGV_ARG0("rlGetProfileConfig ends...\n");
557  return retVal;
558 }
559 
584 /* DesignId : MMWL_DesignId_014 */
585 /* Requirements : AUTORADAR_REQ-744, AUTORADAR_REQ-745, AUTORADAR_REQ-746, AUTORADAR_REQ-747,
586  AUTORADAR_REQ-748, AUTORADAR_REQ-749, AUTORADAR_REQ-750, AUTORADAR_REQ-751,
587  AUTORADAR_REQ-773
588  */
589 rlReturnVal_t rlSetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t* data)
590 {
591  rlReturnVal_t retVal;
592 
593  RL_LOGV_ARG0("rlSetChirpConfig starts...\n");
594 
595  /* check if deviceIndex is out of defined value */
596  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
597  (RL_NULL_PTR == data) || (cnt == 0U))
598  {
599  /* set return error code */
600  retVal = RL_RET_CODE_INVALID_INPUT;
601  }
602  else
603  {
604  /* Initialize Command and Response Sub Blocks */
605  rlDriverMsg_t inMsg;
606  rlDriverMsg_t outMsg = {0};
607  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
608  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
609 
610  /* Initialize Command and Response Sub Blocks */
611  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlChirpCfg_t) + \
612  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
613 
614  /* single sub-block length for chirp config API */
615  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
616 
617  /* get Max Sub Block count */
618  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
619  /*LDRA_INSPECTED 127 D */
620  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
621 
622  retVal = RL_RET_CODE_OK;
623  /* if requested count of chirpConfig is within one Message packet */
624  if (cnt <= maxSbCntInMsg)
625  {
626  sbCntInMsg = cnt;
627  numChnkOfMsg = 1U;
628  lastSbCntInMsg = 0U;
629  }
630  else
631  {
632  sbCntInMsg = maxSbCntInMsg;
633  numChnkOfMsg = cnt / maxSbCntInMsg;
634  lastSbCntInMsg = cnt % maxSbCntInMsg;
635  }
636 
637  /* Fill in-message packet */
638  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
639  /* get the loop count in form of number of msg chunks */
640  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
641 
642  while (retVal == RL_RET_CODE_OK)
643  {
644  /* all full messages have been sent, then send last partial message */
645  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
646  {
647  inMsg.opcode.nsbc = lastSbCntInMsg;
648  }
649  else
650  {
651  inMsg.opcode.nsbc = sbCntInMsg;
652  }
653 
654  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
655  {
656  /* Set Command Sub Block*/
657  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
658  LDRA Tool Issue" */
659  /*LDRA_INSPECTED 105 D */
660  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
661  RL_RF_CHIRP_CONF_SB);
662  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
663  LDRA Tool Issue" */
664  /*LDRA_INSPECTED 105 D */
665  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlChirpCfg_t);
666  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
667  LDRA Tool Issue" */
668  /*LDRA_INSPECTED 105 D */
669  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(data);
670  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
671  next chirp Config */
672  /*LDRA_INSPECTED 567 S */
673  data++;
674  }
675  /* Send Command to mmWave Radar Device */
676  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
677  LDRA Tool Issue" */
678  /*LDRA_INSPECTED 105 D */
679  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
680  /* decrement the loop count */
681  loopCnt--;
682  /* if all chirp configurations have been sent to device then terminate the loop */
683  if (loopCnt == 0U)
684  {
685  break;
686  }
687  }
688  }
689 
690  RL_LOGV_ARG0("rlSetChirpConfig ends...\n");
691 
692  return retVal;
693 }
694 
708 /* DesignId : MMWL_DesignId_119 */
709 /* Requirements : AUTORADAR_REQ-744, AUTORADAR_REQ-745, AUTORADAR_REQ-746, AUTORADAR_REQ-747,
710 AUTORADAR_REQ-748, AUTORADAR_REQ-749, AUTORADAR_REQ-750, AUTORADAR_REQ-751,
711 AUTORADAR_REQ-773
712 */
713 rlReturnVal_t rlGetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t chirpStartIdx,
714  rlUInt16_t chirpEndIdx, rlChirpCfg_t* data)
715 {
716  rlReturnVal_t retVal;
717  rlChirpCfg_t *chirpCfgData = data;
718 
719  RL_LOGV_ARG0("rlGetChirpConfig starts...\n");
720 
721  /* check if deviceIndex is out of defined value */
722  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
723  (RL_NULL_PTR == chirpCfgData))
724  {
725  /* set return error code */
726  retVal = RL_RET_CODE_INVALID_INPUT;
727  RL_LOGE_ARG0("rlGetChirpConfig, Invalid device map\n");
728  }
729  else
730  {
731  /* Initialize Command and Response Sub Blocks */
732  rlDriverMsg_t inMsg = {0};
733  rlDriverMsg_t outMsg = {0};
734  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
735  rlUInt16_t sbLen, maxSbCntOutMsg, sbCntOutMsg, numChnkOfMsg, lastSbCntOutMsg, loopCnt;
736 
737  /* file chirp start and end index */
738  rlWordParam_t wordParam;
739 
740  rlPayloadSb_t inPayloadSb = {0};
741  rlPayloadSb_t outPayloadSb;
742 
743  /* single sub-block length for chirp config API */
744  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t));
745 
746  /* get Max Sub Block count */
747  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
748  /*LDRA_INSPECTED 127 D */
749  maxSbCntOutMsg = (RL_CMD_PL_LEN_MAX -(RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE)) /sbLen;
750 
751  retVal = RL_RET_CODE_OK;
752  /* if requested count of chirpConfig is within one Message packet */
753  if ((chirpEndIdx - chirpStartIdx + 1U) <= maxSbCntOutMsg)
754  {
755  sbCntOutMsg = (chirpEndIdx - chirpStartIdx + 1U);
756  numChnkOfMsg = 0U;
757  lastSbCntOutMsg = 0U;
758  }
759  else
760  {
761  sbCntOutMsg = maxSbCntOutMsg;
762  numChnkOfMsg = (chirpEndIdx - chirpStartIdx + 1U) / maxSbCntOutMsg;
763  lastSbCntOutMsg = (chirpEndIdx - chirpStartIdx + 1U) % maxSbCntOutMsg;
764  }
765  /* set chirp start index to inMsg field */
766  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "required to intial with startIdx" */
767  /*LDRA_INSPECTED 8 D */
768  wordParam.halfWordTwo = chirpStartIdx;
769 
770  /* get the loop count in form of number of msg chunks */
771  loopCnt = numChnkOfMsg + 1U;
772  /* setting num of sub-block to one in outMsg */
773  outMsg.opcode.nsbc = 1U;
774 
775  while (retVal == RL_RET_CODE_OK)
776  {
777  /* combine half words into WORD structure */
778  wordParam.halfWordOne = wordParam.halfWordTwo;
779  /* all full messages have been sent, then send last partial message */
780  if ((loopCnt == 1U) && (lastSbCntOutMsg != 0U))
781  {
782  wordParam.halfWordTwo = wordParam.halfWordOne + (lastSbCntOutMsg - 1U);
783  }
784  else
785  {
786  wordParam.halfWordTwo = wordParam.halfWordOne + (sbCntOutMsg - 1U);
787  }
788 
789  /* Construct command packet */
790  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
791  /* Fill in-message Payload */
792  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_CHIRP_CONF_SB, &inPayloadSb,
793  (rlUInt8_t*)&wordParam, (rlUInt16_t)sizeof(rlWordParam_t));
794 
795  /* Set Command Sub Block*/
796  outPayloadSb.sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_GET_MSG,
797  RL_RF_CHIRP_CONF_SB);
798  outPayloadSb.len = (rlUInt16_t)sizeof(rlChirpCfg_t);
799  outPayloadSb.pSblkData = (rlUInt8_t*)(chirpCfgData);
800 
801  /* Construct response packet */
802  rlDriverConstructOutMsg(outMsg.opcode.nsbc, &outMsg, &outPayloadSb);
803 
804  /* Send Command to mmWave Radar Device */
805  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
806 
807  /* increment data pointer for next chunk of reponse */
808  chirpCfgData += sbCntOutMsg;
809 
810  /* decrement the loop count */
811  loopCnt--;
812  wordParam.halfWordTwo++;
813  /* if all chirp configurations have been sent to device then terminate the loop */
814  if (loopCnt == 0U)
815  {
816  break;
817  }
818  }
819  }
820 
821  RL_LOGV_ARG0("rlGetChirpConfig ends...\n");
822 
823  return retVal;
824 }
825 
826 
851 rlReturnVal_t rlSetMultiChirpCfg(rlUInt8_t deviceMap, rlUInt16_t cnt,
852  rlChirpCfg_t **data)
853 {
854  rlReturnVal_t retVal;
855  RL_LOGV_ARG0("rlSetMultiChirpCfg starts...\n");
856 
857  /* check if deviceIndex is out of defined value */
858  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
859  (cnt == 0U))
860  {
861  /* set return error code */
862  retVal = RL_RET_CODE_INVALID_INPUT;
863  }
864  else
865  {
866  /* Initialize Command and Response Sub Blocks */
867  rlDriverMsg_t inMsg;
868  rlDriverMsg_t outMsg = {0};
869 
870  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
871  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
872 
873 
874  /* Initialize Command and Response Sub Blocks */
875  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlChirpCfg_t) + \
876  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
877 
878  /* single sub-block length for chirp config API */
879  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
880 
881 
882  /* get Max Sub Block count */
883  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
884  /*LDRA_INSPECTED 127 D */
885  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
886 
887  retVal = RL_RET_CODE_OK;
888  /* if requested count of chirpConfig is within one Message packet */
889  if (cnt <= maxSbCntInMsg)
890  {
891  sbCntInMsg = cnt;
892  numChnkOfMsg = 1U;
893  lastSbCntInMsg = 0U;
894  }
895  else
896  {
897  sbCntInMsg = maxSbCntInMsg;
898  numChnkOfMsg = cnt / maxSbCntInMsg;
899  lastSbCntInMsg = cnt % maxSbCntInMsg;
900  }
901 
902  /* Fill in-message packet */
903  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
904 
905  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
906 
907  while (retVal == RL_RET_CODE_OK)
908  {
909  /* all full messages have been sent, then send last partial message */
910  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
911  {
912  inMsg.opcode.nsbc = lastSbCntInMsg;
913  }
914  else
915  {
916  inMsg.opcode.nsbc = sbCntInMsg;
917  }
918 
919  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
920  {
921  /* Set Command Sub Block*/
922  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
923  LDRA Tool Issue" */
924  /*LDRA_INSPECTED 105 D */
925  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
926  RL_RF_CHIRP_CONF_SB);
927  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
928  LDRA Tool Issue" */
929  /*LDRA_INSPECTED 105 D */
930  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlChirpCfg_t);
931  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
932  LDRA Tool Issue" */
933  /*LDRA_INSPECTED 105 D */
934  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
935 
936  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
937  next profile Config */
938  /*LDRA_INSPECTED 567 S */
939  data++;
940  }
941  /* Send Command to mmWave Radar Device */
942  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
943  loopCnt--;
944 
945  if (loopCnt == 0U)
946  {
947  break;
948  }
949  }
950  }
951  RL_LOGV_ARG0("rlSetMultiChirpCfg ends...\n");
952  return retVal;
953 }
954 
1004 /* DesignId : MMWL_DesignId_015 */
1005 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
1006  AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
1007 rlReturnVal_t rlSetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t* data)
1008 {
1009  rlReturnVal_t retVal;
1010 
1011  RL_LOGV_ARG0("rlSetFrameConfig starts...\n");
1012 
1013  /* check if deviceIndex is out of defined value */
1014  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1015  (RL_NULL_PTR == data))
1016  {
1017  /* set return error code */
1018  retVal = RL_RET_CODE_INVALID_INPUT;
1019  RL_LOGE_ARG0("rlSetFrameConfig, Invalid device map\n");
1020  }
1021  else
1022  {
1023  /* Package the command with given data and send it to device */
1024  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1025  RL_RF_FRAME_CONF_SB, (rlUInt8_t*)data,
1026  (rlUInt16_t)sizeof(rlFrameCfg_t));
1027 
1028  /* If only mmWaveLink instance is running on Host */
1029  if ((retVal == RL_RET_CODE_OK) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1030  {
1031  rlFrameApplyCfg_t frameApplyCfgArgs;
1032  rlUInt32_t tempVar;
1033  frameApplyCfgArgs.reserved = 0U;
1034  frameApplyCfgArgs.numAdcSamples = (data->numAdcSamples);
1035  /*AR_CODE_REVIEW MR:R.10.8 <APPROVED> "Conversion required for RL_SWAP_32 operation"*/
1036  /*LDRA_INSPECTED 332 S */
1037  tempVar = (rlUInt32_t)(((data->chirpEndIdx - data->chirpStartIdx) + 1U) *
1038  data->numLoops);
1039 #ifndef MMWL_BIG_ENDIAN
1040  frameApplyCfgArgs.numChirps = tempVar;
1041 #else
1042  frameApplyCfgArgs.numChirps = RL_SWAP_32(tempVar);
1043 #endif
1044  retVal += rlDeviceFrameConfigApply(deviceMap, &frameApplyCfgArgs);
1045  }
1046  }
1047 
1048  RL_LOGV_ARG0("rlSetFrameConfig ends...\n");
1049 
1050  return retVal;
1051 }
1052 
1064 /* DesignId : MMWL_DesignId_120 */
1065 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
1066 AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
1067 rlReturnVal_t rlGetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t* data)
1068 {
1069  rlReturnVal_t retVal;
1070 
1071  RL_LOGV_ARG0("rlGetFrameConfig starts...\n");
1072 
1073  /* check if deviceIndex is out of defined value */
1074  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1075  (RL_NULL_PTR == data))
1076  {
1077  /* set return error code */
1078  retVal = RL_RET_CODE_INVALID_INPUT;
1079  RL_LOGE_ARG0("rlGetFrameConfig, Invalid device map\n");
1080  }
1081  else
1082  {
1083  /* Package the command with given data and send it to device */
1084  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_DYNAMIC_CONF_GET_MSG,
1085  RL_RF_FRAME_CONF_SB, (rlUInt8_t*)data, 0U);
1086 
1087  /* If only mmWaveLink instance is running on Host */
1088  if ((retVal == RL_RET_CODE_OK) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1089  {
1090  /* Initialize Command and Response Sub Blocks */
1091  rlDriverMsg_t inMsg = {0};
1092  rlDriverMsg_t outMsg = {0};
1093  rlPayloadSb_t inPayloadSb = {0};
1094  rlPayloadSb_t outPayloadSb = {0};
1095  rlFrameApplyCfg_t frameApplyCfgArgs = {0};
1096 
1097  /* Construct command packet */
1098  rlDriverConstructInMsg(RL_DEV_STATUS_GET_MSG, &inMsg, &inPayloadSb);
1099  /* Fill in-message Payload */
1100  /*AR_CODE_REVIEW MR:R.11.2 <APPROVED> "Need to pass NULL pointer" */
1101  /*LDRA_INSPECTED 95 S */
1102  rlDriverFillPayload(RL_DEV_STATUS_GET_MSG, RL_SYS_FRAME_CONFIG_GET_SB,
1103  &inPayloadSb, (rlUInt8_t*)RL_NULL_PTR, 0x0U);
1104 
1105  /* Construct response packet */
1106  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
1107  /* Fill out-message Payload */
1108  rlDriverFillPayload(0U, 0U, &outPayloadSb,
1109  (rlUInt8_t*)&frameApplyCfgArgs, 0U);
1110 
1111  /* Send Command to mmWave Radar Device */
1112  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1113 #ifndef MMWL_BIG_ENDIAN
1114 
1115  /* update parameter received by Get Command */
1116  data->numAdcSamples = frameApplyCfgArgs.numAdcSamples;
1117 #else
1118  /* update parameter received by Get Command */
1119  data->numAdcSamples = RL_SWAP_32(frameApplyCfgArgs.numAdcSamples);
1120 #endif
1121  }
1122  }
1123 
1124  RL_LOGV_ARG0("rlGetFrameConfig ends...\n");
1125 
1126  return retVal;
1127 }
1128 
1176 /* DesignId : MMWL_DesignId_046 */
1177 /* Requirements : AUTORADAR_REQ-795 */
1178 rlReturnVal_t rlSetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t* data)
1179 {
1180  rlReturnVal_t retVal;
1181 
1182  RL_LOGV_ARG0("rlSetAdvFrameConfig starts...\n");
1183 
1184  /* check if deviceIndex is out of defined value */
1185  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1186  {
1187  /* set return error code */
1188  retVal = RL_RET_CODE_INVALID_INPUT;
1189  RL_LOGE_ARG0("rlSetAdvFrameConfig, Invalid device map\n");
1190  }
1191  else
1192  {
1193  /* Package the command with given data and send it to device */
1194  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1195  RL_RF_FRAME_CONF_ADVANCED_SB,
1196  (rlUInt8_t*)(&(data->frameSeq)),
1197  (rlUInt16_t)sizeof(rlAdvFrameSeqCfg_t));
1198 
1199  /* If only mmWaveLink instance is running on Host */
1200  if ((RL_RET_CODE_OK == retVal) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1201  {
1202  retVal += rlDeviceAdvFrameConfigApply(deviceMap, &(data->frameData));
1203  }
1204  }
1205 
1206  RL_LOGV_ARG0("rlSetAdvFrameConfig ends...\n");
1207 
1208  return retVal;
1209 }
1210 
1223 /* DesignId : MMWL_DesignId_047 */
1224 /* Requirements : AUTORADAR_REQ-796 */
1225 rlReturnVal_t rlGetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t* data)
1226 {
1227  rlReturnVal_t retVal;
1228 
1229  RL_LOGV_ARG0("rlGetAdvFrameConfig starts...\n");
1230 
1231  /* check if deviceIndex is out of defined value */
1232  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1233  (RL_NULL_PTR == data))
1234  {
1235  /* set return error code */
1236  retVal = RL_RET_CODE_INVALID_INPUT;
1237  RL_LOGE_ARG0("rlGetAdvFrameConfig, Invalid device map\n");
1238  }
1239  else
1240  {
1241  /* Package the command with given data and send it to device */
1242  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_DYNAMIC_CONF_GET_MSG,
1243  RL_RF_FRAME_CONF_ADVANCED_SB,
1244  (rlUInt8_t*)(&(data->frameSeq)), 0U);
1245 
1246  /* If only mmWaveLink instance is running on Host */
1247  if ((RL_RET_CODE_OK == retVal) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1248  {
1249  /* Initialize Command and Response Sub Blocks */
1250  rlDriverMsg_t inMsg = {0};
1251  rlDriverMsg_t outMsg = {0};
1252  rlPayloadSb_t inPayloadSb = {0};
1253  rlPayloadSb_t outPayloadSb = {0};
1254 
1255  /* Construct command packet */
1256  rlDriverConstructInMsg(RL_DEV_STATUS_GET_MSG, &inMsg, &inPayloadSb);
1257  /* Fill in-message Payload */
1258  /*AR_CODE_REVIEW MR:R.11.2 <APPROVED> "Need to pass NULL pointer" */
1259  /*LDRA_INSPECTED 95 S */
1260  rlDriverFillPayload(RL_DEV_STATUS_GET_MSG,
1261  RL_SYS_ADV_FRAME_CONFIG_GET_SB,
1262  &inPayloadSb, (rlUInt8_t*)RL_NULL_PTR, 0U);
1263 
1264  /* Construct response packet */
1265  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
1266  /* Fill out-message Payload */
1267  rlDriverFillPayload(0U, 0U, &outPayloadSb,
1268  (rlUInt8_t*)(&(data->frameData)), 0U);
1269 
1270  /* Send Command to mmWave Radar Device */
1271  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1272  }
1273  }
1274 
1275  RL_LOGV_ARG0("rlGetAdvFrameConfig ends...\n");
1276 
1277  return retVal;
1278 }
1279 
1295 /* DesignId : MMWL_DesignId_038 */
1296 /* Requirements : AUTORADAR_REQ-827 */
1297 rlReturnVal_t rlSetContModeConfig(rlUInt8_t deviceMap, rlContModeCfg_t* data)
1298 {
1299  rlReturnVal_t retVal;
1300 
1301  RL_LOGV_ARG0("rlSetContModeConfig starts...\n");
1302 
1303  /* check if deviceIndex is out of defined value */
1304  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1305  (RL_NULL_PTR == data))
1306  {
1307  /* set return error code */
1308  retVal = RL_RET_CODE_INVALID_INPUT;
1309  RL_LOGE_ARG0("rlSetContModeConfig, Invalid device map\n");
1310  }
1311  else
1312  {
1313  /* Package the command with given data and send it to device */
1314  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1315  RL_RF_CONT_STREAMING_MODE_CONF_SB,
1316  (rlUInt8_t*)data,
1317  (rlUInt16_t)sizeof(rlContModeCfg_t));
1318  }
1319  RL_LOGV_ARG0("rlSetContModeConfig ends...\n");
1320 
1321  return retVal;
1322 }
1323 
1334 /* DesignId : MMWL_DesignId_039 */
1335 /* Requirements : AUTORADAR_REQ-828 */
1336 rlReturnVal_t rlEnableContMode(rlUInt8_t deviceMap, rlContModeEn_t* data)
1337 {
1338  rlReturnVal_t retVal;
1339 
1340  RL_LOGV_ARG0("rlEnableContMode starts...\n");
1341 
1342  /* check if deviceIndex is out of defined value */
1343  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1344  (RL_NULL_PTR == data))
1345  {
1346  /* set return error code */
1347  retVal = RL_RET_CODE_INVALID_INPUT;
1348  RL_LOGE_ARG0("rlEnableContMode, Invalid device map\n");
1349  }
1350  else
1351  {
1352  /* Package the command with given data and send it to device */
1353  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1354  RL_RF_CONT_STREAMING_MODE_EN_SB,
1355  (rlUInt8_t*)data,
1356  (rlUInt16_t)sizeof(rlContModeEn_t));
1357  }
1358 
1359  RL_LOGV_ARG0("rlEnableContMode starts...\n");
1360 
1361  return retVal;
1362 }
1363 
1378 /* DesignId : MMWL_DesignId_011 */
1379 /* Requirements : AUTORADAR_REQ-755 */
1380 rlReturnVal_t rlSetLowPowerModeConfig(rlUInt8_t deviceMap, rlLowPowerModeCfg_t* data)
1381 {
1382  rlReturnVal_t retVal;
1383 
1384  RL_LOGV_ARG0("rlSetLowPowerModeConfig starts...\n");
1385 
1386  /* check if deviceIndex is out of defined value */
1387  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1388  {
1389  /* set return error code */
1390  retVal = RL_RET_CODE_INVALID_INPUT;
1391  RL_LOGE_ARG0("rlSetLowPowerModeConfig, Invalid device map\n");
1392  }
1393  else
1394  {
1395  /* Package the command with given data and send it to device */
1396  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1397  RL_RF_LOWPOWERMODE_CONF_SB,
1398  (rlUInt8_t*)data,
1399  (rlUInt16_t)sizeof(rlLowPowerModeCfg_t));
1400  }
1401 
1402  RL_LOGV_ARG0("rlSetLowPowerModeConfig ends...\n");
1403  return retVal;
1404 }
1405 
1422 /* DesignId : MMWL_DesignId_017 */
1423 /* Requirements : AUTORADAR_REQ-759 */
1424 rlReturnVal_t rlSensorStart(rlUInt8_t deviceMap)
1425 {
1426  rlReturnVal_t retVal;
1427 
1428  rlFrameTrigger_t frameTriggerArgs;
1429 
1430  RL_LOGV_ARG0("rlSensorStart starts...\n");
1431 
1432  frameTriggerArgs.startStop = RL_FRAME_TRIGGER_START;
1433  frameTriggerArgs.reserved = 0U;
1434 
1435  /* check if deviceIndex is out of defined value */
1436  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1437  {
1438  /* set return error code */
1439  retVal = RL_RET_CODE_INVALID_INPUT;
1440  RL_LOGE_ARG0("rlSensorStart, Invalid device map\n");
1441  }
1442  else
1443  {
1444  /* Package the command with given data and send it to device */
1445  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1446  RL_RF_FRAMESTARTSTOP_CONF_SB,
1447  (rlUInt8_t*)(&frameTriggerArgs),
1448  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1449  }
1450  RL_LOGV_ARG0("rlSensorStart ends...\n");
1451 
1452  return retVal;
1453 }
1454 
1475 /* DesignId : MMWL_DesignId_018 */
1476 /* Requirements : AUTORADAR_REQ-760 */
1477 rlReturnVal_t rlSensorStop(rlUInt8_t deviceMap)
1478 {
1479  rlReturnVal_t retVal;
1480 
1481  rlFrameTrigger_t frameTriggerArgs;
1482 
1483  frameTriggerArgs.startStop = RL_FRAME_TRIGGER_STOP;
1484  frameTriggerArgs.reserved = 0U;
1485 
1486  RL_LOGV_ARG0("rlSensorStop starts...\n");
1487 
1488  /* check if deviceIndex is out of defined value */
1489  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1490  {
1491  /* set return error code */
1492  retVal = RL_RET_CODE_INVALID_INPUT;
1493  RL_LOGE_ARG0("rlSensorStop, Invalid device map\n");
1494  }
1495  else
1496  {
1497  /* Package the command with given data and send it to device */
1498  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1499  RL_RF_FRAMESTARTSTOP_CONF_SB,
1500  (rlUInt8_t*)(&frameTriggerArgs),
1501  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1502  }
1503  RL_LOGV_ARG0("rlSensorStop ends...\n");
1504 
1505  return retVal;
1506 
1507 }
1508 
1534 /* DesignId : MMWL_DesignId_133 */
1535 /* Requirements : AUTORADAR_REQ-1059 */
1536 rlReturnVal_t rlFrameStartStop(rlUInt8_t deviceMap, rlFrameTrigger_t* data)
1537 {
1538  rlReturnVal_t retVal;
1539 
1540  RL_LOGV_ARG0("rlFrameStartStop starts...\n");
1541 
1542  /* check if deviceIndex is out of defined value */
1543  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1544  {
1545  /* set return error code */
1546  retVal = RL_RET_CODE_INVALID_INPUT;
1547  RL_LOGE_ARG0("rlFrameStartStop, Invalid device map\n");
1548  }
1549  else
1550  {
1551  /* Package the command with given data and send it to device */
1552  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1553  RL_RF_FRAMESTARTSTOP_CONF_SB,
1554  (rlUInt8_t*)data,
1555  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1556  }
1557  RL_LOGV_ARG0("rlFrameStartStop ends...\n");
1558 
1559  return retVal;
1560 }
1561 
1589 /* DesignId : MMWL_DesignId_012 */
1590 /* Requirements : AUTORADAR_REQ-758 */
1591 rlReturnVal_t rlRfInit(rlUInt8_t deviceMap)
1592 {
1593  /* Initialize Command and Response Sub Blocks */
1594  rlReturnVal_t retVal;
1595 
1596  RL_LOGV_ARG0("rlRfInit starts...\n");
1597 
1598  /* check if deviceIndex is out of defined value */
1599  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1600  {
1601  /* set return error code */
1602  retVal = RL_RET_CODE_INVALID_INPUT;
1603  RL_LOGE_ARG0("rlRfInit, Invalid device map\n");
1604  }
1605  else
1606  {
1607  /* Package the command with given data and send it to device */
1608  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_INIT_MSG, RL_RF_RF_INIT_SB, NULL, 0U);
1609  }
1610  RL_LOGV_ARG0("rlRfInit ends...\n");
1611 
1612  return retVal;
1613 }
1614 
1635 /* DesignId : MMWL_DesignId_035 */
1636 /* Requirements : AUTORADAR_REQ-790, AUTORADAR_REQ-1008 */
1637 rlReturnVal_t rlSetTestSourceConfig(rlUInt8_t deviceMap, rlTestSource_t* data)
1638 {
1639  rlReturnVal_t retVal;
1640 
1641  RL_LOGV_ARG0("rlSetTestSourceConfig starts...\n");
1642 
1643  /* check if deviceIndex is out of defined value */
1644  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1645  (RL_NULL_PTR == data))
1646  {
1647  /* set return error code */
1648  retVal = RL_RET_CODE_INVALID_INPUT;
1649  RL_LOGE_ARG0("rlSetTestSourceConfig, Invalid device map\n");
1650  }
1651  else
1652  {
1653  /* Package the command with given data and send it to device */
1654  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1655  RL_RF_TEST_SOURCE_CONFIG_SET_SB,
1656  (rlUInt8_t*)data,
1657  (rlUInt16_t)sizeof(rlTestSource_t));
1658  }
1659  RL_LOGV_ARG0("rlSetTestSourceConfig ends...\n");
1660 
1661  return retVal;
1662 }
1663 
1674 /* DesignId : MMWL_DesignId_036 */
1675 /* Requirements : AUTORADAR_REQ-791 */
1676 rlReturnVal_t rlTestSourceEnable(rlUInt8_t deviceMap, rlTestSourceEnable_t* data)
1677 {
1678  rlReturnVal_t retVal;
1679 
1680  RL_LOGV_ARG0("rlTestSourceEnable starts...\n");
1681 
1682  /* check if deviceIndex is out of defined value */
1683  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1684  (RL_NULL_PTR == data))
1685  {
1686  /* set return error code */
1687  retVal = RL_RET_CODE_INVALID_INPUT;
1688  RL_LOGE_ARG0("rlTestSourceEnable, Invalid device map\n");
1689  }
1690  else
1691  {
1692  /* Package the command with given data and send it to device */
1693  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1694  RL_RF_TEST_SOURCE_ENABLE_SET_SB,
1695  (rlUInt8_t*)data,
1696  (rlUInt16_t)sizeof(rlTestSourceEnable_t));
1697  }
1698  RL_LOGV_ARG0("rlTestSourceEnable ends...\n");
1699 
1700  return retVal;
1701 }
1702 
1713 /* DesignId : MMWL_DesignId_029 */
1714 /* Requirements : AUTORADAR_REQ-789 */
1715 rlReturnVal_t rlRfGetTemperatureReport(rlUInt8_t deviceMap, rlRfTempData_t* data)
1716 {
1717  rlReturnVal_t retVal;
1718 
1719  RL_LOGV_ARG0("rlRfGetTemperatureReport starts...\n");
1720 
1721  /* check if deviceIndex is out of defined value */
1722  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1723  (RL_NULL_PTR == data))
1724  {
1725  /* set return error code */
1726  retVal = RL_RET_CODE_INVALID_INPUT;
1727  RL_LOGE_ARG0("rlRfGetTemperatureReport, Invalid device map\n");
1728  }
1729  else
1730  {
1731  /* Package the command with given data and send it to device */
1732  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_MISC_CONF_GET_MSG,
1733  RL_RF_CHAR_CONF_DYNAMIC_GET_SB,
1734  (rlUInt8_t*)data, (rlUInt16_t)sizeof(rlRfTempData_t));
1735  }
1736  RL_LOGV_ARG0("rlRfGetTemperatureReport ends...\n");
1737 
1738  return retVal;
1739 }
1754 /* DesignId : MMWL_DesignId_041 */
1755 /* Requirements : AUTORADAR_REQ-788 */
1756 rlReturnVal_t rlRfDfeRxStatisticsReport(rlUInt8_t deviceMap, rlDfeStatReport_t* data)
1757 {
1758  rlReturnVal_t retVal;
1759 
1760  RL_LOGV_ARG0("rlRfDfeRxdStatisticsReport starts...\n");
1761 
1762  /* check if deviceIndex is out of defined value */
1763  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1764  (RL_NULL_PTR == data))
1765  {
1766  /* set return error code */
1767  retVal = RL_RET_CODE_INVALID_INPUT;
1768  RL_LOGE_ARG0("Invalid input\n");
1769  }
1770  else
1771  {
1772  /* Package the command with given data and send it to device */
1773  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_MONITORING_REPO_GET_MSG,
1774  RL_RF_DFE_STATISTICS_REPORT_GET_SB,
1775  (rlUInt8_t*)data, 0U);
1776  }
1777  RL_LOGV_ARG0("rlRfDfeRxdStatisticsReport completes...\n");
1778 
1779  return retVal;
1780 }
1781 
1802 /* DesignId : MMWL_DesignId_019 */
1803 /* Requirements : AUTORADAR_REQ-797 */
1804 rlReturnVal_t rlRfDynamicPowerSave(rlUInt8_t deviceMap, rlDynPwrSave_t* data)
1805 {
1806  rlReturnVal_t retVal;
1807 
1808  RL_LOGV_ARG0("rlRfDynamicPowerSave starts...\n");
1809 
1810  /* check if deviceIndex is out of defined value */
1811  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1812  (RL_NULL_PTR == data))
1813  {
1814  /* set return error code */
1815  retVal = RL_RET_CODE_INVALID_INPUT;
1816  RL_LOGE_ARG0("Invalid input\n");
1817  }
1818  else
1819  {
1820  /* Package the command with given data and send it to device */
1821  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1822  RL_RF_DYNAMICPOWERSAVE_CONF_SB,
1823  (rlUInt8_t*)data,
1824  (rlUInt16_t)sizeof(rlDynPwrSave_t));
1825  }
1826  RL_LOGV_ARG0("rlRfDynamicPowerSave completes...\n");
1827 
1828  return retVal;
1829 }
1830 
1851 /* DesignId : MMWL_DesignId_042 */
1852 /* Requirements : AUTORADAR_REQ-794 */
1853 rlReturnVal_t rlRfSetDeviceCfg(rlUInt8_t deviceMap, rlRfDevCfg_t* data)
1854 {
1855  rlReturnVal_t retVal;
1856 
1857  RL_LOGV_ARG0("rlRfSetDeviceCfg starts...\n");
1858 
1859  /* check if deviceIndex is out of defined value */
1860  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1861  (RL_NULL_PTR == data))
1862  {
1863  /* set return error code */
1864  retVal = RL_RET_CODE_INVALID_INPUT;
1865  RL_LOGE_ARG0("Invalid input\n");
1866  }
1867  else
1868  {
1869  /* Package the command with given data and send it to device */
1870  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1871  RL_RF_DEVICE_CFG_SB,
1872  (rlUInt8_t*)data,
1873  (rlUInt16_t)sizeof(rlRfDevCfg_t));
1874  }
1875  RL_LOGV_ARG0("rlRfSetDeviceCfg completes...\n");
1876 
1877  return retVal;
1878 }
1879 
1896 /* DesignId : MMWL_DesignId_044 */
1897 /* Requirements : AUTORADAR_REQ-792 */
1898 rlReturnVal_t rlSetGpAdcConfig(rlUInt8_t deviceMap, rlGpAdcCfg_t* data)
1899 {
1900  rlReturnVal_t retVal;
1901 
1902  RL_LOGV_ARG0("rlSetGpAdcConfig starts...\n");
1903 
1904  /* check if deviceIndex is out of defined value */
1905  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1906  (RL_NULL_PTR == data))
1907  {
1908  /* set return error code */
1909  retVal = RL_RET_CODE_INVALID_INPUT;
1910  RL_LOGE_ARG0("Invalid input\n");
1911  }
1912  else
1913  {
1914  /* Package the command with given data and send it to device */
1915  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1916  RL_RF_GPADC_CONF_SET_SB,
1917  (rlUInt8_t*)data,
1918  (rlUInt16_t)sizeof(rlGpAdcCfg_t));
1919  }
1920  RL_LOGV_ARG0("rlSetGpAdcConfig completes...\n");
1921 
1922  return retVal;
1923 }
1924 
1940 /* DesignId : MMWL_DesignId_043 */
1941 /* Requirements : AUTORADAR_REQ-793 */
1942 rlReturnVal_t rlRfSetLdoBypassConfig(rlUInt8_t deviceMap, rlRfLdoBypassCfg_t* data)
1943 {
1944  rlReturnVal_t retVal;
1945 
1946  RL_LOGV_ARG0("rlRfSetLdoBypassConfig starts...\n");
1947 
1948  /* check if deviceIndex is out of defined value */
1949  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1950  {
1951  /* set return error code */
1952  retVal = RL_RET_CODE_INVALID_INPUT;
1953  }
1954  else
1955  {
1956  /* Package the command with given data and send it to device */
1957  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1958  RL_RF_LDOBYPASS_SET_SB,
1959  (rlUInt8_t*)data,
1960  (rlUInt16_t)sizeof(rlRfLdoBypassCfg_t));
1961  }
1962 
1963  RL_LOGV_ARG0("rlRfSetLdoBypassConfig completes...\n");
1964  return retVal;
1965 }
1966 
1990 /* DesignId : MMWL_DesignId_045 */
1991 /* Requirements : AUTORADAR_REQ-798 */
1992 rlReturnVal_t rlRfSetPhaseShiftConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
1993  rlRfPhaseShiftCfg_t* data)
1994 {
1995  rlReturnVal_t retVal;
1996 
1997  RL_LOGV_ARG0("rlRfSetPhaseShiftConfig starts...\n");
1998 
1999  /* check if deviceIndex is out of defined value */
2000  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2001  (RL_NULL_PTR == data) || (cnt == 0U))
2002  {
2003  /* set return error code */
2004  retVal = RL_RET_CODE_INVALID_INPUT;
2005  }
2006  else
2007  {
2008  /* Initialize Command and Response Sub Blocks */
2009  rlDriverMsg_t inMsg;
2010  rlDriverMsg_t outMsg = {0};
2011  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
2012  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
2013 
2014  /* Initialize Command and Response Sub Blocks */
2015  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlRfPhaseShiftCfg_t) + \
2016  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
2017 
2018  /* single sub-block length for chirp config API */
2019  sbLen = (rlUInt16_t)(sizeof(rlRfPhaseShiftCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
2020 
2021  /* get Max Sub Block count */
2022  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
2023  /*LDRA_INSPECTED 127 D */
2024  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
2025 
2026  retVal = RL_RET_CODE_OK;
2027  /* if requested count of chirpConfig is within one Message packet */
2028  if (cnt <= maxSbCntInMsg)
2029  {
2030  sbCntInMsg = cnt;
2031  numChnkOfMsg = 1U;
2032  lastSbCntInMsg = 0U;
2033  }
2034  else
2035  {
2036  sbCntInMsg = maxSbCntInMsg;
2037  numChnkOfMsg = cnt / maxSbCntInMsg;
2038  lastSbCntInMsg = cnt % maxSbCntInMsg;
2039  }
2040 
2041  /* Fill in-message packet */
2042  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
2043  /* get the loop count in form of number of msg chunks */
2044  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
2045 
2046  while (retVal == RL_RET_CODE_OK)
2047  {
2048  /* all full messages have been sent, then send last partial message */
2049  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
2050  {
2051  inMsg.opcode.nsbc = lastSbCntInMsg;
2052  }
2053  else
2054  {
2055  inMsg.opcode.nsbc = sbCntInMsg;
2056  }
2057 
2058  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
2059  {
2060  /* Set Command Sub Block*/
2061  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2062  LDRA Tool Issue" */
2063  /*LDRA_INSPECTED 105 D */
2064  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
2065  RL_RF_PERCHIRPPHASESHIFT_CONF_SB);
2066  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2067  LDRA Tool Issue" */
2068  /*LDRA_INSPECTED 105 D */
2069  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlRfPhaseShiftCfg_t);
2070  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2071  LDRA Tool Issue" */
2072  /*LDRA_INSPECTED 105 D */
2073  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(data);
2074  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
2075  next chirp Config */
2076  /*LDRA_INSPECTED 567 S */
2077  data++;
2078  }
2079  /* Send Command to mmWave Radar Device */
2080  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2081  LDRA Tool Issue" */
2082  /*LDRA_INSPECTED 105 D */
2083  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2084  /* decrement the loop count */
2085  loopCnt--;
2086  /* if all phase shift configs have been sent to device then terminate the loop */
2087  if (loopCnt == 0U)
2088  {
2089  break;
2090  }
2091  }
2092  }
2093 
2094  RL_LOGV_ARG0("rlRfSetPhaseShiftConfig ends...\n");
2095 
2096  return retVal;
2097 }
2098 
2113 /* DesignId : MMWL_DesignId_098 */
2114 /* Requirements : AUTORADAR_REQ-801 */
2115 rlReturnVal_t rlRfSetPALoopbackConfig(rlUInt8_t deviceMap, rlRfPALoopbackCfg_t* data)
2116 {
2117  rlReturnVal_t retVal;
2118 
2119  RL_LOGV_ARG0("rlRfSetPALoopbackConfig starts...\n");
2120 
2121  /* check if deviceIndex is out of defined value */
2122  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2123  {
2124  /* set return error code */
2125  retVal = RL_RET_CODE_INVALID_INPUT;
2126  }
2127  else
2128  {
2129  /* Package the command with given data and send it to device */
2130  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2131  RL_RF_PALOOPBACK_CFG_SET_SB,
2132  (rlUInt8_t*)data,
2133  (rlUInt16_t)sizeof(rlRfPALoopbackCfg_t));
2134  }
2135 
2136  RL_LOGV_ARG0("rlRfSetPALoopbackConfig completes...\n");
2137  return retVal;
2138 }
2139 
2154 /* DesignId : MMWL_DesignId_099 */
2155 /* Requirements : AUTORADAR_REQ-802 */
2156 rlReturnVal_t rlRfSetPSLoopbackConfig(rlUInt8_t deviceMap, rlRfPSLoopbackCfg_t* data)
2157 {
2158  rlReturnVal_t retVal;
2159 
2160  RL_LOGV_ARG0("rlRfSetPSLoopbackConfig starts...\n");
2161 
2162  /* check if deviceIndex is out of defined value */
2163  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2164  {
2165  /* set return error code */
2166  retVal = RL_RET_CODE_INVALID_INPUT;
2167  }
2168  else
2169  {
2170  /* Package the command with given data and send it to device */
2171  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2172  RL_RF_PSLOOPBACK_CFG_SET_SB,
2173  (rlUInt8_t*)data,
2174  (rlUInt16_t)sizeof(rlRfPSLoopbackCfg_t));
2175  }
2176 
2177  RL_LOGV_ARG0("rlRfSetPSLoopbackConfig completes...\n");
2178  return retVal;
2179 }
2180 
2196 /* DesignId : MMWL_DesignId_100 */
2197 /* Requirements : AUTORADAR_REQ-803 */
2198 rlReturnVal_t rlRfSetIFLoopbackConfig(rlUInt8_t deviceMap, rlRfIFLoopbackCfg_t* data)
2199 {
2200  rlReturnVal_t retVal;
2201 
2202  RL_LOGV_ARG0("rlRfSetIFLoopbackConfig starts...\n");
2203 
2204  /* check if deviceIndex is out of defined value */
2205  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2206  {
2207  /* set return error code */
2208  retVal = RL_RET_CODE_INVALID_INPUT;
2209  }
2210  else
2211  {
2212  /* Package the command with given data and send it to device */
2213  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2214  RL_RF_IFLOOPBACK_CFG_SET_SB,
2215  (rlUInt8_t*)data,
2216  (rlUInt16_t)sizeof(rlRfIFLoopbackCfg_t));
2217  }
2218 
2219  RL_LOGV_ARG0("rlRfSetIFLoopbackConfig completes...\n");
2220  return retVal;
2221 }
2222 
2244 /* DesignId : MMWL_DesignId_050 */
2245 /* Requirements : AUTORADAR_REQ-799 */
2246 rlReturnVal_t rlRfSetProgFiltCoeffRam(rlUInt8_t deviceMap, rlRfProgFiltCoeff_t* data)
2247 {
2248  rlReturnVal_t retVal;
2249 
2250  RL_LOGV_ARG0("rlRfSetProgFiltCoeffRam starts...\n");
2251 
2252  /* check if deviceIndex is out of defined value */
2253  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2254  {
2255  /* set return error code */
2256  retVal = RL_RET_CODE_INVALID_INPUT;
2257  }
2258  else
2259  {
2260  /* Package the command with given data and send it to device */
2261  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2262  RL_RF_PROG_FILT_COEFF_RAM_SET_SB,
2263  (rlUInt8_t*)data,
2264  (rlUInt16_t)sizeof(rlRfProgFiltCoeff_t));
2265  }
2266 
2267  RL_LOGV_ARG0("rlRfSetProgFiltCoeffRam completes...\n");
2268 
2269  return retVal;
2270 }
2271 
2286 /* DesignId : MMWL_DesignId_051 */
2287 /* Requirements : AUTORADAR_REQ-800 */
2288 rlReturnVal_t rlRfSetProgFiltConfig(rlUInt8_t deviceMap, rlRfProgFiltConf_t* data)
2289 {
2290  rlReturnVal_t retVal;
2291 
2292  RL_LOGV_ARG0("rlRfSetProgFiltConfig starts...\n");
2293 
2294  /* check if deviceIndex is out of defined value */
2295  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2296  {
2297  /* set return error code */
2298  retVal = RL_RET_CODE_INVALID_INPUT;
2299  }
2300  else
2301  {
2302  /* Package the command with given data and send it to device */
2303  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2304  RL_RF_PROG_FILT_CONF_SET_SB,
2305  (rlUInt8_t*)data,
2306  (rlUInt16_t)sizeof(rlRfProgFiltConf_t));
2307  }
2308 
2309  RL_LOGV_ARG0("rlRfSetProgFiltConfig completes...\n");
2310 
2311  return retVal;
2312 }
2313 
2328 /* DesignId : MMWL_DesignId_052 */
2329 /* Requirements : AUTORADAR_REQ-891 */
2330 rlReturnVal_t rlRfSetMiscConfig(rlUInt8_t deviceMap, rlRfMiscConf_t* data)
2331 {
2332  rlReturnVal_t retVal;
2333 
2334  RL_LOGV_ARG0("rlRfSetMiscConfig starts...\n");
2335 
2336  /* check if deviceIndex is out of defined value */
2337  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2338  {
2339  /* set return error code */
2340  retVal = RL_RET_CODE_INVALID_INPUT;
2341  }
2342  else
2343  {
2344  /* Package the command with given data and send it to device */
2345  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2346  RL_RF_RADAR_MISC_CTL_SB,
2347  (rlUInt8_t*)data,
2348  (rlUInt16_t)sizeof(rlRfMiscConf_t));
2349  }
2350 
2351  RL_LOGV_ARG0("rlRfSetMiscConfig completes...\n");
2352  return retVal;
2353 }
2354 
2375 /* DesignId : MMWL_DesignId_053 */
2376 /* Requirements : AUTORADAR_REQ-892 */
2377 rlReturnVal_t rlRfSetCalMonTimeUnitConfig(rlUInt8_t deviceMap,
2379 {
2380  rlReturnVal_t retVal;
2381 
2382  RL_LOGV_ARG0("rlRfSetCalMonTimeUnitConfig starts...\n");
2383 
2384  /* check if deviceIndex is out of defined value */
2385  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2386  {
2387  /* set return error code */
2388  retVal = RL_RET_CODE_INVALID_INPUT;
2389  }
2390  else
2391  {
2392  /* Package the command with given data and send it to device */
2393  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2394  RL_RF_CALIB_MON_TIME_UNIT_SB,
2395  (rlUInt8_t*)data,
2396  (rlUInt16_t)sizeof(rlRfCalMonTimeUntConf_t));
2397  }
2398 
2399  RL_LOGV_ARG0("rlRfSetCalMonTimeUnitConfig completes...\n");
2400 
2401  return retVal;
2402 }
2403 
2425 /* DesignId : MMWL_DesignId_054 */
2426 /* Requirements : AUTORADAR_REQ-893 */
2427 rlReturnVal_t rlRfSetCalMonFreqLimitConfig(rlUInt8_t deviceMap,
2429 {
2430  rlReturnVal_t retVal;
2431 
2432  RL_LOGV_ARG0("rlRfSetCalMonFreqLimitConfig starts...\n");
2433 
2434  /* check if deviceIndex is out of defined value */
2435  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2436  {
2437  /* set return error code */
2438  retVal = RL_RET_CODE_INVALID_INPUT;
2439  }
2440  else
2441  {
2442  /* Package the command with given data and send it to device */
2443  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2444  RL_RF_CAL_MON_FREQ_LIMIT_SB,
2445  (rlUInt8_t*)data,
2446  (rlUInt16_t)sizeof(rlRfCalMonFreqLimitConf_t));
2447  }
2448 
2449  RL_LOGV_ARG0("rlRfSetCalMonFreqLimitConfig completes...\n");
2450  return retVal;
2451 }
2452 
2472 /* DesignId : MMWL_DesignId_055 */
2473 /* Requirements : AUTORADAR_REQ-894 */
2474 rlReturnVal_t rlRfInitCalibConfig(rlUInt8_t deviceMap, rlRfInitCalConf_t* data)
2475 {
2476  rlReturnVal_t retVal;
2477 
2478  RL_LOGV_ARG0("rlRfInitCalibConfig starts...\n");
2479 
2480  /* check if deviceIndex is out of defined value */
2481  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2482  {
2483  /* set return error code */
2484  retVal = RL_RET_CODE_INVALID_INPUT;
2485  }
2486  else
2487  {
2488  /* Package the command with given data and send it to device */
2489  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2490  RL_RF_INIT_CALIB_CONF_SB,
2491  (rlUInt8_t*)data,
2492  (rlUInt16_t)sizeof(rlRfInitCalConf_t));
2493  }
2494 
2495  RL_LOGV_ARG0("rlRfInitCalibConfig completes...\n");
2496  return retVal;
2497 }
2498 
2516 /* DesignId : MMWL_DesignId_056 */
2517 /* Requirements : AUTORADAR_REQ-895, AUTORADAR_REQ-1063 */
2518 rlReturnVal_t rlRfRunTimeCalibConfig(rlUInt8_t deviceMap, rlRunTimeCalibConf_t* data)
2519 {
2520  rlReturnVal_t retVal;
2521 
2522  RL_LOGV_ARG0("rlRfRunTimeCalibConfig starts...\n");
2523 
2524  /* check if deviceIndex is out of defined value */
2525  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2526  {
2527  /* set return error code */
2528  retVal = RL_RET_CODE_INVALID_INPUT;
2529  }
2530  else
2531  {
2532  /* Package the command with given data and send it to device */
2533  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2534  RL_RF_RUN_TIME_CALIB_CONF_TRIG_SB,
2535  (rlUInt8_t*)data,
2536  (rlUInt16_t)sizeof(rlRunTimeCalibConf_t));
2537  }
2538 
2539  RL_LOGV_ARG0("rlRfRunTimeCalibConfig completes...\n");
2540  return retVal;
2541 }
2542 
2556 /* DesignId : MMWL_DesignId_057 */
2557 /* Requirements : AUTORADAR_REQ-896 */
2558 rlReturnVal_t rlRxGainTempLutSet(rlUInt8_t deviceMap, rlRxGainTempLutData_t *data)
2559 {
2560  rlReturnVal_t retVal;
2561 
2562  /* check if deviceIndex is out of defined value */
2563  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2564  {
2565  /* set return error code */
2566  retVal = RL_RET_CODE_INVALID_INPUT;
2567  }
2568  else
2569  {
2570  /* Package the command with given data and send it to device */
2571  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2572  RL_RF_RX_GAIN_TEMPLUT_CONF_SB, (rlUInt8_t*)data,
2573  (rlUInt16_t)sizeof(rlRxGainTempLutData_t));
2574  }
2575  return retVal;
2576 }
2577 
2591 /* DesignId : MMWL_DesignId_058 */
2592 /* Requirements : AUTORADAR_REQ-897 */
2593 rlReturnVal_t rlRxGainTempLutGet(rlUInt8_t deviceMap, rlRxGainTempLutReadReq_t *inData,
2594  rlRxGainTempLutData_t *outData)
2595 {
2596  rlReturnVal_t retVal;
2597 
2598  RL_LOGV_ARG0("rlRxGainTempLutRead starts...\n");
2599 
2600  /* check if deviceIndex is out of defined value */
2601  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2602  (RL_NULL_PTR == inData))
2603  {
2604  /* set return error code */
2605  retVal = RL_RET_CODE_INVALID_INPUT;
2606  RL_LOGE_ARG0("rlRxGainTempLutRead, Invalid device map\n");
2607  }
2608  else
2609  {
2610  /* Initialize Command and Response Sub Blocks */
2611  rlDriverMsg_t inMsg = {0};
2612  rlDriverMsg_t outMsg = {0};
2613 
2614  /* Initialize Command and Response Sub Blocks */
2615  rlPayloadSb_t inPayloadSb = {0};
2616  rlPayloadSb_t outPayloadSb = {0};
2617 
2618  /* Fill in-message Payload */
2619  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_RX_GAIN_TEMPLUT_CONF_SB,
2620  &inPayloadSb, (rlUInt8_t *)inData,
2621  (rlUInt16_t)sizeof(rlRxGainTempLutReadReq_t));
2622 
2623  /* Construct command packet */
2624  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
2625 
2626  /* Fill out-message Payload */
2627  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)outData,
2628  (rlUInt16_t)sizeof(rlRxGainTempLutData_t));
2629 
2630  /* Construct response packet */
2631  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2632 
2633  /* Send Command to mmWave Radar Device */
2634  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2635  }
2636  RL_LOGV_ARG0("rlRxGainTempLutRead ends...\n");
2637 
2638  return retVal;
2639 }
2640 
2652 /* DesignId : MMWL_DesignId_059 */
2653 /* Requirements : AUTORADAR_REQ-898 */
2654 rlReturnVal_t rlTxGainTempLutSet(rlUInt8_t deviceMap, rlTxGainTempLutData_t *data)
2655 {
2656  rlReturnVal_t retVal;
2657 
2658  /* check if deviceIndex is out of defined value */
2659  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2660  {
2661  /* set return error code */
2662  retVal = RL_RET_CODE_INVALID_INPUT;
2663  }
2664  else
2665  {
2666  /* Package the command with given data and send it to device */
2667  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2668  RL_RF_TX_GAIN_TEMPLUT_CONF_SB, (rlUInt8_t*)data,
2669  (rlUInt16_t)sizeof(rlTxGainTempLutData_t));
2670  }
2671  return retVal;
2672 }
2673 
2687 /* DesignId : MMWL_DesignId_060 */
2688 /* Requirements : AUTORADAR_REQ-899 */
2689 rlReturnVal_t rlTxGainTempLutGet(rlUInt8_t deviceMap,
2691 {
2692  rlReturnVal_t retVal;
2693 
2694  RL_LOGV_ARG0("rlTxGainTempLutRead starts...\n");
2695 
2696  /* check if deviceIndex is out of defined value */
2697  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2698  (RL_NULL_PTR == inData))
2699  {
2700  /* set return error code */
2701  retVal = RL_RET_CODE_INVALID_INPUT;
2702  RL_LOGE_ARG0("rlTxGainTempLutRead, Invalid device map\n");
2703  }
2704  else
2705  {
2706  /* Initialize Command and Response Sub Blocks */
2707  rlDriverMsg_t inMsg = {0};
2708  rlDriverMsg_t outMsg = {0};
2709 
2710  /* Initialize Command and Response Sub Blocks */
2711  rlPayloadSb_t inPayloadSb = {0};
2712  rlPayloadSb_t outPayloadSb = {0};
2713 
2714  /* Fill in-message Payload */
2715  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_TX_GAIN_TEMPLUT_CONF_SB,
2716  &inPayloadSb, (rlUInt8_t *)inData,
2717  (rlUInt16_t)sizeof(rlTxGainTempLutReadReq_t));
2718 
2719  /* Construct command packet */
2720  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
2721 
2722  /* Fill out-message Payload */
2723  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)outData,
2724  (rlUInt16_t)sizeof(rlTxGainTempLutData_t));
2725 
2726  /* Construct response packet */
2727  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2728 
2729  /* Send Command to mmWave Radar Device */
2730  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2731  }
2732  RL_LOGV_ARG0("rlTxGainTempLutRead ends...\n");
2733 
2734  return retVal;
2735 }
2736 
2757 /* DesignId : MMWL_DesignId_066 */
2758 /* Requirements : AUTORADAR_REQ-905 */
2759 rlReturnVal_t rlRfTxFreqPwrLimitConfig(rlUInt8_t deviceMap, rlRfTxFreqPwrLimitMonConf_t* data)
2760 {
2761  rlReturnVal_t retVal;
2762 
2763  /* check if deviceIndex is out of defined value */
2764  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2765  (RL_NULL_PTR == data))
2766  {
2767  /* set return error code */
2768  retVal = RL_RET_CODE_INVALID_INPUT;
2769  }
2770  else
2771  {
2772  /* Package the command with given data and send it to device */
2773  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2774  RL_RF_TX_FREQ_PWR_LIMIT_SB,
2775  (rlUInt8_t*)data,
2776  (rlUInt16_t)sizeof(rlRfTxFreqPwrLimitMonConf_t));
2777  }
2778  return retVal;
2779 }
2780 
2804 /* DesignId : MMWL_DesignId_062 */
2805 /* Requirements : AUTORADAR_REQ-901 */
2806 rlReturnVal_t rlSetLoopBckBurstCfg(rlUInt8_t deviceMap, rlLoopbackBurst_t *data)
2807 {
2808  rlReturnVal_t retVal;
2809 
2810  /* check if deviceIndex is out of defined value */
2811  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2812  {
2813  /* set return error code */
2814  retVal = RL_RET_CODE_INVALID_INPUT;
2815  }
2816  else
2817  {
2818  /* Package the command with given data and send it to device */
2819  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2820  RL_RF_LB_BURST_CFG_SET_SB, (rlUInt8_t*)data,
2821  (rlUInt16_t)sizeof(rlLoopbackBurst_t));
2822  }
2823  return retVal;
2824 }
2825 
2843 /* DesignId : MMWL_DesignId_063 */
2844 /* Requirements : AUTORADAR_REQ-902 */
2845 rlReturnVal_t rlSetDynChirpCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt,
2846  rlDynChirpCfg_t **data)
2847 {
2848  rlReturnVal_t retVal;
2849 
2850  /* check if deviceIndex is out of defined value */
2851  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
2852  (segCnt == 0U))
2853  {
2854  /* set return error code */
2855  retVal = RL_RET_CODE_INVALID_INPUT;
2856  }
2857  else
2858  {
2859  /* Initialize Command and Response Sub Blocks */
2860  rlDriverMsg_t inMsg;
2861  rlDriverMsg_t outMsg = {0};
2862 
2863  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
2864  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
2865 
2866 
2867  /* Initialize Command and Response Sub Blocks */
2868  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlDynChirpCfg_t) + \
2869  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
2870 
2871  /* single sub-block length for chirp config API */
2872  sbLen = (rlUInt16_t)(sizeof(rlDynChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
2873 
2874 
2875  /* get Max Sub Block count */
2876  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
2877  /*LDRA_INSPECTED 127 D */
2878  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
2879 
2880  retVal = RL_RET_CODE_OK;
2881  /* if requested count of chirpConfig is within one Message packet */
2882  if (segCnt <= maxSbCntInMsg)
2883  {
2884  sbCntInMsg = segCnt;
2885  numChnkOfMsg = 1U;
2886  lastSbCntInMsg = 0U;
2887  }
2888  else
2889  {
2890  sbCntInMsg = maxSbCntInMsg;
2891  numChnkOfMsg = segCnt / maxSbCntInMsg;
2892  lastSbCntInMsg = segCnt % maxSbCntInMsg;
2893  }
2894 
2895  /* Fill in-message packet */
2896  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
2897 
2898  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
2899 
2900  while (retVal == RL_RET_CODE_OK)
2901  {
2902  /* all full messages have been sent, then send last partial message */
2903  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
2904  {
2905  inMsg.opcode.nsbc = lastSbCntInMsg;
2906  }
2907  else
2908  {
2909  inMsg.opcode.nsbc = sbCntInMsg;
2910  }
2911 
2912  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
2913  {
2914  /* Set Command Sub Block*/
2915  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2916  LDRA Tool Issue" */
2917  /*LDRA_INSPECTED 105 D */
2918  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
2919  RL_RF_DYN_CHIRP_CFG_SET_SB);
2920  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2921  LDRA Tool Issue" */
2922  /*LDRA_INSPECTED 105 D */
2923  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlDynChirpCfg_t);
2924  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2925  LDRA Tool Issue" */
2926  /*LDRA_INSPECTED 105 D */
2927  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
2928 
2929  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
2930  next Config */
2931  /*LDRA_INSPECTED 567 S */
2932  data++;
2933  }
2934  /* Send Command to mmWave Radar Device */
2935  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2936  loopCnt--;
2937 
2938  if (loopCnt == 0U)
2939  {
2940  break;
2941  }
2942  }
2943  }
2944  return retVal;
2945 }
2946 
2966 /* DesignId : MMWL_DesignId_064 */
2967 /* Requirements : AUTORADAR_REQ-903 */
2968 rlReturnVal_t rlSetDynChirpEn(rlUInt8_t deviceMap, rlDynChirpEnCfg_t *data)
2969 {
2970  rlReturnVal_t retVal;
2971 
2972  /* check if deviceIndex is out of defined value */
2973  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2974  {
2975  /* set return error code */
2976  retVal = RL_RET_CODE_INVALID_INPUT;
2977  }
2978  else
2979  {
2980  /* Package the command with given data and send it to device */
2981  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2982  RL_RF_DYN_CHIRP_CFG_EN_SB, (rlUInt8_t*)data,
2983  (rlUInt16_t)sizeof(rlDynChirpEnCfg_t));
2984  }
2985  return retVal;
2986 }
2987 
3014 /* DesignId : MMWL_DesignId_065 */
3015 /* Requirements : AUTORADAR_REQ-904 */
3016 rlReturnVal_t rlSetDynPerChirpPhShifterCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt,
3017  rlDynPerChirpPhShftCfg_t **data)
3018 {
3019  rlReturnVal_t retVal;
3020 
3021  /* check if deviceIndex is out of defined value */
3022  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
3023  (segCnt == 0U))
3024  {
3025  /* set return error code */
3026  retVal = RL_RET_CODE_INVALID_INPUT;
3027  }
3028  else
3029  {
3030  /* Initialize Command and Response Sub Blocks */
3031  rlDriverMsg_t inMsg;
3032  rlDriverMsg_t outMsg = {0};
3033 
3034  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
3035  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
3036 
3037  /* Initialize Command and Response Sub Blocks */
3038  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlDynPerChirpPhShftCfg_t) + \
3039  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
3040 
3041  /* single sub-block length for chirp config API */
3042  sbLen = (rlUInt16_t)(sizeof(rlDynPerChirpPhShftCfg_t) + \
3043  (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
3044 
3045  /* get Max Sub Block count */
3046  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
3047  /*LDRA_INSPECTED 127 D */
3048  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
3049 
3050  retVal = RL_RET_CODE_OK;
3051  /* if requested count of chirpConfig is within one Message packet */
3052  if (segCnt <= maxSbCntInMsg)
3053  {
3054  sbCntInMsg = segCnt;
3055  numChnkOfMsg = 1U;
3056  lastSbCntInMsg = 0U;
3057  }
3058  else
3059  {
3060  sbCntInMsg = maxSbCntInMsg;
3061  numChnkOfMsg = segCnt / maxSbCntInMsg;
3062  lastSbCntInMsg = segCnt % maxSbCntInMsg;
3063  }
3064 
3065  /* Fill in-message packet */
3066  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
3067 
3068  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
3069 
3070  while (retVal == RL_RET_CODE_OK)
3071  {
3072  /* all full messages have been sent, then send last partial message */
3073  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
3074  {
3075  inMsg.opcode.nsbc = lastSbCntInMsg;
3076  }
3077  else
3078  {
3079  inMsg.opcode.nsbc = sbCntInMsg;
3080  }
3081 
3082  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
3083  {
3084  /* Set Command Sub Block*/
3085  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function.\
3086  LDRA Tool Issue" */
3087  /*LDRA_INSPECTED 105 D */
3088  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
3089  RL_RF_DYN_PERCHIRP_PHSHFT_CFG_SET_SB);
3090  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
3091  LDRA Tool Issue" */
3092  /*LDRA_INSPECTED 105 D */
3093  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlDynPerChirpPhShftCfg_t);
3094  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
3095  LDRA Tool Issue" */
3096  /*LDRA_INSPECTED 105 D */
3097  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
3098  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
3099  next Config */
3100  /*LDRA_INSPECTED 567 S */
3101  data++;
3102  }
3103  /* Send Command to mmWave Radar Device */
3104  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3105  loopCnt--;
3106 
3107  if (loopCnt == 0U)
3108  {
3109  break;
3110  }
3111  }
3112  }
3113  return retVal;
3114 }
3115 
3141 /* DesignId : MMWL_DesignId_067 */
3142 /* Requirements : AUTORADAR_REQ-906 */
3143 rlReturnVal_t rlRfCalibDataRestore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
3144 {
3145  rlReturnVal_t retVal;
3146  rlUInt8_t idx;
3147 
3148  /* check if deviceIndex is out of defined value */
3149  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3150  {
3151  /* set return error code */
3152  retVal = RL_RET_CODE_INVALID_INPUT;
3153  }
3154  else
3155  {
3156  /* Initialize Command and Response Sub Blocks */
3157  rlDriverMsg_t inMsg = {0};
3158  rlDriverMsg_t outMsg = {0};
3159  rlPayloadSb_t inPayloadSb = {0};
3160  rlPayloadSb_t outPayloadSb = {0};
3161  /* set return value to zero by default */
3162  retVal = RL_RET_CODE_OK;
3163  /* Invoke Set Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3164  for (idx = 0U; idx < RL_MAX_CALIB_DATA_CHUNK; idx++)
3165  {
3166  /* Construct command packet */
3167  rlDriverConstructInMsg(RL_RF_STATIC_CONF_SET_MSG, &inMsg, &inPayloadSb);
3168  /* Fill in-message Payload */
3169  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3170  next calibData */
3171  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3172  next calibData */
3173  /*LDRA_INSPECTED 87 S */
3174  /*LDRA_INSPECTED 567 S */
3175  rlDriverFillPayload(RL_RF_STATIC_CONF_SET_MSG, RL_RF_CAL_DATA_RD_WR_SB, &inPayloadSb,
3176  (rlUInt8_t*)(&data->calibChunk[idx]),
3177  (rlUInt16_t)sizeof(rlCalDataStore_t));
3178 
3179  /* Construct response packet */
3180  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3181  /* Fill in-message Payload */
3182  rlDriverFillPayload(0U, 0U, &outPayloadSb, NULL, 0U);
3183 
3184  /* Send Command to mmWave Radar Device */
3185  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3186  /* check for return value */
3187  if (RL_RET_CODE_OK != retVal)
3188  {
3189  /* If command invoke is failed then terminate this loop */
3190  break;
3191  }
3192  }
3193 
3194  }
3195  return retVal;
3196 }
3197 
3222 /* DesignId : MMWL_DesignId_068 */
3223 /* Requirements : AUTORADAR_REQ-906 */
3224 rlReturnVal_t rlRfCalibDataStore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
3225 {
3226  rlReturnVal_t retVal;
3227 
3228  /* check if deviceIndex is out of defined value */
3229  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3230  {
3231  /* set return error code */
3232  retVal = RL_RET_CODE_INVALID_INPUT;
3233  }
3234  else
3235  {
3236  /* Initialize Command and Response Sub Blocks */
3237  rlDriverMsg_t inMsg = {0};
3238  rlDriverMsg_t outMsg = {0};
3239  rlPayloadSb_t inPayloadSb = {0};
3240  rlPayloadSb_t outPayloadSb = {0};
3241  rlCalDataGetCfg_t caldataGetCfg = {0U};
3242  rlUInt8_t idx;
3243  /* set return value to zero by default */
3244  retVal = RL_RET_CODE_OK;
3245  /* Invoke Get Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3246  for (idx = 0U; idx < RL_MAX_CALIB_DATA_CHUNK; idx++)
3247  {
3248  /* Construct command packet */
3249  rlDriverConstructInMsg(RL_RF_STATIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
3250  /* Fill in-message Payload */
3251  rlDriverFillPayload(RL_RF_STATIC_CONF_GET_MSG, RL_RF_CAL_DATA_RD_WR_SB, &inPayloadSb,
3252  (rlUInt8_t*)&caldataGetCfg, (rlUInt16_t)sizeof(rlCalDataGetCfg_t));
3253 
3254  /* Construct response packet */
3255  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3256  /* Fill in-message Payload */
3257  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3258  next calibData */
3259  /*AR_CODE_REVIEW MR:R.18.4 <APPROVED> "require pointer increment to jump to
3260  next calibData */
3261  /*LDRA_INSPECTED 87 S */
3262  /*LDRA_INSPECTED 567 S */
3263  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)(&data->calibChunk[idx]), 0U);
3264 
3265  /* Send Command to mmWave Radar Device */
3266  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3267  /* check for return value */
3268  if (RL_RET_CODE_OK != retVal)
3269  {
3270  /* If command invoke is failed then terminate this loop */
3271  break;
3272  }
3273  /* increment Chunk ID for next Get Command */
3274  caldataGetCfg.chunkId++;
3275  }
3276  }
3277  return retVal;
3278 }
3279 
3303 /* DesignId : MMWL_DesignId_061 */
3304 /* Requirements : AUTORADAR_REQ-900 */
3305 rlReturnVal_t rlRfInterRxGainPhaseConfig(rlUInt8_t deviceMap,
3306  rlInterRxGainPhConf_t* data)
3307 {
3308  rlReturnVal_t retVal;
3309 
3310  /* check if deviceIndex is out of defined value */
3311  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3312  {
3313  /* set return error code */
3314  retVal = RL_RET_CODE_INVALID_INPUT;
3315  }
3316  else
3317  {
3318  /* Package the command with given data and send it to device */
3319  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3320  RL_RF_DIG_COMP_EST_CTRL_SB, (rlUInt8_t*)data,
3321  (rlUInt16_t)sizeof(rlInterRxGainPhConf_t));
3322  }
3323  return retVal;
3324 }
3325 
3336 /* DesignId : MMWL_DesignId_096 */
3337 /* Requirements : AUTORADAR_REQ-911 */
3338 rlReturnVal_t rlGetRfBootupStatus(rlUInt8_t deviceMap, rlRfBootStatusCfg_t *data)
3339 {
3340  rlReturnVal_t retVal;
3341 
3342  /* check for NULL pointer */
3343  if (data == RL_NULL_PTR)
3344  {
3345  /* set error code if data pointer is passed NULL */
3346  retVal = RL_RET_CODE_NULL_PTR;
3347  }
3348  else
3349  {
3350  /* Package the command with given data and send it to device */
3351  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3352  RL_RF_BOOTUP_BIST_STATUS_SB, (rlUInt8_t*)data, 0U);
3353  }
3354 
3355  return retVal;
3356 }
3357 
3378 /* DesignId : MMWL_DesignId_097 */
3379 /* Requirements : AUTORADAR_REQ-912 */
3380 rlReturnVal_t rlSetInterChirpBlkCtrl(rlUInt8_t deviceMap,
3382 {
3383  rlReturnVal_t retVal;
3384 
3385  /* check if deviceIndex is out of defined value */
3386  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3387  {
3388  /* set return error code */
3389  retVal = RL_RET_CODE_INVALID_INPUT;
3390  }
3391  else
3392  {
3393  /* Package the command with given data and send it to device */
3394  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3395  RL_RF_INTERCHIRP_BLOCK_CTRL_SB, (rlUInt8_t*)data,
3396  (rlUInt16_t)sizeof(rlInterChirpBlkCtrlCfg_t));
3397  }
3398  return retVal;
3399 }
3400 
3429 /* DesignId : MMWL_DesignId_107 */
3430 /* Requirements : AUTORADAR_REQ-938, AUTORADAR_REQ-1021 */
3431 rlReturnVal_t rlSetSubFrameStart(rlUInt8_t deviceMap,
3432  rlSubFrameStartCfg_t *data)
3433 {
3434  rlReturnVal_t retVal;
3435 
3436  /* check if deviceIndex is out of defined value */
3437  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3438  {
3439  /* set return error code */
3440  retVal = RL_RET_CODE_INVALID_INPUT;
3441  }
3442  else
3443  {
3444  /* Package the command with given data and send it to device */
3445  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3446  RL_RF_SUBFRAME_START_SB, (rlUInt8_t*)data,
3447  (rlUInt16_t)sizeof(rlSubFrameStartCfg_t));
3448  }
3449  return retVal;
3450 }
3451 
3467 /* DesignId : MMWL_DesignId_109 */
3468 /* Requirements : AUTORADAR_REQ-1003 */
3469 rlReturnVal_t rlRfPhShiftCalibDataRestore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
3470 {
3471  rlReturnVal_t retVal;
3472  rlUInt8_t idx;
3473 
3474  /* check if deviceIndex is out of defined value */
3475  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3476  {
3477  /* set return error code */
3478  retVal = RL_RET_CODE_INVALID_INPUT;
3479  }
3480  else
3481  {
3482  /* Initialize Command and Response Sub Blocks */
3483  rlDriverMsg_t inMsg = { 0 };
3484  rlDriverMsg_t outMsg = { 0 };
3485  rlPayloadSb_t inPayloadSb = { 0 };
3486  rlPayloadSb_t outPayloadSb = { 0 };
3487  /* set return value to zero by default */
3488  retVal = RL_RET_CODE_OK;
3489  /* Invoke Set Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3490  for (idx = 0U; idx < RL_TX_CNT; idx++)
3491  {
3492  /* Construct command packet */
3493  rlDriverConstructInMsg(RL_RF_STATIC_CONF_SET_MSG, &inMsg, &inPayloadSb);
3494  if (idx == (RL_TX_CNT - 1U))
3495  {
3496  data->PhShiftcalibChunk[idx].calibApply = 1U;
3497  }
3498  /* Fill in-message Payload */
3499  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3500  next calibData */
3501  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3502  next calibData */
3503  /*LDRA_INSPECTED 87 S */
3504  /*LDRA_INSPECTED 567 S */
3505  rlDriverFillPayload(RL_RF_STATIC_CONF_SET_MSG, RL_RF_PH_SHIFT_CAL_DATA_RD_WR_SB,
3506  &inPayloadSb, (rlUInt8_t*)(&data->PhShiftcalibChunk[idx]),
3507  (rlUInt16_t)sizeof(rlPhShiftCalibrationStore_t));
3508 
3509  /* Construct response packet */
3510  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3511  /* Fill in-message Payload */
3512  rlDriverFillPayload(0U, 0U, &outPayloadSb, NULL, 0U);
3513 
3514  /* Send Command to mmWave Radar Device */
3515  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3516  /* check for return value */
3517  if (RL_RET_CODE_OK != retVal)
3518  {
3519  /* If command invoke is failed then terminate this loop */
3520  break;
3521  }
3522  }
3523 
3524  }
3525  return retVal;
3526 }
3527 
3542 /* DesignId : MMWL_DesignId_108 */
3543 /* Requirements : AUTORADAR_REQ-1003 */
3544 rlReturnVal_t rlRfPhShiftCalibDataStore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
3545 {
3546  rlReturnVal_t retVal;
3547 
3548  /* check if deviceIndex is out of defined value */
3549  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3550  {
3551  /* set return error code */
3552  retVal = RL_RET_CODE_INVALID_INPUT;
3553  }
3554  else
3555  {
3556  /* Initialize Command and Response Sub Blocks */
3557  rlDriverMsg_t inMsg = {0};
3558  rlDriverMsg_t outMsg = {0};
3559  rlPayloadSb_t inPayloadSb = {0};
3560  rlPayloadSb_t outPayloadSb = {0};
3561  rlPhShiftCalDataGetCfg_t phShifterCaldataGetCfg = {0U};
3562  rlUInt8_t idx;
3563  /* set return value to zero by default */
3564  /* AR_CODE_REVIEW MR:R.2.2 <REVIEWED> "retVal initialized to 0 if not it means error" */
3565  /*LDRA_INSPECTED 8 D */
3566  retVal = RL_RET_CODE_OK;
3567  /* Invoke Get Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3568  for (idx = 0U; idx < RL_TX_CNT; idx++)
3569  {
3570  if ((RL_NULL_PTR != &data->PhShiftcalibChunk[idx]))
3571  {
3572  phShifterCaldataGetCfg.txIndex = data->PhShiftcalibChunk[idx].txIndex;
3573  /* Construct command packet */
3574  rlDriverConstructInMsg(RL_RF_STATIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
3575  /* Fill in-message Payload */
3576  rlDriverFillPayload(RL_RF_STATIC_CONF_GET_MSG, RL_RF_PH_SHIFT_CAL_DATA_RD_WR_SB,
3577  &inPayloadSb, (rlUInt8_t*)&phShifterCaldataGetCfg,
3578  (rlUInt16_t)sizeof(rlPhShiftCalDataGetCfg_t));
3579 
3580  /* Construct response packet */
3581  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3582  /* Fill in-message Payload */
3583  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3584  next calibData */
3585  /*AR_CODE_REVIEW MR:R.18.4 <REVIEWED> "require pointer increment to jump to
3586  next calibData */
3587  /*LDRA_INSPECTED 87 S */
3588  /*LDRA_INSPECTED 567 S */
3589  rlDriverFillPayload(0U, 0U, &outPayloadSb,
3590  (rlUInt8_t*)(&data->PhShiftcalibChunk[idx]), 0U);
3591 
3592  /* Send Command to mmWave Radar Device */
3593  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3594  /* check for return value */
3595  if (RL_RET_CODE_OK != retVal)
3596  {
3597  /* If command invoke is failed then terminate this loop */
3598  break;
3599  }
3600  }
3601  }
3602  }
3603  return retVal;
3604 }
3605 
3616 /* DesignId : MMWL_DesignId_110 */
3617 /* Requirements : AUTORADAR_REQ-1004, AUTORADAR_REQ-1027 */
3618 rlReturnVal_t rlGetRfDieId(rlUInt8_t deviceMap, rlRfDieIdCfg_t *data)
3619 {
3620  rlReturnVal_t retVal;
3621 
3622  /* check for NULL pointer */
3623  if (data == RL_NULL_PTR)
3624  {
3625  /* set error code if data pointer is passed NULL */
3626  retVal = RL_RET_CODE_NULL_PTR;
3627  }
3628  else
3629  {
3630  /* Package the command with given data and send it to device */
3631  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3632  RL_RF_DIEID_STATUS_SB, (rlUInt8_t*)data, 0U);
3633  }
3634 
3635  return retVal;
3636 }
3637 
3648 /* DesignId : MMWL_DesignId_123 */
3649 /* Requirements : AUTORADAR_REQ-1039, AUTORADAR_REQ-1060 */
3650 rlReturnVal_t rlRfGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
3651 {
3652  rlReturnVal_t retVal;
3653 
3654  RL_LOGV_ARG0("rlRfGetCpuFault starts...\n");
3655 
3656  /* check if deviceIndex is out of defined value */
3657  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
3658  (RL_NULL_PTR == data))
3659  {
3660  /* set error code if DeviceMAP is invalid or data pointer is null */
3661  retVal = RL_RET_CODE_INVALID_INPUT;
3662  RL_LOGE_ARG0("Invalid input");
3663  }
3664  else
3665  {
3666  /* Package the command with given data and send it to device */
3667  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3668  RL_RF_RFCPUFAULT_STATUS_SB, (rlUInt8_t*)data,
3669  (rlUInt16_t)sizeof(rlCpuFault_t));
3670  }
3671  RL_LOGV_ARG0("rlRfGetCpuFault ends...\n");
3672 
3673  return retVal;
3674 }
3675 
3686 /* DesignId : MMWL_DesignId_123 */
3687 /* Requirements : AUTORADAR_REQ-1039 */
3688 rlReturnVal_t rlRfGetEsmFault(rlUInt8_t deviceMap, rlBssEsmFault_t *data)
3689 {
3690  rlReturnVal_t retVal;
3691 
3692  RL_LOGV_ARG0("rlRfGetEsmFault starts...\n");
3693 
3694  /* check if deviceIndex is out of defined value */
3695  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
3696  (RL_NULL_PTR == data))
3697  {
3698  /* set error code if DeviceMAP is invalid or data pointer is null */
3699  retVal = RL_RET_CODE_INVALID_INPUT;
3700  RL_LOGE_ARG0("Invalid input");
3701  }
3702  else
3703  {
3704  /* Package the command with given data and send it to device */
3705  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3706  RL_RF_RFESMFAULT_STATUS_SB, (rlUInt8_t*)data,
3707  (rlUInt16_t)sizeof(rlBssEsmFault_t));
3708  }
3709  RL_LOGV_ARG0("rlRfGetEsmFault ends...\n");
3710 
3711  return retVal;
3712 }
3713 
3792 /* DesignId : MMWL_DesignId_129 */
3793 /* Requirements : AUTORADAR_REQ-1050, AUTORADAR_REQ-1043 */
3794 rlReturnVal_t rlSetAdvChirpConfig(rlUInt8_t deviceMap, rlAdvChirpCfg_t *data)
3795 {
3796  rlReturnVal_t retVal;
3797 
3798  RL_LOGV_ARG0("rlSetAdvChirpConfig starts...\n");
3799 
3800  /* check if deviceIndex is out of defined value */
3801  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3802  {
3803  /* set return error code */
3804  retVal = RL_RET_CODE_INVALID_INPUT;
3805  RL_LOGE_ARG0("rlSetAdvChirpConfig, Invalid device map\n");
3806  }
3807  else
3808  {
3809  /* Package the command with given data and send it to device */
3810  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3811  RL_RF_ADV_CHIRP_CFG_SET_SB,
3812  (rlUInt8_t*)(data),
3813  (rlUInt16_t)sizeof(rlAdvChirpCfg_t));
3814  }
3815 
3816  RL_LOGV_ARG0("rlSetAdvChirpConfig ends...\n");
3817 
3818  return retVal;
3819 }
3820 
3862 /* DesignId : MMWL_DesignId_125 */
3863 /* Requirements : AUTORADAR_REQ-1055 */
3864 rlReturnVal_t rlMonTypeTrigConfig(rlUInt8_t deviceMap, rlMonTypeTrigCfg_t *data)
3865 {
3866  rlReturnVal_t retVal;
3867 
3868  RL_LOGV_ARG0("rlMonTypeTrigConfig starts...\n");
3869 
3870  /* check if deviceIndex is out of defined value */
3871  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3872  {
3873  /* set return error code */
3874  retVal = RL_RET_CODE_INVALID_INPUT;
3875  RL_LOGE_ARG0("rlMonTypeTrigConfig, Invalid device map\n");
3876  }
3877  else
3878  {
3879  /* Package the command with given data and send it to device */
3880  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3881  RL_RF_MONITOR_TYPE_TRIG_CONF_SB,
3882  (rlUInt8_t*)(data),
3883  (rlUInt16_t)sizeof(rlMonTypeTrigCfg_t));
3884  }
3885 
3886  RL_LOGV_ARG0("rlMonTypeTrigConfig ends...\n");
3887 
3888  return retVal;
3889 }
3890 
3906 /* DesignId : MMWL_DesignId_126 */
3907 /* Requirements : AUTORADAR_REQ-1053 */
3908 rlReturnVal_t rlRfApllSynthBwCtlConfig(rlUInt8_t deviceMap, rlRfApllSynthBwControl_t* data)
3909 {
3910  rlReturnVal_t retVal;
3911 
3912  /* check if deviceIndex is out of defined value */
3913  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
3914  (RL_NULL_PTR == data))
3915  {
3916  /* set return error code */
3917  retVal = RL_RET_CODE_INVALID_INPUT;
3918  }
3919  else
3920  {
3921  /* Package the command with given data and send it to device */
3922  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
3923  RL_RF_APLL_SYNTH_BW_CTL_SB,
3924  (rlUInt8_t*)data,
3925  (rlUInt16_t)sizeof(rlRfApllSynthBwControl_t));
3926  }
3927  return retVal;
3928 }
3929 
3959 /* DesignId : MMWL_DesignId_130 */
3960 /* Requirements : AUTORADAR_REQ-1050 */
3961 rlReturnVal_t rlSetAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *data)
3962 {
3963  rlReturnVal_t retVal;
3964 
3965  RL_LOGV_ARG0("rlSetAdvChirpLUTConfig starts...\n");
3966 
3967  /* check if deviceIndex is out of defined value */
3968  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3969  {
3970  /* set return error code */
3971  retVal = RL_RET_CODE_INVALID_INPUT;
3972  RL_LOGE_ARG0("rlSetAdvChirpLUTConfig, Invalid device map\n");
3973  }
3974  else
3975  {
3976  /* Package the command with given data and send it to device */
3977  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3978  RL_RF_ADV_CHIRP_CFG_LUT_SET_SB,
3979  (rlUInt8_t*)(data),
3980  (rlUInt16_t)sizeof(rlAdvChirpLUTCfg_t));
3981  }
3982 
3983  RL_LOGV_ARG0("rlSetAdvChirpLUTConfig ends...\n");
3984 
3985  return retVal;
3986 }
3987 
4006 /* DesignId : MMWL_DesignId_131 */
4007 /* Requirements : AUTORADAR_REQ-1050 */
4008 /*AR_CODE_REVIEW MR:R.2.2 <APPROVED> "numBytes is re initialized under different conditions" */
4009 /*LDRA_INSPECTED 8 D */
4010 rlReturnVal_t rlSetMultiAdvChirpLUTConfig(rlUInt8_t deviceMap,
4011  rlAdvChirpLUTCfg_t* AdvChirpLUTCfgArgs,
4012  rlInt8_t* AdvChirpLUTData)
4013 {
4014  rlReturnVal_t retVal = RL_RET_CODE_OK;
4015  /* Structure used to send the LUT RAM data to populate the LUT at the device end */
4016  rlAdvChirpLUTCfg_t AdvChirpLUTCfgChunk = { 0 };
4017  /* Variables to keep track of the number of chunks and the chunk size */
4018  rlUInt16_t chunkCount = 0U, totalChunkCount, lastChunkSize;
4019 
4020  RL_LOGV_ARG0("rlSetMultiAdvChirpLUTConfig starts...\n");
4021 
4022  /* check if deviceIndex is out of defined value */
4023  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
4024  (RL_NULL_PTR == AdvChirpLUTCfgArgs) || (RL_NULL_PTR == AdvChirpLUTData))
4025  {
4026  /* set return error code */
4027  retVal += RL_RET_CODE_INVALID_INPUT;
4028  RL_LOGE_ARG0("rlSetMultiAdvChirpLUTConfig, Invalid input params\n");
4029  }
4030  else
4031  {
4032  RL_LOGV_ARG2("rlSetMultiAdvChirpLUTConfig with \nlutAddOffset[%d]\nnumBytes[%d] \n\n",\
4033  AdvChirpLUTCfgArgs->lutAddressOffset, AdvChirpLUTCfgArgs->numBytes);
4034 
4035  /* If the LUT size to be programmed is more than 212 bytes, then break them into chunks
4036  of 212 bytes and send them one after the other over SPI */
4037  if (AdvChirpLUTCfgArgs->numBytes > RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE)
4038  {
4039  /* If the overall LUT size is a multiple of 212 bytes */
4040  if ((AdvChirpLUTCfgArgs->numBytes % RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE) == 0U)
4041  {
4042  lastChunkSize = RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE;
4043  totalChunkCount = \
4044  (rlUInt16_t)(AdvChirpLUTCfgArgs->numBytes / RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE);
4045  }
4046  /* Else, keep track of the remaining bytes in the last chunk */
4047  else
4048  {
4049  totalChunkCount = \
4050  (rlUInt16_t)((AdvChirpLUTCfgArgs->numBytes/RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE) + 1U);
4051  lastChunkSize = \
4052  (rlUInt16_t)(AdvChirpLUTCfgArgs->numBytes % RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE);
4053  }
4054  }
4055  /* If the total size of the LUT to be programmed is less than 212 bytes, it can be
4056  sent in a single chunk */
4057  else
4058  {
4059  totalChunkCount = 1U;
4060  /* last chunk size is same as total number of bytes in this case */
4061  lastChunkSize = AdvChirpLUTCfgArgs->numBytes;
4062  }
4063 
4064  while (chunkCount < totalChunkCount)
4065  {
4066  RL_LOGV_ARG1("Sending Advanced Chirp LUT data Chunk [%d]... \n\n", chunkCount);
4067  /* Update the LUT Address offset for every chunk */
4068  AdvChirpLUTCfgChunk.lutAddressOffset = \
4069  (rlUInt16_t)(AdvChirpLUTCfgArgs->lutAddressOffset + \
4070  (chunkCount * RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE));
4071 
4072  /* If the data belongs to last chunk or if it is a single chunk */
4073  if (chunkCount == (totalChunkCount - 1U))
4074  {
4075  AdvChirpLUTCfgChunk.numBytes = lastChunkSize;
4076  }
4077  /* For other intermediate chunks, send the entire length of 212 bytes */
4078  else
4079  {
4080  AdvChirpLUTCfgChunk.numBytes = RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE;
4081  }
4082 
4083  if (AdvChirpLUTCfgChunk.numBytes > 0U)
4084  {
4085  /* Copy the input AdvChirpLUTData to LUT structure */
4086  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
4087  /*LDRA_INSPECTED 436 S */
4088  (void)memcpy(&AdvChirpLUTCfgChunk.calData[0U], \
4089  &AdvChirpLUTData[AdvChirpLUTCfgChunk.lutAddressOffset], \
4090  AdvChirpLUTCfgChunk.numBytes);
4091 
4092  RL_LOGV_ARG2("rlSetAdvChirpLUTConfig with \nlutAddOffset[%d]\nnumBytes[%d] \n\n",\
4093  AdvChirpLUTCfgChunk.lutAddressOffset, AdvChirpLUTCfgChunk.numBytes);
4094  /* Send the LUT RAM structure (chunk) to the device */
4095  retVal += rlSetAdvChirpLUTConfig(deviceMap, &AdvChirpLUTCfgChunk);
4096 
4097  if (retVal != RL_RET_CODE_OK)
4098  {
4099  RL_LOGV_ARG2("Advanced Chirp LUT data Chunk [%d] failed with error code %d",\
4100  chunkCount, retVal);
4101  break;
4102  }
4103  }
4104  else
4105  {
4106  /* set return error code */
4107  retVal += RL_RET_CODE_INVALID_INPUT;
4108  RL_LOGV_ARG2("Invalid input, Chirp LUT Chunk [%d] is programmed with %d bytes",\
4109  chunkCount, AdvChirpLUTCfgChunk.numBytes);
4110  }
4111 
4112  chunkCount++;
4113  }
4114  }
4115 
4116  RL_LOGV_ARG0("rlSetMultiAdvChirpLUTConfig ends...\n");
4117 
4118  return retVal;
4119 }
4120 
4137 /* DesignId : MMWL_DesignId_132 */
4138 /* Requirements : AUTORADAR_REQ-1050 */
4139 rlReturnVal_t rlSetAdvChirpDynLUTAddrOffConfig(rlUInt8_t deviceMap, \
4141 {
4142  rlReturnVal_t retVal;
4143 
4144  RL_LOGV_ARG0("rlSetAdvChirpDynLUTAddrOffConfig starts...\n");
4145 
4146  /* check if deviceIndex is out of defined value */
4147  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
4148  {
4149  /* set return error code */
4150  retVal = RL_RET_CODE_INVALID_INPUT;
4151  RL_LOGE_ARG0("rlSetAdvChirpDynLUTAddrOffConfig, Invalid device map\n");
4152  }
4153  else
4154  {
4155  /* Package the command with given data and send it to device */
4156  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
4157  RL_RF_ADV_CHIRP_DYN_LUT_ADD_OFF_CONF_SB,
4158  (rlUInt8_t*)(data),
4159  (rlUInt16_t)sizeof(rlAdvChirpDynLUTAddrOffCfg_t));
4160  }
4161 
4162  RL_LOGV_ARG0("rlSetAdvChirpDynLUTAddrOffConfig ends...\n");
4163 
4164  return retVal;
4165 }
4166 
4167 /*
4168  * END OF rl_sensor.c FILE
4169  */
Radar RF LDO bypass enable/disable configuration.
Definition: rl_sensor.h:2082
ADC format and payload justification Configuration.
Definition: rl_sensor.h:366
rlReturnVal_t rlSetInterChirpBlkCtrl(rlUInt8_t deviceMap, rlInterChirpBlkCtrlCfg_t *data)
Sets Inter-chip turn on and turn off times or various RF blocks.
Definition: rl_sensor.c:3380
rlReturnVal_t rlGetRfBootupStatus(rlUInt8_t deviceMap, rlRfBootStatusCfg_t *data)
Get radarSS bootup status.
Definition: rl_sensor.c:3338
Test source Enable API parameters RL_RF_TEST_SOURCE_ENABLE_SB.
Definition: rl_sensor.h:1718
Radar RF Calibration monitoring time unit configuration.
Definition: rl_sensor.h:2581
rlReturnVal_t rlSetTestSourceConfig(rlUInt8_t deviceMap, rlTestSource_t *data)
Configures the Test Source.
Definition: rl_sensor.c:1637
Advanced chirp configuration structure.
Definition: rl_sensor.h:4639
Advance Frame Sequence config API parameters rlAdvFrameCfg, 148 bytes.
Definition: rl_sensor.h:1368
rlReturnVal_t rlSetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlProfileCfg_t *data)
Sets Chirp profile Configuration.
Definition: rl_sensor.c:429
rlReturnVal_t rlFrameStartStop(rlUInt8_t deviceMap, rlFrameTrigger_t *data)
Triggers/Stops Transmission of Frames.
Definition: rl_sensor.c:1536
Die ID data structure.
Definition: rl_sensor.h:4600
rlReturnVal_t rlRfInterRxGainPhaseConfig(rlUInt8_t deviceMap, rlInterRxGainPhConf_t *data)
Sets different Rx gain/phase offset.
Definition: rl_sensor.c:3305
rlReturnVal_t rlTxGainTempLutSet(rlUInt8_t deviceMap, rlTxGainTempLutData_t *data)
Overwrites TX gain temperature based Lookup table (LUT)
Definition: rl_sensor.c:2654
API radarSS GPADC API MEAS SET SBC M_API_AR_RF_GPADC_API_SET_SB.
Definition: rl_sensor.h:2016
Dynamic chirp enable configuration.
Definition: rl_sensor.h:3936
rlReturnVal_t rlRfGetTemperatureReport(rlUInt8_t deviceMap, rlRfTempData_t *data)
Gets Time and Temperature information report.
Definition: rl_sensor.c:1715
rlReturnVal_t rlGetRfDieId(rlUInt8_t deviceMap, rlRfDieIdCfg_t *data)
Get device die ID status.
Definition: rl_sensor.c:3618
Structure to hold the BSS ESM Fault data strucutre for event RL_RF_AE_ESMFAULT_SB.
Definition: mmwavelink.h:2012
rlReturnVal_t rlSetAdvChirpDynLUTAddrOffConfig(rlUInt8_t deviceMap, rlAdvChirpDynLUTAddrOffCfg_t *data)
Configure LUT address offset dynamically for each chirp parameters defined in rlSetAdvChirpConfig API...
Definition: rl_sensor.c:4139
Structure to store all Phase shifter calibration data chunks which device provides in response of rlR...
Definition: rl_sensor.h:4592
Radar RF Phase shift loopback configuration.
Definition: rl_sensor.h:2262
rlReturnVal_t rlRfGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
Get RadarSS CPU fault status.
Definition: rl_sensor.c:3650
rlReturnVal_t rlRfSetMiscConfig(rlUInt8_t deviceMap, rlRfMiscConf_t *data)
Sets misc feature such as per chirp phase shifter.
Definition: rl_sensor.c:2330
rlReturnVal_t rlTestSourceEnable(rlUInt8_t deviceMap, rlTestSourceEnable_t *data)
Enables the Test Source.
Definition: rl_sensor.c:1676
rlUInt16_t numBytes
Number of valid bytes to write. Valid range: 4 to 212, must be multiple of 4. .
Definition: rl_sensor.h:5047
rlReturnVal_t rlRfRunTimeCalibConfig(rlUInt8_t deviceMap, rlRunTimeCalibConf_t *data)
Set RF one time & periodic calibration of various RF/analog aspects and trigger.
Definition: rl_sensor.c:2518
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
RX gain temperature LUT inject.
Definition: rl_sensor.h:3143
Test source config API parameters E_API_AR_TEST_SOURCE_CONF_SB.
Definition: rl_sensor.h:1664
rlReturnVal_t rlSetLowPowerModeConfig(rlUInt8_t deviceMap, rlLowPowerModeCfg_t *data)
Sets Low Power Mode Configuration.
Definition: rl_sensor.c:1380
Tx freq and power limit configuration.
Definition: rl_sensor.h:3332
rlReturnVal_t rlGetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t profileId, rlProfileCfg_t *data)
Gets Chirp profile Configuration.
Definition: rl_sensor.c:515
rlReturnVal_t rlRfInit(rlUInt8_t deviceMap)
Initializes the RF/Analog Subsystem.
Definition: rl_sensor.c:1591
rlUInt8_t rlDriverGetPlatformId(void)
Returns RL Platform ID (i.e. where mmWaveLink is executing)
Definition: rl_driver.c:2302
Get phase shift calibration data configuration structure.
Definition: rl_sensor.h:4505
Chirp config API parameters. This structure contains fine dithering to coarse profile defined in rlPr...
Definition: rl_sensor.h:866
rlReturnVal_t rlRfGetEsmFault(rlUInt8_t deviceMap, rlBssEsmFault_t *data)
Get RadarSS ESM fault status.
Definition: rl_sensor.c:3688
Frame config API parameters.
Definition: rl_sensor.h:944
rlReturnVal_t rlRfSetCalMonFreqLimitConfig(rlUInt8_t deviceMap, rlRfCalMonFreqLimitConf_t *data)
Set Calibration monitoring Frequency Limit.
Definition: rl_sensor.c:2427
rlReturnVal_t rlMonTypeTrigConfig(rlUInt8_t deviceMap, rlMonTypeTrigCfg_t *data)
Maintains monitoring timing synchronization in cascaded devices to avoid mutual interference of monit...
Definition: rl_sensor.c:3864
rlReturnVal_t rlSetAdcOutConfig(rlUInt8_t deviceMap, rlAdcOutCfg_t *data)
Sets ADC Output Configuration.
Definition: rl_sensor.c:151
Radar RF Init Calibration configuration.
Definition: rl_sensor.h:2708
rlReturnVal_t rlRfDynamicPowerSave(rlUInt8_t deviceMap, rlDynPwrSave_t *data)
: Configure dynamic power saving feature.
Definition: rl_sensor.c:1804
rlReturnVal_t rlRfSetCalMonTimeUnitConfig(rlUInt8_t deviceMap, rlRfCalMonTimeUntConf_t *data)
Set Calibration monitoring time unit.
Definition: rl_sensor.c:2377
Phase shift calibration data which application will receive from radarSS and will feed in to the Devi...
Definition: rl_sensor.h:4540
Low Power mode configuration.
Definition: rl_sensor.h:531
rlReturnVal_t rlRfTxFreqPwrLimitConfig(rlUInt8_t deviceMap, rlRfTxFreqPwrLimitMonConf_t *data)
Sets the limits for RF frequency transmission for each TX and also TX power limits.
Definition: rl_sensor.c:2759
Sub-frame trigger API.
Definition: rl_sensor.h:4488
rlReturnVal_t rlRfPhShiftCalibDataRestore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
Injects phase shifter calibration data to the device.
Definition: rl_sensor.c:3469
Dynamic power saving API parameters.
Definition: rl_sensor.h:1824
rlReturnVal_t rlGetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t *data)
Gets Frame Configuration.
Definition: rl_sensor.c:1067
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
rlInt8_t calData[RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE]
Byte array to load in to the Generic SW Chirp Parameter LUT. The size of this sub-block is fixed to...
Definition: rl_sensor.h:5053
rlUInt8_t calibApply
Set this to 1 after injecting calibration data for all Txs to enable the firmware calibration....
Definition: rl_sensor.h:4553
API RF device Config SBC M_API_AR_RF_DEV_CONF_SBC.
Definition: rl_sensor.h:1850
rlReturnVal_t rlRfSetPSLoopbackConfig(rlUInt8_t deviceMap, rlRfPSLoopbackCfg_t *data)
Enable/Disable Phase shift loopback for all enabled profiles.
Definition: rl_sensor.c:2156
Radar RF Phase Shift enable/disable configuration.
Definition: rl_sensor.h:2149
rlReturnVal_t rlRfSetPhaseShiftConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlRfPhaseShiftCfg_t *data)
Enable/Disable phase shift configurations per chirp in each of the TXs.
Definition: rl_sensor.c:1992
rlReturnVal_t rlSensorStop(rlUInt8_t deviceMap)
Stops Transmission of Frames.
Definition: rl_sensor.c:1477
rlUInt16_t nsbc
Number of Sub Blocks in Payload.
Definition: rl_driver.h:343
Radar RF Calibration monitoring Frequency Limit configuration.
Definition: rl_sensor.h:2668
RF characterization Time and Temperature data structure.
Definition: rl_sensor.h:1733
Frame config API parameters.
Definition: rl_sensor.h:1246
TX gain temperature LUT read.
Definition: rl_sensor.h:3113
Array of coefficients for the RF programmable filter.
Definition: rl_sensor.h:2425
rlReturnVal_t rlSetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t *data)
Sets Advance Frame Configuration.
Definition: rl_sensor.c:1178
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
Get calibration data configuration structure.
Definition: rl_sensor.h:4025
Advanced Chirp Dynamic LUT Address Offset Configuration Structure Configure LUT address offset dynami...
Definition: rl_sensor.h:5060
Radar RF IF loopback configuration.
Definition: rl_sensor.h:2378
rlReturnVal_t rlRfPhShiftCalibDataStore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
Read calibration data from the device.
Definition: rl_sensor.c:3544
rlReturnVal_t rlSetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t *data)
Sets Frame Configuration.
Definition: rl_sensor.c:1007
MMWL_EXPORT rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t *data)
Sets Advance Frame data path Configuration.
Definition: rl_device.c:2081
Dynamic chirp configuration for 16 chirp configurations.
Definition: rl_sensor.h:3863
rlReturnVal_t rlRfCalibDataStore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
Read calibration data from the device.
Definition: rl_sensor.c:3224
rlReturnVal_t rlEnableContMode(rlUInt8_t deviceMap, rlContModeEn_t *data)
Enable/Disable Continous mode.
Definition: rl_sensor.c:1336
rlReturnVal_t rlRxGainTempLutSet(rlUInt8_t deviceMap, rlRxGainTempLutData_t *data)
Overwrite RX gain temperature Lookup Table(LUT) in Radar SS.
Definition: rl_sensor.c:2558
rlReturnVal_t rlSetContModeConfig(rlUInt8_t deviceMap, rlContModeCfg_t *data)
Sets Continous mode Configuration.
Definition: rl_sensor.c:1297
rlUInt16_t lutAddressOffset
Start address offset at which to populate the bytes of patterns. Address offset has to be multiple ...
Definition: rl_sensor.h:5042
rlReturnVal_t rlRfCalibDataRestore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
Injects calibration data to the device.
Definition: rl_sensor.c:3143
MMWL_EXPORT rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t *data)
Sets Frame data path Configuration.
Definition: rl_device.c:2130
Calibration data which application will receive from radarSS and will feed in to the Device in next p...
Definition: rl_sensor.h:4041
APLL Synthesizer Bandwidth Control.
Definition: rl_sensor.h:4977
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
rlReturnVal_t rlSetMultiBpmChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlBpmChirpCfg_t **data)
Sets Binary Phase Modulation configuration for multiple Chirp.
Definition: rl_sensor.c:280
rlReturnVal_t rlRfSetDeviceCfg(rlUInt8_t deviceMap, rlRfDevCfg_t *data)
: Set different RadarSS device configurations
Definition: rl_sensor.c:1853
Binary phase modulation common configuration.
Definition: rl_sensor.h:499
The DFE Statistics Report Contents.
Definition: rl_sensor.h:1813
rlUInt8_t txIndex
Index of the transmitter channel for which the phase shift is desired Valid range: 0 to (Number of ...
Definition: rl_sensor.h:4548
Dynamic per chirp phase shifter configuration.
Definition: rl_sensor.h:3981
mmwave radar Driver Payload
Definition: rl_driver.h:349
TX gain temperature LUT inject.
Definition: rl_sensor.h:3244
rlUInt16_t startStop
Start/Stop Frame 0x0000 - Stop the transmission of frames after the current frame 0x0001 - Trigge...
Definition: rl_sensor.h:1566
rlReturnVal_t rlSetChannelConfig(rlUInt8_t deviceMap, rlChanCfg_t *data)
Sets the Rx and Tx Channel Configuration.
Definition: rl_sensor.c:106
Rx/Tx Channel Configuration.
Definition: rl_sensor.h:220
rlReturnVal_t rlSetBpmChirpConfig(rlUInt8_t deviceMap, rlBpmChirpCfg_t *data)
Sets Binary Phase Modulation Chirp Configuration.
Definition: rl_sensor.c:237
Radar RF PA loopback configuration.
Definition: rl_sensor.h:2223
rlReturnVal_t rlSetSubFrameStart(rlUInt8_t deviceMap, rlSubFrameStartCfg_t *data)
Triggers the next sub-frame in software triggered sub-frame mode.
Definition: rl_sensor.c:3431
rlReturnVal_t rlSetGpAdcConfig(rlUInt8_t deviceMap, rlGpAdcCfg_t *data)
: Configure GP ADC data parameters
Definition: rl_sensor.c:1898
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
Binary phase modulation common configuration.
Definition: rl_sensor.h:468
Radar RF Miscconfiguration.
Definition: rl_sensor.h:2548
rlUInt16_t reserved
Reserved for Future use.
Definition: rl_sensor.h:1570
Inter Chirp block control configuration.
Definition: rl_sensor.h:4373
Structure to store all Calibration data chunks which device provides in response of rlRfCalibDataStor...
Definition: rl_sensor.h:4147
rlReturnVal_t rlSetDynPerChirpPhShifterCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt, rlDynPerChirpPhShftCfg_t **data)
Injects per-chirp phase shifter configuration to be applied dynamically.
Definition: rl_sensor.c:3016
rlAdvFrameDataCfg_t frameData
Advance Frame data configuration. Applicable with AWR1243/2243 device only.
Definition: rl_sensor.h:1377
rlReturnVal_t rlSetBpmCommonConfig(rlUInt8_t deviceMap, rlBpmCommonCfg_t *data)
Sets Binary Phase Modulation Common Configuration.
Definition: rl_sensor.c:196
rlUInt16_t reserved
Reserved for Future use.
Definition: rl_sensor.h:1263
rlReturnVal_t rlSetDynChirpCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt, rlDynChirpCfg_t **data)
Injects chirp configuration to be programmed dynamically.
Definition: rl_sensor.c:2845
Radar RF Run time calibration configuration.
Definition: rl_sensor.h:2770
Advance Frame Sequence config API parameters rlAdvFrameCfg, 148 bytes.
Definition: rl_sensor.h:1130
Continous Mode Enable API parameters.
Definition: rl_sensor.h:1534
Radar RF programmable filter configuration.
Definition: rl_sensor.h:2476
Advanced Chirp LUT Configuration Structure Load a generic chirp parameter LUT (firmware RAM of size 1...
Definition: rl_sensor.h:5024
Monitor Type Trigger configuration structure.
Definition: rl_sensor.h:4937
rlReturnVal_t rlRfSetPALoopbackConfig(rlUInt8_t deviceMap, rlRfPALoopbackCfg_t *data)
Enable/Disable PA loopback for all enabled profiles.
Definition: rl_sensor.c:2115
Structure to hold the MSS/radarSS CPU Fault data strucutre for event RL_DEV_AE_MSS_CPUFAULT_SB and RL...
Definition: mmwavelink.h:2273
Profile config API parameters. A profile contains coarse parameters of FMCW chirp such as start frequ...
Definition: rl_sensor.h:550
Chirp start, end Index parameters for rlGetChirpConfig.
Definition: rl_sensor.h:935
rlReturnVal_t rlRfSetProgFiltCoeffRam(rlUInt8_t deviceMap, rlRfProgFiltCoeff_t *data)
Set Programmable Filter coefficient RAM.
Definition: rl_sensor.c:2246
rlUInt32_t numChirps
Number of Chirps per Frame.
Definition: rl_sensor.h:1251
rlReturnVal_t rlGetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t *data)
Gets Advance Frame Configuration.
Definition: rl_sensor.c:1225
Continous Mode config API parameters.
Definition: rl_sensor.h:1383
Loopback burst set configuration.
Definition: rl_sensor.h:3477
RX gain temperature LUT read.
Definition: rl_sensor.h:3083
rlReturnVal_t rlSetMultiAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *AdvChirpLUTCfgArgs, rlInt8_t *AdvChirpLUTData)
Multi Advanced chirp LUT configuration API.
Definition: rl_sensor.c:4010
BSS Bootup status data structure.
Definition: rl_sensor.h:4320
rlReturnVal_t rlSetAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *data)
Set the Advanced chirp LUT configuration to the device.
Definition: rl_sensor.c:3961
rlReturnVal_t rlSensorStart(rlUInt8_t deviceMap)
Triggers Transmission of Frames.
Definition: rl_sensor.c:1424
rlReturnVal_t rlSetDynChirpEn(rlUInt8_t deviceMap, rlDynChirpEnCfg_t *data)
Triggers copy of chirp config from SW to HW RAM.
Definition: rl_sensor.c:2968
rlReturnVal_t rlRfSetProgFiltConfig(rlUInt8_t deviceMap, rlRfProgFiltConf_t *data)
Set Programmable Filter configuration.
Definition: rl_sensor.c:2288
rlReturnVal_t rlRfSetIFLoopbackConfig(rlUInt8_t deviceMap, rlRfIFLoopbackCfg_t *data)
Enable/Disable RF IF loopback for all enabled profiles. This is used for debug to check if both TX an...
Definition: rl_sensor.c:2198
rlReturnVal_t rlSetMultiChirpCfg(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t **data)
Injects chirp configuration to be programmed dynamically.
Definition: rl_sensor.c:851
rlReturnVal_t rlSetAdvChirpConfig(rlUInt8_t deviceMap, rlAdvChirpCfg_t *data)
Set the Advanced chirp configuration to the device.
Definition: rl_sensor.c:3794
Frame Trigger API parameters RL_RF_FRAMESTARTSTOP_CONF_SB.
Definition: rl_sensor.h:1551
rlReturnVal_t rlRfInitCalibConfig(rlUInt8_t deviceMap, rlRfInitCalConf_t *data)
Set RF Init Calibration Mask bits and report type.
Definition: rl_sensor.c:2474
rlUInt16_t numAdcSamples
Number of half words in ADC buffer per chirp Example 1: In real mode, if number of ADC samples per ...
Definition: rl_sensor.h:1259
rlReturnVal_t rlSetLoopBckBurstCfg(rlUInt8_t deviceMap, rlLoopbackBurst_t *data)
This API is used to introduce loopback chirps within the functional frames.
Definition: rl_sensor.c:2806
Inter-Rx gain and phase offset configuration.
Definition: rl_sensor.h:4155
rlReturnVal_t rlRfDfeRxStatisticsReport(rlUInt8_t deviceMap, rlDfeStatReport_t *data)
Gets Digital Front end statistics such as Residual DC, RMS power in I and Q chains for different Rece...
Definition: rl_sensor.c:1756
rlReturnVal_t rlRfApllSynthBwCtlConfig(rlUInt8_t deviceMap, rlRfApllSynthBwControl_t *data)
Control bandwidth of the APLL and Synthesizer.
Definition: rl_sensor.c:3908
rlReturnVal_t rlGetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t chirpStartIdx, rlUInt16_t chirpEndIdx, rlChirpCfg_t *data)
Gets Chirp Configuration.
Definition: rl_sensor.c:713
rlUInt8_t txIndex
Index of the transmitter channel for which the phase shift is desired Valid range: 0 to (Number of ...
Definition: rl_sensor.h:4513
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 rlSetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t *data)
Sets Chirp Configuration.
Definition: rl_sensor.c:589
rlReturnVal_t rlDriverIsDeviceMapValid(rlUInt8_t deviceMap)
Checks if given deviecMap is valid wrt to global DeviceMap set to mmWaveLink.
Definition: rl_driver.c:2339
rlAdvFrameSeqCfg_t frameSeq
Advance Frame sequence and Subframe configuration.
Definition: rl_sensor.h:1373

Copyright 2020, Texas Instruments Incorporated