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 /* Sub block ID: 0x0080, ICD API: AWR_CHAN_CONF_SET_SB */
105 /* DesignId : MMWL_DesignId_009 */
106 /* Requirements : AUTORADAR_REQ-752, AUTORADAR_REQ-757, AUTORADAR_REQ-970 */
107 rlReturnVal_t rlSetChannelConfig(rlUInt8_t deviceMap, rlChanCfg_t* data)
108 {
109  rlReturnVal_t retVal;
110 
111  /* check if deviceIndex is out of defined value */
112  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
113  {
114  /* set return error code */
115  retVal = RL_RET_CODE_INVALID_INPUT;
116  }
117  else
118  {
119  /* Package the command with given data and send it to device */
120  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
121  RL_RF_CHAN_CONF_SB, (rlUInt8_t*)data,
122  (rlUInt16_t)sizeof(rlChanCfg_t));
123  }
124 
125  RL_LOGV_ARG0("rlSetChannelConfig ends...\n");
126  return retVal;
127 
128 }
129 
150 /* Sub block ID: 0x0082, ICD API: AWR_ADCOUT_CONF_SET_SB */
151 /* DesignId : MMWL_DesignId_010 */
152 /* Requirements : AUTORADAR_REQ-753, AUTORADAR_REQ-754 */
153 rlReturnVal_t rlSetAdcOutConfig(rlUInt8_t deviceMap, rlAdcOutCfg_t* data)
154 {
155  rlReturnVal_t retVal;
156 
157  RL_LOGV_ARG0("rlSetAdcOutConfig starts...\n");
158 
159  /* check if deviceIndex is out of defined value */
160  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
161  (RL_NULL_PTR == data))
162  {
163  /* set return error code */
164  retVal = RL_RET_CODE_INVALID_INPUT;
165  RL_LOGE_ARG0("rlSetAdcOutConfig, Invalid device map\n");
166  }
167  else
168  {
169  /* Package the command with given data and send it to device */
170  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
171  RL_RF_ADCOUT_CONF_SB, (rlUInt8_t*)data,
172  (rlUInt16_t)sizeof(rlAdcOutCfg_t));
173  }
174 
175  RL_LOGV_ARG0("rlSetAdcOutConfig ends...\n");
176 
177  return retVal;
178 }
179 
196 /* Sub block ID: 0x0180, ICD API: AWR_BPM_COMMON_CONF_SET_SB */
197 /* DesignId : MMWL_DesignId_016 */
198 /* Requirements : AUTORADAR_REQ-724 */
199 rlReturnVal_t rlSetBpmCommonConfig(rlUInt8_t deviceMap, rlBpmCommonCfg_t* data)
200 {
201  rlReturnVal_t retVal;
202 
203  RL_LOGV_ARG0("rlSetBpmCommonConfig starts...\n");
204 
205  /* check if deviceIndex is out of defined value */
206  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
207  (RL_NULL_PTR == data))
208  {
209  /* set return error code */
210  retVal = RL_RET_CODE_INVALID_INPUT;
211  RL_LOGE_ARG0("rlSetBpmCommonConfig, Invalid device map\n");
212  }
213  else
214  {
215  /* Package the command with given data and send it to device */
216  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_ADVANCED_FEATURES_SET_MSG,
217  RL_RF_BPM_COMMON_CONF_SB, (rlUInt8_t*)data,
218  (rlUInt16_t)sizeof(rlBpmCommonCfg_t));
219  }
220  RL_LOGV_ARG0("rlSetBpmCommonConfig ends...\n");
221 
222  return retVal;
223 }
224 
238 /* Sub block ID: 0x0181, ICD API: AWR_BPM_CHIRP_CONF_SET_SB */
239 /* DesignId : MMWL_DesignId_037 */
240 /* Requirements : AUTORADAR_REQ-727 */
241 rlReturnVal_t rlSetBpmChirpConfig(rlUInt8_t deviceMap, rlBpmChirpCfg_t* data)
242 {
243  rlReturnVal_t retVal;
244 
245  RL_LOGV_ARG0("rlSetBpmChirpConfig starts...\n");
246 
247  /* check if deviceIndex is out of defined value */
248  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
249  (RL_NULL_PTR == data))
250  {
251  /* set return error code */
252  retVal = RL_RET_CODE_INVALID_INPUT;
253  RL_LOGE_ARG0("rlSetBpmChirpConfig, Invalid device map\n");
254  }
255  else
256  {
257  /* Package the command with given data and send it to device */
258  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_ADVANCED_FEATURES_SET_MSG,
259  RL_RF_BPM_CHIRP_CONF_SB, (rlUInt8_t*)data,
260  (rlUInt16_t)sizeof(rlBpmChirpCfg_t));
261  }
262 
263  RL_LOGV_ARG0("rlSetBpmChirpConfig ends...\n");
264 
265  return retVal;
266 }
267 
282 /* Sub block ID: 0x0181, ICD API: AWR_BPM_CHIRP_CONF_SET_SB */
283 /* DesignId : MMWL_DesignId_122 */
284 /* Requirements : AUTORADAR_REQ-727 */
285 rlReturnVal_t rlSetMultiBpmChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
286  rlBpmChirpCfg_t** data)
287 {
288  rlReturnVal_t retVal;
289  RL_LOGV_ARG0("rlSetMultiBpmChirpConfig starts...\n");
290 
291  /* check if deviceIndex is out of defined value */
292  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
293  (cnt == 0U))
294  {
295  /* set return error code */
296  retVal = RL_RET_CODE_INVALID_INPUT;
297  }
298  else
299  {
300  /* Initialize Command and Response Sub Blocks */
301  rlDriverMsg_t inMsg;
302  rlDriverMsg_t outMsg = {0};
303 
304  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
305  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
306 
307 
308  /* Initialize Command and Response Sub Blocks */
309  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlBpmChirpCfg_t) + \
310  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
311 
312  /* single sub-block length for chirp config API */
313  sbLen = (rlUInt16_t)(sizeof(rlBpmChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
314 
315  /* get Max Sub Block count */
316  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
317  /*LDRA_INSPECTED 127 D */
318  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
319 
320  retVal = RL_RET_CODE_OK;
321  /* if requested count of chirpConfig is within one Message packet */
322  if (cnt <= maxSbCntInMsg)
323  {
324  sbCntInMsg = cnt;
325  numChnkOfMsg = 1U;
326  lastSbCntInMsg = 0U;
327  }
328  else
329  {
330  sbCntInMsg = maxSbCntInMsg;
331  numChnkOfMsg = cnt / maxSbCntInMsg;
332  lastSbCntInMsg = cnt % maxSbCntInMsg;
333  }
334 
335  /* Fill in-message packet */
336  rlDriverConstructInMsg(RL_RF_ADVANCED_FEATURES_SET_MSG, &inMsg, &inPayloadSb[0]);
337 
338  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
339 
340  while (retVal == RL_RET_CODE_OK)
341  {
342  /* all full messages have been sent, then send last partial message */
343  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
344  {
345  inMsg.opcode.nsbc = lastSbCntInMsg;
346  }
347  else
348  {
349  inMsg.opcode.nsbc = sbCntInMsg;
350  }
351 
352  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
353  {
354  /* Set Command Sub Block*/
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].sbid = RL_GET_UNIQUE_SBID(RL_RF_ADVANCED_FEATURES_SET_MSG,
359  RL_RF_BPM_CHIRP_CONF_SB);
360  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
361  LDRA Tool Issue" */
362  /*LDRA_INSPECTED 105 D */
363  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlBpmChirpCfg_t);
364  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
365  LDRA Tool Issue" */
366  /*LDRA_INSPECTED 105 D */
367  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
368 
369  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
370  next profile Config */
371  /*LDRA_INSPECTED 567 S */
372  data++;
373  }
374  /* Send Command to mmWave Radar Device */
375  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
376  loopCnt--;
377 
378  if (loopCnt == 0U)
379  {
380  break;
381  }
382  }
383  }
384  RL_LOGV_ARG0("rlSetMultiBpmChirpConfig ends...\n");
385 
386  return retVal;
387 }
388 
427 /* Sub block ID: 0x0100, ICD API: AWR_PROFILE_CONF_SET_SB */
428 /* DesignId : MMWL_DesignId_013 */
429 /* Requirements : AUTORADAR_REQ-728, AUTORADAR_REQ-729, AUTORADAR_REQ-730, AUTORADAR_REQ-731,
430  AUTORADAR_REQ-732, AUTORADAR_REQ-733, AUTORADAR_REQ-734, AUTORADAR_REQ-735,
431  AUTORADAR_REQ-736, AUTORADAR_REQ-737, AUTORADAR_REQ-738, AUTORADAR_REQ-739,
432  AUTORADAR_REQ-740, AUTORADAR_REQ-741, AUTORADAR_REQ-742, AUTORADAR_REQ-743,
433  AUTORADAR_REQ-773
434  */
435 rlReturnVal_t rlSetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
436  rlProfileCfg_t* data)
437 {
438  rlReturnVal_t retVal;
439 
440  RL_LOGV_ARG0("rlSetProfileConfig starts...\n");
441 
442  /* check if deviceIndex is out of defined value */
443  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
444  (RL_NULL_PTR == data) || (cnt == 0U))
445  {
446  /* set return error code */
447  retVal = RL_RET_CODE_INVALID_INPUT;
448  RL_LOGE_ARG0("rlSetProfileConfig, Invalid device map\n");
449  }
450  else
451  {
452  rlDriverMsg_t inMsg = {0};
453  rlDriverMsg_t outMsg = {0};
454 
455  /* Initialize Command and Response Sub Blocks */
456  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlProfileCfg_t) + \
457  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
458  /* Variable to count message chunks */
459  rlUInt16_t indx;
460  rlUInt16_t sbCntInAllChunk = 0U;
461  rlUInt16_t maxSbInMsg = (RL_CMD_PL_LEN_MAX /(sizeof(rlProfileCfg_t) + \
462  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE));
463 
464  /* Construct command packet */
465  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
466 
467  retVal = RL_RET_CODE_OK;
468  /* Loop to copy all the command data to one message */
469  for (indx = 0U; (indx < cnt) && (retVal == RL_RET_CODE_OK); indx++)
470  {
471  /* Fill in-message payload */
472  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
473  next profile Config */
474  /*AR_CODE_REVIEW MR:R.18.4 <APPROVED> "require pointer increment to jump to
475  next profile Config */
476  /*LDRA_INSPECTED 87 S */
477  /*LDRA_INSPECTED 567 S */
478  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_SET_MSG, RL_RF_PROFILE_CONF_SB,
479  &inPayloadSb[indx], (rlUInt8_t*)(data + indx),
480  (rlUInt16_t)sizeof(rlProfileCfg_t));
481 
482  /* increment Sub-block count in one packet */
483  sbCntInAllChunk++;
484 
485  /* check if total payload length is going beyond defined limitation */
486  if ((maxSbInMsg == (indx + 1U)) || (cnt == sbCntInAllChunk))
487  {
488  /* setting of numSBC to inMsg */
489  inMsg.opcode.nsbc = (indx + 1U);
490  /* Send Command to mmWave Radar Device */
491  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
492  }
493  }
494  }
495 
496  RL_LOGV_ARG0("rlSetProfileConfig ends...\n");
497 
498  return retVal;
499 }
500 
514 /* Sub block ID: 0x0120, ICD API: AWR_PROFILE_CONF_GET_SB */
515 /* DesignId : MMWL_DesignId_118 */
516 /* Requirements : AUTORADAR_REQ-728, AUTORADAR_REQ-729, AUTORADAR_REQ-730, AUTORADAR_REQ-731,
517 AUTORADAR_REQ-732, AUTORADAR_REQ-733, AUTORADAR_REQ-734, AUTORADAR_REQ-735,
518 AUTORADAR_REQ-736, AUTORADAR_REQ-737, AUTORADAR_REQ-738, AUTORADAR_REQ-739,
519 AUTORADAR_REQ-740, AUTORADAR_REQ-741, AUTORADAR_REQ-742, AUTORADAR_REQ-743,
520 AUTORADAR_REQ-773
521 */
522 rlReturnVal_t rlGetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t profileId, rlProfileCfg_t* data)
523 {
524  rlReturnVal_t retVal;
525 
526  RL_LOGV_ARG0("rlGetProfileConfig ends...\n");
527 
528  /* check if deviceIndex is out of defined value */
529  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
530  (RL_NULL_PTR == data))
531  {
532  /* set return error code */
533  retVal = RL_RET_CODE_INVALID_INPUT;
534  RL_LOGE_ARG0("rlGetProfileConfig, Invalid device map\n");
535  }
536  else
537  {
538  /* Initialize Command and Response Sub Blocks */
539  rlDriverMsg_t inMsg = {0};
540  rlDriverMsg_t outMsg = {0};
541  rlPayloadSb_t inPayloadSb = {0};
542  rlPayloadSb_t outPayloadSb = {0};
543  rlWordParam_t wordParam;
544  /* combine half words into WORD structure */
545  wordParam.halfWordOne = profileId;
546  wordParam.halfWordTwo = 0U;
547 
548  /* Construct command packet */
549  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
550  /* Fill in-message Payload */
551  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_PROFILE_CONF_SB, &inPayloadSb,
552  (rlUInt8_t*)&wordParam, (rlUInt16_t)sizeof(rlWordParam_t));
553 
554  /* Construct response packet */
555  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
556  /* Fill in-message Payload */
557  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)data, 0U);
558 
559  /* Send Command to mmWave Radar Device */
560  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
561  }
562 
563  RL_LOGV_ARG0("rlGetProfileConfig ends...\n");
564  return retVal;
565 }
566 
591 /* Sub block ID: 0x0101, ICD API: AWR_CHIRP_CONF_SET_SB */
592 /* DesignId : MMWL_DesignId_014 */
593 /* Requirements : AUTORADAR_REQ-744, AUTORADAR_REQ-745, AUTORADAR_REQ-746, AUTORADAR_REQ-747,
594  AUTORADAR_REQ-748, AUTORADAR_REQ-749, AUTORADAR_REQ-750, AUTORADAR_REQ-751,
595  AUTORADAR_REQ-773
596  */
597 rlReturnVal_t rlSetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t* data)
598 {
599  rlReturnVal_t retVal;
600 
601  RL_LOGV_ARG0("rlSetChirpConfig starts...\n");
602 
603  /* check if deviceIndex is out of defined value */
604  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
605  (RL_NULL_PTR == data) || (cnt == 0U))
606  {
607  /* set return error code */
608  retVal = RL_RET_CODE_INVALID_INPUT;
609  }
610  else
611  {
612  /* Initialize Command and Response Sub Blocks */
613  rlDriverMsg_t inMsg;
614  rlDriverMsg_t outMsg = {0};
615  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
616  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
617 
618  /* Initialize Command and Response Sub Blocks */
619  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlChirpCfg_t) + \
620  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
621 
622  /* single sub-block length for chirp config API */
623  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
624 
625  /* get Max Sub Block count */
626  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
627  /*LDRA_INSPECTED 127 D */
628  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
629 
630  retVal = RL_RET_CODE_OK;
631  /* if requested count of chirpConfig is within one Message packet */
632  if (cnt <= maxSbCntInMsg)
633  {
634  sbCntInMsg = cnt;
635  numChnkOfMsg = 1U;
636  lastSbCntInMsg = 0U;
637  }
638  else
639  {
640  sbCntInMsg = maxSbCntInMsg;
641  numChnkOfMsg = cnt / maxSbCntInMsg;
642  lastSbCntInMsg = cnt % maxSbCntInMsg;
643  }
644 
645  /* Fill in-message packet */
646  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
647  /* get the loop count in form of number of msg chunks */
648  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
649 
650  while (retVal == RL_RET_CODE_OK)
651  {
652  /* all full messages have been sent, then send last partial message */
653  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
654  {
655  inMsg.opcode.nsbc = lastSbCntInMsg;
656  }
657  else
658  {
659  inMsg.opcode.nsbc = sbCntInMsg;
660  }
661 
662  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
663  {
664  /* Set Command Sub Block*/
665  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
666  LDRA Tool Issue" */
667  /*LDRA_INSPECTED 105 D */
668  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
669  RL_RF_CHIRP_CONF_SB);
670  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
671  LDRA Tool Issue" */
672  /*LDRA_INSPECTED 105 D */
673  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlChirpCfg_t);
674  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
675  LDRA Tool Issue" */
676  /*LDRA_INSPECTED 105 D */
677  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(data);
678  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
679  next chirp Config */
680  /*LDRA_INSPECTED 567 S */
681  data++;
682  }
683  /* Send Command to mmWave Radar Device */
684  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
685  LDRA Tool Issue" */
686  /*LDRA_INSPECTED 105 D */
687  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
688  /* decrement the loop count */
689  loopCnt--;
690  /* if all chirp configurations have been sent to device then terminate the loop */
691  if (loopCnt == 0U)
692  {
693  break;
694  }
695  }
696  }
697 
698  RL_LOGV_ARG0("rlSetChirpConfig ends...\n");
699 
700  return retVal;
701 }
702 
716 /* Sub block ID: 0x0121, ICD API: AWR_CHIRP_CONF_GET_SB */
717 /* DesignId : MMWL_DesignId_119 */
718 /* Requirements : AUTORADAR_REQ-744, AUTORADAR_REQ-745, AUTORADAR_REQ-746, AUTORADAR_REQ-747,
719 AUTORADAR_REQ-748, AUTORADAR_REQ-749, AUTORADAR_REQ-750, AUTORADAR_REQ-751,
720 AUTORADAR_REQ-773
721 */
722 rlReturnVal_t rlGetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t chirpStartIdx,
723  rlUInt16_t chirpEndIdx, rlChirpCfg_t* data)
724 {
725  rlReturnVal_t retVal;
726  rlChirpCfg_t *chirpCfgData = data;
727 
728  RL_LOGV_ARG0("rlGetChirpConfig starts...\n");
729 
730  /* check if deviceIndex is out of defined value */
731  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
732  (RL_NULL_PTR == chirpCfgData))
733  {
734  /* set return error code */
735  retVal = RL_RET_CODE_INVALID_INPUT;
736  RL_LOGE_ARG0("rlGetChirpConfig, Invalid device map\n");
737  }
738  else
739  {
740  /* Initialize Command and Response Sub Blocks */
741  rlDriverMsg_t inMsg = {0};
742  rlDriverMsg_t outMsg = {0};
743  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
744  rlUInt16_t sbLen, maxSbCntOutMsg, sbCntOutMsg, numChnkOfMsg, lastSbCntOutMsg, loopCnt;
745 
746  /* file chirp start and end index */
747  rlWordParam_t wordParam;
748 
749  rlPayloadSb_t inPayloadSb = {0};
750  rlPayloadSb_t outPayloadSb;
751 
752  /* single sub-block length for chirp config API */
753  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t));
754 
755  /* get Max Sub Block count */
756  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
757  /*LDRA_INSPECTED 127 D */
758  maxSbCntOutMsg = (RL_CMD_PL_LEN_MAX -(RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE)) /sbLen;
759 
760  retVal = RL_RET_CODE_OK;
761  /* if requested count of chirpConfig is within one Message packet */
762  if ((chirpEndIdx - chirpStartIdx + 1U) <= maxSbCntOutMsg)
763  {
764  sbCntOutMsg = (chirpEndIdx - chirpStartIdx + 1U);
765  numChnkOfMsg = 0U;
766  lastSbCntOutMsg = 0U;
767  }
768  else
769  {
770  sbCntOutMsg = maxSbCntOutMsg;
771  numChnkOfMsg = (chirpEndIdx - chirpStartIdx + 1U) / maxSbCntOutMsg;
772  lastSbCntOutMsg = (chirpEndIdx - chirpStartIdx + 1U) % maxSbCntOutMsg;
773  }
774  /* set chirp start index to inMsg field */
775  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "required to intial with startIdx" */
776  /*LDRA_INSPECTED 8 D */
777  wordParam.halfWordTwo = chirpStartIdx;
778 
779  /* get the loop count in form of number of msg chunks */
780  loopCnt = numChnkOfMsg + 1U;
781  /* setting num of sub-block to one in outMsg */
782  outMsg.opcode.nsbc = 1U;
783 
784  while (retVal == RL_RET_CODE_OK)
785  {
786  /* combine half words into WORD structure */
787  wordParam.halfWordOne = wordParam.halfWordTwo;
788  /* all full messages have been sent, then send last partial message */
789  if ((loopCnt == 1U) && (lastSbCntOutMsg != 0U))
790  {
791  wordParam.halfWordTwo = wordParam.halfWordOne + (lastSbCntOutMsg - 1U);
792  }
793  else
794  {
795  wordParam.halfWordTwo = wordParam.halfWordOne + (sbCntOutMsg - 1U);
796  }
797 
798  /* Construct command packet */
799  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
800  /* Fill in-message Payload */
801  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_CHIRP_CONF_SB, &inPayloadSb,
802  (rlUInt8_t*)&wordParam, (rlUInt16_t)sizeof(rlWordParam_t));
803 
804  /* Set Command Sub Block*/
805  outPayloadSb.sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_GET_MSG,
806  RL_RF_CHIRP_CONF_SB);
807  outPayloadSb.len = (rlUInt16_t)sizeof(rlChirpCfg_t);
808  outPayloadSb.pSblkData = (rlUInt8_t*)(chirpCfgData);
809 
810  /* Construct response packet */
811  rlDriverConstructOutMsg(outMsg.opcode.nsbc, &outMsg, &outPayloadSb);
812 
813  /* Send Command to mmWave Radar Device */
814  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
815 
816  /* increment data pointer for next chunk of reponse */
817  chirpCfgData += sbCntOutMsg;
818 
819  /* decrement the loop count */
820  loopCnt--;
821  wordParam.halfWordTwo++;
822  /* if all chirp configurations have been sent to device then terminate the loop */
823  if (loopCnt == 0U)
824  {
825  break;
826  }
827  }
828  }
829 
830  RL_LOGV_ARG0("rlGetChirpConfig ends...\n");
831 
832  return retVal;
833 }
834 
835 
860 rlReturnVal_t rlSetMultiChirpCfg(rlUInt8_t deviceMap, rlUInt16_t cnt,
861  rlChirpCfg_t **data)
862 {
863  rlReturnVal_t retVal;
864  RL_LOGV_ARG0("rlSetMultiChirpCfg starts...\n");
865 
866  /* check if deviceIndex is out of defined value */
867  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
868  (cnt == 0U))
869  {
870  /* set return error code */
871  retVal = RL_RET_CODE_INVALID_INPUT;
872  }
873  else
874  {
875  /* Initialize Command and Response Sub Blocks */
876  rlDriverMsg_t inMsg;
877  rlDriverMsg_t outMsg = {0};
878 
879  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
880  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
881 
882 
883  /* Initialize Command and Response Sub Blocks */
884  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlChirpCfg_t) + \
885  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
886 
887  /* single sub-block length for chirp config API */
888  sbLen = (rlUInt16_t)(sizeof(rlChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
889 
890 
891  /* get Max Sub Block count */
892  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
893  /*LDRA_INSPECTED 127 D */
894  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
895 
896  retVal = RL_RET_CODE_OK;
897  /* if requested count of chirpConfig is within one Message packet */
898  if (cnt <= maxSbCntInMsg)
899  {
900  sbCntInMsg = cnt;
901  numChnkOfMsg = 1U;
902  lastSbCntInMsg = 0U;
903  }
904  else
905  {
906  sbCntInMsg = maxSbCntInMsg;
907  numChnkOfMsg = cnt / maxSbCntInMsg;
908  lastSbCntInMsg = cnt % maxSbCntInMsg;
909  }
910 
911  /* Fill in-message packet */
912  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
913 
914  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
915 
916  while (retVal == RL_RET_CODE_OK)
917  {
918  /* all full messages have been sent, then send last partial message */
919  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
920  {
921  inMsg.opcode.nsbc = lastSbCntInMsg;
922  }
923  else
924  {
925  inMsg.opcode.nsbc = sbCntInMsg;
926  }
927 
928  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
929  {
930  /* Set Command Sub Block*/
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].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
935  RL_RF_CHIRP_CONF_SB);
936  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
937  LDRA Tool Issue" */
938  /*LDRA_INSPECTED 105 D */
939  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlChirpCfg_t);
940  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
941  LDRA Tool Issue" */
942  /*LDRA_INSPECTED 105 D */
943  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
944 
945  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
946  next profile Config */
947  /*LDRA_INSPECTED 567 S */
948  data++;
949  }
950  /* Send Command to mmWave Radar Device */
951  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
952  loopCnt--;
953 
954  if (loopCnt == 0U)
955  {
956  break;
957  }
958  }
959  }
960  RL_LOGV_ARG0("rlSetMultiChirpCfg ends...\n");
961  return retVal;
962 }
963 
1013 /* Sub block ID: 0x0102, ICD API: AWR_FRAME_CONF_SET_SB */
1014 /* DesignId : MMWL_DesignId_015 */
1015 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
1016  AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
1017 rlReturnVal_t rlSetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t* data)
1018 {
1019  rlReturnVal_t retVal;
1020 
1021  RL_LOGV_ARG0("rlSetFrameConfig starts...\n");
1022 
1023  /* check if deviceIndex is out of defined value */
1024  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1025  (RL_NULL_PTR == data))
1026  {
1027  /* set return error code */
1028  retVal = RL_RET_CODE_INVALID_INPUT;
1029  RL_LOGE_ARG0("rlSetFrameConfig, Invalid device map\n");
1030  }
1031  else
1032  {
1033  /* Package the command with given data and send it to device */
1034  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1035  RL_RF_FRAME_CONF_SB, (rlUInt8_t*)data,
1036  (rlUInt16_t)sizeof(rlFrameCfg_t));
1037 
1038  /* If only mmWaveLink instance is running on Host */
1039  if ((retVal == RL_RET_CODE_OK) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1040  {
1041  rlFrameApplyCfg_t frameApplyCfgArgs;
1042  rlUInt32_t tempVar;
1043  frameApplyCfgArgs.reserved = 0U;
1044  frameApplyCfgArgs.numAdcSamples = (data->numAdcSamples);
1045  /*AR_CODE_REVIEW MR:R.10.8 <APPROVED> "Conversion required for RL_SWAP_32 operation"*/
1046  /*LDRA_INSPECTED 332 S */
1047  tempVar = (rlUInt32_t)(((data->chirpEndIdx - data->chirpStartIdx) + 1U) *
1048  data->numLoops);
1049 #ifndef MMWL_BIG_ENDIAN
1050  frameApplyCfgArgs.numChirps = tempVar;
1051 #else
1052  frameApplyCfgArgs.numChirps = RL_SWAP_32(tempVar);
1053 #endif
1054  retVal += rlDeviceFrameConfigApply(deviceMap, &frameApplyCfgArgs);
1055  }
1056  }
1057 
1058  RL_LOGV_ARG0("rlSetFrameConfig ends...\n");
1059 
1060  return retVal;
1061 }
1062 
1074 /* Sub block ID: 0x0122, ICD API: AWR_FRAME_CONF_GET_SB */
1075 /* DesignId : MMWL_DesignId_120 */
1076 /* Requirements : AUTORADAR_REQ-715, AUTORADAR_REQ-716, AUTORADAR_REQ-717,
1077 AUTORADAR_REQ-718, AUTORADAR_REQ-719, AUTORADAR_REQ-720 */
1078 rlReturnVal_t rlGetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t* data)
1079 {
1080  rlReturnVal_t retVal;
1081 
1082  RL_LOGV_ARG0("rlGetFrameConfig starts...\n");
1083 
1084  /* check if deviceIndex is out of defined value */
1085  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1086  (RL_NULL_PTR == data))
1087  {
1088  /* set return error code */
1089  retVal = RL_RET_CODE_INVALID_INPUT;
1090  RL_LOGE_ARG0("rlGetFrameConfig, Invalid device map\n");
1091  }
1092  else
1093  {
1094  /* Package the command with given data and send it to device */
1095  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_DYNAMIC_CONF_GET_MSG,
1096  RL_RF_FRAME_CONF_SB, (rlUInt8_t*)data, 0U);
1097 
1098  /* If only mmWaveLink instance is running on Host */
1099  if ((retVal == RL_RET_CODE_OK) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1100  {
1101  /* Initialize Command and Response Sub Blocks */
1102  rlDriverMsg_t inMsg = {0};
1103  rlDriverMsg_t outMsg = {0};
1104  rlPayloadSb_t inPayloadSb = {0};
1105  rlPayloadSb_t outPayloadSb = {0};
1106  rlFrameApplyCfg_t frameApplyCfgArgs = {0};
1107 
1108  /* Construct command packet */
1109  rlDriverConstructInMsg(RL_DEV_STATUS_GET_MSG, &inMsg, &inPayloadSb);
1110  /* Fill in-message Payload */
1111  /*AR_CODE_REVIEW MR:R.11.2 <APPROVED> "Need to pass NULL pointer" */
1112  /*LDRA_INSPECTED 95 S */
1113  rlDriverFillPayload(RL_DEV_STATUS_GET_MSG, RL_SYS_FRAME_CONFIG_GET_SB,
1114  &inPayloadSb, (rlUInt8_t*)RL_NULL_PTR, 0x0U);
1115 
1116  /* Construct response packet */
1117  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
1118  /* Fill out-message Payload */
1119  rlDriverFillPayload(0U, 0U, &outPayloadSb,
1120  (rlUInt8_t*)&frameApplyCfgArgs, 0U);
1121 
1122  /* Send Command to mmWave Radar Device */
1123  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1124 #ifndef MMWL_BIG_ENDIAN
1125 
1126  /* update parameter received by Get Command */
1127  data->numAdcSamples = frameApplyCfgArgs.numAdcSamples;
1128 #else
1129  /* update parameter received by Get Command */
1130  data->numAdcSamples = RL_SWAP_32(frameApplyCfgArgs.numAdcSamples);
1131 #endif
1132  }
1133  }
1134 
1135  RL_LOGV_ARG0("rlGetFrameConfig ends...\n");
1136 
1137  return retVal;
1138 }
1139 
1187 /* Sub block ID: 0x0105, ICD API: AWR_ADVANCED_FRAME_CONF_SB */
1188 /* DesignId : MMWL_DesignId_046 */
1189 /* Requirements : AUTORADAR_REQ-795 */
1190 rlReturnVal_t rlSetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t* data)
1191 {
1192  rlReturnVal_t retVal;
1193 
1194  RL_LOGV_ARG0("rlSetAdvFrameConfig starts...\n");
1195 
1196  /* check if deviceIndex is out of defined value */
1197  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1198  {
1199  /* set return error code */
1200  retVal = RL_RET_CODE_INVALID_INPUT;
1201  RL_LOGE_ARG0("rlSetAdvFrameConfig, Invalid device map\n");
1202  }
1203  else
1204  {
1205  /* Package the command with given data and send it to device */
1206  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1207  RL_RF_FRAME_CONF_ADVANCED_SB,
1208  (rlUInt8_t*)(&(data->frameSeq)),
1209  (rlUInt16_t)sizeof(rlAdvFrameSeqCfg_t));
1210 
1211  /* If only mmWaveLink instance is running on Host */
1212  if ((RL_RET_CODE_OK == retVal) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1213  {
1214  retVal += rlDeviceAdvFrameConfigApply(deviceMap, &(data->frameData));
1215  }
1216  }
1217 
1218  RL_LOGV_ARG0("rlSetAdvFrameConfig ends...\n");
1219 
1220  return retVal;
1221 }
1222 
1235 /* Sub block ID: 0x0125, ICD API: AWR_ADV_FRAME_CONF_GET_SB */
1236 /* DesignId : MMWL_DesignId_047 */
1237 /* Requirements : AUTORADAR_REQ-796 */
1238 rlReturnVal_t rlGetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t* data)
1239 {
1240  rlReturnVal_t retVal;
1241 
1242  RL_LOGV_ARG0("rlGetAdvFrameConfig starts...\n");
1243 
1244  /* check if deviceIndex is out of defined value */
1245  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1246  (RL_NULL_PTR == data))
1247  {
1248  /* set return error code */
1249  retVal = RL_RET_CODE_INVALID_INPUT;
1250  RL_LOGE_ARG0("rlGetAdvFrameConfig, Invalid device map\n");
1251  }
1252  else
1253  {
1254  /* Package the command with given data and send it to device */
1255  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_DYNAMIC_CONF_GET_MSG,
1256  RL_RF_FRAME_CONF_ADVANCED_SB,
1257  (rlUInt8_t*)(&(data->frameSeq)), 0U);
1258 
1259  /* If only mmWaveLink instance is running on Host */
1260  if ((RL_RET_CODE_OK == retVal) && (RL_PLATFORM_HOST == rlDriverGetPlatformId()))
1261  {
1262  /* Initialize Command and Response Sub Blocks */
1263  rlDriverMsg_t inMsg = {0};
1264  rlDriverMsg_t outMsg = {0};
1265  rlPayloadSb_t inPayloadSb = {0};
1266  rlPayloadSb_t outPayloadSb = {0};
1267 
1268  /* Construct command packet */
1269  rlDriverConstructInMsg(RL_DEV_STATUS_GET_MSG, &inMsg, &inPayloadSb);
1270  /* Fill in-message Payload */
1271  /*AR_CODE_REVIEW MR:R.11.2 <APPROVED> "Need to pass NULL pointer" */
1272  /*LDRA_INSPECTED 95 S */
1273  rlDriverFillPayload(RL_DEV_STATUS_GET_MSG,
1274  RL_SYS_ADV_FRAME_CONFIG_GET_SB,
1275  &inPayloadSb, (rlUInt8_t*)RL_NULL_PTR, 0U);
1276 
1277  /* Construct response packet */
1278  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
1279  /* Fill out-message Payload */
1280  rlDriverFillPayload(0U, 0U, &outPayloadSb,
1281  (rlUInt8_t*)(&(data->frameData)), 0U);
1282 
1283  /* Send Command to mmWave Radar Device */
1284  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
1285  }
1286  }
1287 
1288  RL_LOGV_ARG0("rlGetAdvFrameConfig ends...\n");
1289 
1290  return retVal;
1291 }
1292 
1308 /* Sub block ID: 0x0103, ICD API: AWR_CONT_STREAMING_MODE_CONF_SET_SB */
1309 /* DesignId : MMWL_DesignId_038 */
1310 /* Requirements : AUTORADAR_REQ-827 */
1311 rlReturnVal_t rlSetContModeConfig(rlUInt8_t deviceMap, rlContModeCfg_t* data)
1312 {
1313  rlReturnVal_t retVal;
1314 
1315  RL_LOGV_ARG0("rlSetContModeConfig starts...\n");
1316 
1317  /* check if deviceIndex is out of defined value */
1318  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1319  (RL_NULL_PTR == data))
1320  {
1321  /* set return error code */
1322  retVal = RL_RET_CODE_INVALID_INPUT;
1323  RL_LOGE_ARG0("rlSetContModeConfig, Invalid device map\n");
1324  }
1325  else
1326  {
1327  /* Package the command with given data and send it to device */
1328  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1329  RL_RF_CONT_STREAMING_MODE_CONF_SB,
1330  (rlUInt8_t*)data,
1331  (rlUInt16_t)sizeof(rlContModeCfg_t));
1332  }
1333  RL_LOGV_ARG0("rlSetContModeConfig ends...\n");
1334 
1335  return retVal;
1336 }
1337 
1348 /* Sub block ID: 0x0104, ICD API: AWR_CONT_STREAMING_MODE_EN_SB */
1349 /* DesignId : MMWL_DesignId_039 */
1350 /* Requirements : AUTORADAR_REQ-828 */
1351 rlReturnVal_t rlEnableContMode(rlUInt8_t deviceMap, rlContModeEn_t* data)
1352 {
1353  rlReturnVal_t retVal;
1354 
1355  RL_LOGV_ARG0("rlEnableContMode starts...\n");
1356 
1357  /* check if deviceIndex is out of defined value */
1358  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1359  (RL_NULL_PTR == data))
1360  {
1361  /* set return error code */
1362  retVal = RL_RET_CODE_INVALID_INPUT;
1363  RL_LOGE_ARG0("rlEnableContMode, Invalid device map\n");
1364  }
1365  else
1366  {
1367  /* Package the command with given data and send it to device */
1368  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
1369  RL_RF_CONT_STREAMING_MODE_EN_SB,
1370  (rlUInt8_t*)data,
1371  (rlUInt16_t)sizeof(rlContModeEn_t));
1372  }
1373 
1374  RL_LOGV_ARG0("rlEnableContMode starts...\n");
1375 
1376  return retVal;
1377 }
1378 
1393 /* Sub block ID: 0x0083, ICD API: AWR_LOWPOWERMODE_CONF_SET_SB */
1394 /* DesignId : MMWL_DesignId_011 */
1395 /* Requirements : AUTORADAR_REQ-755 */
1396 rlReturnVal_t rlSetLowPowerModeConfig(rlUInt8_t deviceMap, rlLowPowerModeCfg_t* data)
1397 {
1398  rlReturnVal_t retVal;
1399 
1400  RL_LOGV_ARG0("rlSetLowPowerModeConfig starts...\n");
1401 
1402  /* check if deviceIndex is out of defined value */
1403  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1404  {
1405  /* set return error code */
1406  retVal = RL_RET_CODE_INVALID_INPUT;
1407  RL_LOGE_ARG0("rlSetLowPowerModeConfig, Invalid device map\n");
1408  }
1409  else
1410  {
1411  /* Package the command with given data and send it to device */
1412  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1413  RL_RF_LOWPOWERMODE_CONF_SB,
1414  (rlUInt8_t*)data,
1415  (rlUInt16_t)sizeof(rlLowPowerModeCfg_t));
1416  }
1417 
1418  RL_LOGV_ARG0("rlSetLowPowerModeConfig ends...\n");
1419  return retVal;
1420 }
1421 
1438 /* Sub block ID: 0x0140, ICD API: AWR_FRAMESTARTSTOP_CONF_SB */
1439 /* DesignId : MMWL_DesignId_017 */
1440 /* Requirements : AUTORADAR_REQ-759 */
1441 rlReturnVal_t rlSensorStart(rlUInt8_t deviceMap)
1442 {
1443  rlReturnVal_t retVal;
1444 
1445  rlFrameTrigger_t frameTriggerArgs;
1446 
1447  RL_LOGV_ARG0("rlSensorStart starts...\n");
1448 
1449  frameTriggerArgs.startStop = RL_FRAME_TRIGGER_START;
1450  frameTriggerArgs.reserved = 0U;
1451 
1452  /* check if deviceIndex is out of defined value */
1453  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1454  {
1455  /* set return error code */
1456  retVal = RL_RET_CODE_INVALID_INPUT;
1457  RL_LOGE_ARG0("rlSensorStart, Invalid device map\n");
1458  }
1459  else
1460  {
1461  /* Package the command with given data and send it to device */
1462  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1463  RL_RF_FRAMESTARTSTOP_CONF_SB,
1464  (rlUInt8_t*)(&frameTriggerArgs),
1465  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1466  }
1467  RL_LOGV_ARG0("rlSensorStart ends...\n");
1468 
1469  return retVal;
1470 }
1471 
1492 /* Sub block ID: 0x0140, ICD API: AWR_FRAMESTARTSTOP_CONF_SB */
1493 /* DesignId : MMWL_DesignId_018 */
1494 /* Requirements : AUTORADAR_REQ-760 */
1495 rlReturnVal_t rlSensorStop(rlUInt8_t deviceMap)
1496 {
1497  rlReturnVal_t retVal;
1498 
1499  rlFrameTrigger_t frameTriggerArgs;
1500 
1501  frameTriggerArgs.startStop = RL_FRAME_TRIGGER_STOP;
1502  frameTriggerArgs.reserved = 0U;
1503 
1504  RL_LOGV_ARG0("rlSensorStop starts...\n");
1505 
1506  /* check if deviceIndex is out of defined value */
1507  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1508  {
1509  /* set return error code */
1510  retVal = RL_RET_CODE_INVALID_INPUT;
1511  RL_LOGE_ARG0("rlSensorStop, Invalid device map\n");
1512  }
1513  else
1514  {
1515  /* Package the command with given data and send it to device */
1516  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1517  RL_RF_FRAMESTARTSTOP_CONF_SB,
1518  (rlUInt8_t*)(&frameTriggerArgs),
1519  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1520  }
1521  RL_LOGV_ARG0("rlSensorStop ends...\n");
1522 
1523  return retVal;
1524 
1525 }
1526 
1552 /* Sub block ID: 0x0140, ICD API: AWR_FRAMESTARTSTOP_CONF_SB */
1553 /* DesignId : MMWL_DesignId_133 */
1554 /* Requirements : AUTORADAR_REQ-1059 */
1555 rlReturnVal_t rlFrameStartStop(rlUInt8_t deviceMap, rlFrameTrigger_t* data)
1556 {
1557  rlReturnVal_t retVal;
1558 
1559  RL_LOGV_ARG0("rlFrameStartStop starts...\n");
1560 
1561  /* check if deviceIndex is out of defined value */
1562  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1563  {
1564  /* set return error code */
1565  retVal = RL_RET_CODE_INVALID_INPUT;
1566  RL_LOGE_ARG0("rlFrameStartStop, Invalid device map\n");
1567  }
1568  else
1569  {
1570  /* Package the command with given data and send it to device */
1571  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_FRAME_TRIG_MSG,
1572  RL_RF_FRAMESTARTSTOP_CONF_SB,
1573  (rlUInt8_t*)data,
1574  (rlUInt16_t)sizeof(rlFrameTrigger_t));
1575  }
1576  RL_LOGV_ARG0("rlFrameStartStop ends...\n");
1577 
1578  return retVal;
1579 }
1580 
1608 /* Sub block ID: 0x00C0, ICD API: AWR_RF_INIT_SB */
1609 /* DesignId : MMWL_DesignId_012 */
1610 /* Requirements : AUTORADAR_REQ-758 */
1611 rlReturnVal_t rlRfInit(rlUInt8_t deviceMap)
1612 {
1613  /* Initialize Command and Response Sub Blocks */
1614  rlReturnVal_t retVal;
1615 
1616  RL_LOGV_ARG0("rlRfInit starts...\n");
1617 
1618  /* check if deviceIndex is out of defined value */
1619  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK))
1620  {
1621  /* set return error code */
1622  retVal = RL_RET_CODE_INVALID_INPUT;
1623  RL_LOGE_ARG0("rlRfInit, Invalid device map\n");
1624  }
1625  else
1626  {
1627  /* Package the command with given data and send it to device */
1628  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_INIT_MSG, RL_RF_RF_INIT_SB, NULL, 0U);
1629  }
1630  RL_LOGV_ARG0("rlRfInit ends...\n");
1631 
1632  return retVal;
1633 }
1634 
1655 /* Sub block ID: 0x02C2, ICD API: AWR_RF_TEST_SOURCE_CONFIG_SET_SB */
1656 /* DesignId : MMWL_DesignId_035 */
1657 /* Requirements : AUTORADAR_REQ-790, AUTORADAR_REQ-1008 */
1658 rlReturnVal_t rlSetTestSourceConfig(rlUInt8_t deviceMap, rlTestSource_t* data)
1659 {
1660  rlReturnVal_t retVal;
1661 
1662  RL_LOGV_ARG0("rlSetTestSourceConfig starts...\n");
1663 
1664  /* check if deviceIndex is out of defined value */
1665  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1666  (RL_NULL_PTR == data))
1667  {
1668  /* set return error code */
1669  retVal = RL_RET_CODE_INVALID_INPUT;
1670  RL_LOGE_ARG0("rlSetTestSourceConfig, Invalid device map\n");
1671  }
1672  else
1673  {
1674  /* Package the command with given data and send it to device */
1675  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1676  RL_RF_TEST_SOURCE_CONFIG_SET_SB,
1677  (rlUInt8_t*)data,
1678  (rlUInt16_t)sizeof(rlTestSource_t));
1679  }
1680  RL_LOGV_ARG0("rlSetTestSourceConfig ends...\n");
1681 
1682  return retVal;
1683 }
1684 
1695 /* Sub block ID: 0x02C3, ICD API: AWR_RF_TEST_SOURCE_ENABLE_SET_SB */
1696 /* DesignId : MMWL_DesignId_036 */
1697 /* Requirements : AUTORADAR_REQ-791 */
1698 rlReturnVal_t rlTestSourceEnable(rlUInt8_t deviceMap, rlTestSourceEnable_t* data)
1699 {
1700  rlReturnVal_t retVal;
1701 
1702  RL_LOGV_ARG0("rlTestSourceEnable starts...\n");
1703 
1704  /* check if deviceIndex is out of defined value */
1705  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1706  (RL_NULL_PTR == data))
1707  {
1708  /* set return error code */
1709  retVal = RL_RET_CODE_INVALID_INPUT;
1710  RL_LOGE_ARG0("rlTestSourceEnable, Invalid device map\n");
1711  }
1712  else
1713  {
1714  /* Package the command with given data and send it to device */
1715  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1716  RL_RF_TEST_SOURCE_ENABLE_SET_SB,
1717  (rlUInt8_t*)data,
1718  (rlUInt16_t)sizeof(rlTestSourceEnable_t));
1719  }
1720  RL_LOGV_ARG0("rlTestSourceEnable ends...\n");
1721 
1722  return retVal;
1723 }
1724 
1735 /* Sub block ID: 0x02EA, ICD API: AWR_RF_TEMPERATURE_GET_SB */
1736 /* DesignId : MMWL_DesignId_029 */
1737 /* Requirements : AUTORADAR_REQ-789 */
1738 rlReturnVal_t rlRfGetTemperatureReport(rlUInt8_t deviceMap, rlRfTempData_t* data)
1739 {
1740  rlReturnVal_t retVal;
1741 
1742  RL_LOGV_ARG0("rlRfGetTemperatureReport starts...\n");
1743 
1744  /* check if deviceIndex is out of defined value */
1745  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1746  (RL_NULL_PTR == data))
1747  {
1748  /* set return error code */
1749  retVal = RL_RET_CODE_INVALID_INPUT;
1750  RL_LOGE_ARG0("rlRfGetTemperatureReport, Invalid device map\n");
1751  }
1752  else
1753  {
1754  /* Package the command with given data and send it to device */
1755  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_MISC_CONF_GET_MSG,
1756  RL_RF_CHAR_CONF_DYNAMIC_GET_SB,
1757  (rlUInt8_t*)data, (rlUInt16_t)sizeof(rlRfTempData_t));
1758  }
1759  RL_LOGV_ARG0("rlRfGetTemperatureReport ends...\n");
1760 
1761  return retVal;
1762 }
1777 /* Sub block ID: 0x0260, ICD API: AWR_RF_DFE_STATISTICS_REPORT_GET_SB */
1778 /* DesignId : MMWL_DesignId_041 */
1779 /* Requirements : AUTORADAR_REQ-788 */
1780 rlReturnVal_t rlRfDfeRxStatisticsReport(rlUInt8_t deviceMap, rlDfeStatReport_t* data)
1781 {
1782  rlReturnVal_t retVal;
1783 
1784  RL_LOGV_ARG0("rlRfDfeRxdStatisticsReport starts...\n");
1785 
1786  /* check if deviceIndex is out of defined value */
1787  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1788  (RL_NULL_PTR == data))
1789  {
1790  /* set return error code */
1791  retVal = RL_RET_CODE_INVALID_INPUT;
1792  RL_LOGE_ARG0("Invalid input\n");
1793  }
1794  else
1795  {
1796  /* Package the command with given data and send it to device */
1797  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_MONITORING_REPO_GET_MSG,
1798  RL_RF_DFE_STATISTICS_REPORT_GET_SB,
1799  (rlUInt8_t*)data, 0U);
1800  }
1801  RL_LOGV_ARG0("rlRfDfeRxdStatisticsReport completes...\n");
1802 
1803  return retVal;
1804 }
1805 
1826 /* Sub block ID: 0x0084, ICD API: AWR_DYNAMICPOWERSAVE_CONF_SET_SB */
1827 /* DesignId : MMWL_DesignId_019 */
1828 /* Requirements : AUTORADAR_REQ-797 */
1829 rlReturnVal_t rlRfDynamicPowerSave(rlUInt8_t deviceMap, rlDynPwrSave_t* data)
1830 {
1831  rlReturnVal_t retVal;
1832 
1833  RL_LOGV_ARG0("rlRfDynamicPowerSave starts...\n");
1834 
1835  /* check if deviceIndex is out of defined value */
1836  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1837  (RL_NULL_PTR == data))
1838  {
1839  /* set return error code */
1840  retVal = RL_RET_CODE_INVALID_INPUT;
1841  RL_LOGE_ARG0("Invalid input\n");
1842  }
1843  else
1844  {
1845  /* Package the command with given data and send it to device */
1846  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1847  RL_RF_DYNAMICPOWERSAVE_CONF_SB,
1848  (rlUInt8_t*)data,
1849  (rlUInt16_t)sizeof(rlDynPwrSave_t));
1850  }
1851  RL_LOGV_ARG0("rlRfDynamicPowerSave completes...\n");
1852 
1853  return retVal;
1854 }
1855 
1876 /* Sub block ID: 0x0086, ICD API: AWR_RF_DEVICE_CFG_SB */
1877 /* DesignId : MMWL_DesignId_042 */
1878 /* Requirements : AUTORADAR_REQ-794 */
1879 rlReturnVal_t rlRfSetDeviceCfg(rlUInt8_t deviceMap, rlRfDevCfg_t* data)
1880 {
1881  rlReturnVal_t retVal;
1882 
1883  RL_LOGV_ARG0("rlRfSetDeviceCfg starts...\n");
1884 
1885  /* check if deviceIndex is out of defined value */
1886  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1887  (RL_NULL_PTR == data))
1888  {
1889  /* set return error code */
1890  retVal = RL_RET_CODE_INVALID_INPUT;
1891  RL_LOGE_ARG0("Invalid input\n");
1892  }
1893  else
1894  {
1895  /* Package the command with given data and send it to device */
1896  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
1897  RL_RF_DEVICE_CFG_SB,
1898  (rlUInt8_t*)data,
1899  (rlUInt16_t)sizeof(rlRfDevCfg_t));
1900  }
1901  RL_LOGV_ARG0("rlRfSetDeviceCfg completes...\n");
1902 
1903  return retVal;
1904 }
1905 
1922 /* Sub block ID: 0x02D0, ICD API: AWR_RF_GPADC_CFG_SET_SB */
1923 /* DesignId : MMWL_DesignId_044 */
1924 /* Requirements : AUTORADAR_REQ-792 */
1925 rlReturnVal_t rlSetGpAdcConfig(rlUInt8_t deviceMap, rlGpAdcCfg_t* data)
1926 {
1927  rlReturnVal_t retVal;
1928 
1929  RL_LOGV_ARG0("rlSetGpAdcConfig starts...\n");
1930 
1931  /* check if deviceIndex is out of defined value */
1932  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
1933  (RL_NULL_PTR == data))
1934  {
1935  /* set return error code */
1936  retVal = RL_RET_CODE_INVALID_INPUT;
1937  RL_LOGE_ARG0("Invalid input\n");
1938  }
1939  else
1940  {
1941  /* Package the command with given data and send it to device */
1942  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1943  RL_RF_GPADC_CONF_SET_SB,
1944  (rlUInt8_t*)data,
1945  (rlUInt16_t)sizeof(rlGpAdcCfg_t));
1946  }
1947  RL_LOGV_ARG0("rlSetGpAdcConfig completes...\n");
1948 
1949  return retVal;
1950 }
1951 
1967 /* Sub block ID: 0x02CC, ICD API: AWR_RF_LDO_BYPASS_SB */
1968 /* DesignId : MMWL_DesignId_043 */
1969 /* Requirements : AUTORADAR_REQ-793 */
1970 rlReturnVal_t rlRfSetLdoBypassConfig(rlUInt8_t deviceMap, rlRfLdoBypassCfg_t* data)
1971 {
1972  rlReturnVal_t retVal;
1973 
1974  RL_LOGV_ARG0("rlRfSetLdoBypassConfig starts...\n");
1975 
1976  /* check if deviceIndex is out of defined value */
1977  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
1978  {
1979  /* set return error code */
1980  retVal = RL_RET_CODE_INVALID_INPUT;
1981  }
1982  else
1983  {
1984  /* Package the command with given data and send it to device */
1985  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
1986  RL_RF_LDOBYPASS_SET_SB,
1987  (rlUInt8_t*)data,
1988  (rlUInt16_t)sizeof(rlRfLdoBypassCfg_t));
1989  }
1990 
1991  RL_LOGV_ARG0("rlRfSetLdoBypassConfig completes...\n");
1992  return retVal;
1993 }
1994 
2018 /* Sub block ID: 0x0106, ICD API: AWR_PERCHIRPPHASESHIFT_CONF_SB */
2019 /* DesignId : MMWL_DesignId_045 */
2020 /* Requirements : AUTORADAR_REQ-798 */
2021 rlReturnVal_t rlRfSetPhaseShiftConfig(rlUInt8_t deviceMap, rlUInt16_t cnt,
2022  rlRfPhaseShiftCfg_t* data)
2023 {
2024  rlReturnVal_t retVal;
2025 
2026  RL_LOGV_ARG0("rlRfSetPhaseShiftConfig starts...\n");
2027 
2028  /* check if deviceIndex is out of defined value */
2029  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2030  (RL_NULL_PTR == data) || (cnt == 0U))
2031  {
2032  /* set return error code */
2033  retVal = RL_RET_CODE_INVALID_INPUT;
2034  }
2035  else
2036  {
2037  /* Initialize Command and Response Sub Blocks */
2038  rlDriverMsg_t inMsg;
2039  rlDriverMsg_t outMsg = {0};
2040  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
2041  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
2042 
2043  /* Initialize Command and Response Sub Blocks */
2044  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlRfPhaseShiftCfg_t) + \
2045  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
2046 
2047  /* single sub-block length for chirp config API */
2048  sbLen = (rlUInt16_t)(sizeof(rlRfPhaseShiftCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
2049 
2050  /* get Max Sub Block count */
2051  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
2052  /*LDRA_INSPECTED 127 D */
2053  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
2054 
2055  retVal = RL_RET_CODE_OK;
2056  /* if requested count of chirpConfig is within one Message packet */
2057  if (cnt <= maxSbCntInMsg)
2058  {
2059  sbCntInMsg = cnt;
2060  numChnkOfMsg = 1U;
2061  lastSbCntInMsg = 0U;
2062  }
2063  else
2064  {
2065  sbCntInMsg = maxSbCntInMsg;
2066  numChnkOfMsg = cnt / maxSbCntInMsg;
2067  lastSbCntInMsg = cnt % maxSbCntInMsg;
2068  }
2069 
2070  /* Fill in-message packet */
2071  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
2072  /* get the loop count in form of number of msg chunks */
2073  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
2074 
2075  while (retVal == RL_RET_CODE_OK)
2076  {
2077  /* all full messages have been sent, then send last partial message */
2078  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
2079  {
2080  inMsg.opcode.nsbc = lastSbCntInMsg;
2081  }
2082  else
2083  {
2084  inMsg.opcode.nsbc = sbCntInMsg;
2085  }
2086 
2087  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
2088  {
2089  /* Set Command Sub Block*/
2090  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2091  LDRA Tool Issue" */
2092  /*LDRA_INSPECTED 105 D */
2093  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
2094  RL_RF_PERCHIRPPHASESHIFT_CONF_SB);
2095  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2096  LDRA Tool Issue" */
2097  /*LDRA_INSPECTED 105 D */
2098  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlRfPhaseShiftCfg_t);
2099  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2100  LDRA Tool Issue" */
2101  /*LDRA_INSPECTED 105 D */
2102  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(data);
2103  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
2104  next chirp Config */
2105  /*LDRA_INSPECTED 567 S */
2106  data++;
2107  }
2108  /* Send Command to mmWave Radar Device */
2109  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2110  LDRA Tool Issue" */
2111  /*LDRA_INSPECTED 105 D */
2112  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2113  /* decrement the loop count */
2114  loopCnt--;
2115  /* if all phase shift configs have been sent to device then terminate the loop */
2116  if (loopCnt == 0U)
2117  {
2118  break;
2119  }
2120  }
2121  }
2122 
2123  RL_LOGV_ARG0("rlRfSetPhaseShiftConfig ends...\n");
2124 
2125  return retVal;
2126 }
2127 
2142 /* Sub block ID: 0x02CD, ICD API: AWR_RF_PALOOPBACK_CFG_SB */
2143 /* DesignId : MMWL_DesignId_098 */
2144 /* Requirements : AUTORADAR_REQ-801 */
2145 rlReturnVal_t rlRfSetPALoopbackConfig(rlUInt8_t deviceMap, rlRfPALoopbackCfg_t* data)
2146 {
2147  rlReturnVal_t retVal;
2148 
2149  RL_LOGV_ARG0("rlRfSetPALoopbackConfig starts...\n");
2150 
2151  /* check if deviceIndex is out of defined value */
2152  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2153  {
2154  /* set return error code */
2155  retVal = RL_RET_CODE_INVALID_INPUT;
2156  }
2157  else
2158  {
2159  /* Package the command with given data and send it to device */
2160  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2161  RL_RF_PALOOPBACK_CFG_SET_SB,
2162  (rlUInt8_t*)data,
2163  (rlUInt16_t)sizeof(rlRfPALoopbackCfg_t));
2164  }
2165 
2166  RL_LOGV_ARG0("rlRfSetPALoopbackConfig completes...\n");
2167  return retVal;
2168 }
2169 
2192 /* Sub block ID: 0x02CE, ICD API: AWR_RF_PSLOOPBACK_CFG_SB */
2193 /* DesignId : MMWL_DesignId_099 */
2194 /* Requirements : AUTORADAR_REQ-802 */
2195 rlReturnVal_t rlRfSetPSLoopbackConfig(rlUInt8_t deviceMap, rlRfPSLoopbackCfg_t* data)
2196 {
2197  rlReturnVal_t retVal;
2198 
2199  RL_LOGV_ARG0("rlRfSetPSLoopbackConfig starts...\n");
2200 
2201  /* check if deviceIndex is out of defined value */
2202  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2203  {
2204  /* set return error code */
2205  retVal = RL_RET_CODE_INVALID_INPUT;
2206  }
2207  else
2208  {
2209  /* Package the command with given data and send it to device */
2210  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2211  RL_RF_PSLOOPBACK_CFG_SET_SB,
2212  (rlUInt8_t*)data,
2213  (rlUInt16_t)sizeof(rlRfPSLoopbackCfg_t));
2214  }
2215 
2216  RL_LOGV_ARG0("rlRfSetPSLoopbackConfig completes...\n");
2217  return retVal;
2218 }
2219 
2235 /* Sub block ID: 0x02CF, ICD API: AWR_RF_IFLOOPBACK_CFG_SB */
2236 /* DesignId : MMWL_DesignId_100 */
2237 /* Requirements : AUTORADAR_REQ-803 */
2238 rlReturnVal_t rlRfSetIFLoopbackConfig(rlUInt8_t deviceMap, rlRfIFLoopbackCfg_t* data)
2239 {
2240  rlReturnVal_t retVal;
2241 
2242  RL_LOGV_ARG0("rlRfSetIFLoopbackConfig starts...\n");
2243 
2244  /* check if deviceIndex is out of defined value */
2245  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2246  {
2247  /* set return error code */
2248  retVal = RL_RET_CODE_INVALID_INPUT;
2249  }
2250  else
2251  {
2252  /* Package the command with given data and send it to device */
2253  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_MISC_CONF_SET_MSG,
2254  RL_RF_IFLOOPBACK_CFG_SET_SB,
2255  (rlUInt8_t*)data,
2256  (rlUInt16_t)sizeof(rlRfIFLoopbackCfg_t));
2257  }
2258 
2259  RL_LOGV_ARG0("rlRfSetIFLoopbackConfig completes...\n");
2260  return retVal;
2261 }
2262 
2284 /* Sub block ID: 0x0107, ICD API: AWR_PROG_FILT_COEFF_RAM_SET_SB */
2285 /* DesignId : MMWL_DesignId_050 */
2286 /* Requirements : AUTORADAR_REQ-799 */
2287 rlReturnVal_t rlRfSetProgFiltCoeffRam(rlUInt8_t deviceMap, rlRfProgFiltCoeff_t* data)
2288 {
2289  rlReturnVal_t retVal;
2290 
2291  RL_LOGV_ARG0("rlRfSetProgFiltCoeffRam starts...\n");
2292 
2293  /* check if deviceIndex is out of defined value */
2294  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2295  {
2296  /* set return error code */
2297  retVal = RL_RET_CODE_INVALID_INPUT;
2298  }
2299  else
2300  {
2301  /* Package the command with given data and send it to device */
2302  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2303  RL_RF_PROG_FILT_COEFF_RAM_SET_SB,
2304  (rlUInt8_t*)data,
2305  (rlUInt16_t)sizeof(rlRfProgFiltCoeff_t));
2306  }
2307 
2308  RL_LOGV_ARG0("rlRfSetProgFiltCoeffRam completes...\n");
2309 
2310  return retVal;
2311 }
2312 
2326 /* Sub block ID: 0x0108, ICD API: AWR_PROG_FILT_CONF_SET_SB */
2327 /* DesignId : MMWL_DesignId_051 */
2328 /* Requirements : AUTORADAR_REQ-800 */
2329 rlReturnVal_t rlRfSetProgFiltConfig(rlUInt8_t deviceMap, rlRfProgFiltConf_t* data)
2330 {
2331  rlReturnVal_t retVal;
2332 
2333  RL_LOGV_ARG0("rlRfSetProgFiltConfig starts...\n");
2334 
2335  /* check if deviceIndex is out of defined value */
2336  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2337  {
2338  /* set return error code */
2339  retVal = RL_RET_CODE_INVALID_INPUT;
2340  }
2341  else
2342  {
2343  /* Package the command with given data and send it to device */
2344  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2345  RL_RF_PROG_FILT_CONF_SET_SB,
2346  (rlUInt8_t*)data,
2347  (rlUInt16_t)sizeof(rlRfProgFiltConf_t));
2348  }
2349 
2350  RL_LOGV_ARG0("rlRfSetProgFiltConfig completes...\n");
2351 
2352  return retVal;
2353 }
2354 
2369 /* Sub block ID: 0x0087, ICD API: AWR_RF_RADAR_MISC_CTL_SB */
2370 /* DesignId : MMWL_DesignId_052 */
2371 /* Requirements : AUTORADAR_REQ-891 */
2372 rlReturnVal_t rlRfSetMiscConfig(rlUInt8_t deviceMap, rlRfMiscConf_t* data)
2373 {
2374  rlReturnVal_t retVal;
2375 
2376  RL_LOGV_ARG0("rlRfSetMiscConfig starts...\n");
2377 
2378  /* check if deviceIndex is out of defined value */
2379  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2380  {
2381  /* set return error code */
2382  retVal = RL_RET_CODE_INVALID_INPUT;
2383  }
2384  else
2385  {
2386  /* Package the command with given data and send it to device */
2387  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2388  RL_RF_RADAR_MISC_CTL_SB,
2389  (rlUInt8_t*)data,
2390  (rlUInt16_t)sizeof(rlRfMiscConf_t));
2391  }
2392 
2393  RL_LOGV_ARG0("rlRfSetMiscConfig completes...\n");
2394  return retVal;
2395 }
2396 
2421 /* Sub block ID: 0x0109, ICD API: AWR_CALIB_MON_TIME_UNIT_CONF_SB */
2422 /* DesignId : MMWL_DesignId_053 */
2423 /* Requirements : AUTORADAR_REQ-892 */
2424 rlReturnVal_t rlRfSetCalMonTimeUnitConfig(rlUInt8_t deviceMap,
2426 {
2427  rlReturnVal_t retVal;
2428 
2429  RL_LOGV_ARG0("rlRfSetCalMonTimeUnitConfig starts...\n");
2430 
2431  /* check if deviceIndex is out of defined value */
2432  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2433  {
2434  /* set return error code */
2435  retVal = RL_RET_CODE_INVALID_INPUT;
2436  }
2437  else
2438  {
2439  /* Package the command with given data and send it to device */
2440  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2441  RL_RF_CALIB_MON_TIME_UNIT_SB,
2442  (rlUInt8_t*)data,
2443  (rlUInt16_t)sizeof(rlRfCalMonTimeUntConf_t));
2444  }
2445 
2446  RL_LOGV_ARG0("rlRfSetCalMonTimeUnitConfig completes...\n");
2447 
2448  return retVal;
2449 }
2450 
2472 /* Sub block ID: 0x0088, ICD API: AWR_CAL_MON_FREQUENCY_LIMITS_SB */
2473 /* DesignId : MMWL_DesignId_054 */
2474 /* Requirements : AUTORADAR_REQ-893 */
2475 rlReturnVal_t rlRfSetCalMonFreqLimitConfig(rlUInt8_t deviceMap,
2477 {
2478  rlReturnVal_t retVal;
2479 
2480  RL_LOGV_ARG0("rlRfSetCalMonFreqLimitConfig starts...\n");
2481 
2482  /* check if deviceIndex is out of defined value */
2483  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2484  {
2485  /* set return error code */
2486  retVal = RL_RET_CODE_INVALID_INPUT;
2487  }
2488  else
2489  {
2490  /* Package the command with given data and send it to device */
2491  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2492  RL_RF_CAL_MON_FREQ_LIMIT_SB,
2493  (rlUInt8_t*)data,
2494  (rlUInt16_t)sizeof(rlRfCalMonFreqLimitConf_t));
2495  }
2496 
2497  RL_LOGV_ARG0("rlRfSetCalMonFreqLimitConfig completes...\n");
2498  return retVal;
2499 }
2500 
2520 /* Sub block ID: 0x0089, ICD API: AWR_RF_INIT_CALIBRATION_CONF_SB */
2521 /* DesignId : MMWL_DesignId_055 */
2522 /* Requirements : AUTORADAR_REQ-894 */
2523 rlReturnVal_t rlRfInitCalibConfig(rlUInt8_t deviceMap, rlRfInitCalConf_t* data)
2524 {
2525  rlReturnVal_t retVal;
2526 
2527  RL_LOGV_ARG0("rlRfInitCalibConfig starts...\n");
2528 
2529  /* check if deviceIndex is out of defined value */
2530  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2531  {
2532  /* set return error code */
2533  retVal = RL_RET_CODE_INVALID_INPUT;
2534  }
2535  else
2536  {
2537  /* Package the command with given data and send it to device */
2538  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2539  RL_RF_INIT_CALIB_CONF_SB,
2540  (rlUInt8_t*)data,
2541  (rlUInt16_t)sizeof(rlRfInitCalConf_t));
2542  }
2543 
2544  RL_LOGV_ARG0("rlRfInitCalibConfig completes...\n");
2545  return retVal;
2546 }
2547 
2572 /* Sub block ID: 0x010A, ICD API: AWR_RUN_TIME_CALIBRATION_CONF_AND_TRIGGER_SB */
2573 /* DesignId : MMWL_DesignId_056 */
2574 /* Requirements : AUTORADAR_REQ-895, AUTORADAR_REQ-1063 */
2575 rlReturnVal_t rlRfRunTimeCalibConfig(rlUInt8_t deviceMap, rlRunTimeCalibConf_t* data)
2576 {
2577  rlReturnVal_t retVal;
2578 
2579  RL_LOGV_ARG0("rlRfRunTimeCalibConfig starts...\n");
2580 
2581  /* check if deviceIndex is out of defined value */
2582  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2583  {
2584  /* set return error code */
2585  retVal = RL_RET_CODE_INVALID_INPUT;
2586  }
2587  else
2588  {
2589  /* Package the command with given data and send it to device */
2590  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2591  RL_RF_RUN_TIME_CALIB_CONF_TRIG_SB,
2592  (rlUInt8_t*)data,
2593  (rlUInt16_t)sizeof(rlRunTimeCalibConf_t));
2594  }
2595 
2596  RL_LOGV_ARG0("rlRfRunTimeCalibConfig completes...\n");
2597  return retVal;
2598 }
2599 
2613 /* Sub block ID: 0x010C, ICD API: AWR_RX_GAIN_TEMPLUT_SET_SB */
2614 /* DesignId : MMWL_DesignId_057 */
2615 /* Requirements : AUTORADAR_REQ-896 */
2616 rlReturnVal_t rlRxGainTempLutSet(rlUInt8_t deviceMap, rlRxGainTempLutData_t *data)
2617 {
2618  rlReturnVal_t retVal;
2619 
2620  /* check if deviceIndex is out of defined value */
2621  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2622  {
2623  /* set return error code */
2624  retVal = RL_RET_CODE_INVALID_INPUT;
2625  }
2626  else
2627  {
2628  /* Package the command with given data and send it to device */
2629  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2630  RL_RF_RX_GAIN_TEMPLUT_CONF_SB, (rlUInt8_t*)data,
2631  (rlUInt16_t)sizeof(rlRxGainTempLutData_t));
2632  }
2633  return retVal;
2634 }
2635 
2649 /* Sub block ID: 0x012C, ICD API: AWR_RX_GAIN_TEMPLUT_GET_SB */
2650 /* DesignId : MMWL_DesignId_058 */
2651 /* Requirements : AUTORADAR_REQ-897 */
2652 rlReturnVal_t rlRxGainTempLutGet(rlUInt8_t deviceMap, rlRxGainTempLutReadReq_t *inData,
2653  rlRxGainTempLutData_t *outData)
2654 {
2655  rlReturnVal_t retVal;
2656 
2657  RL_LOGV_ARG0("rlRxGainTempLutRead starts...\n");
2658 
2659  /* check if deviceIndex is out of defined value */
2660  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2661  (RL_NULL_PTR == inData))
2662  {
2663  /* set return error code */
2664  retVal = RL_RET_CODE_INVALID_INPUT;
2665  RL_LOGE_ARG0("rlRxGainTempLutRead, Invalid device map\n");
2666  }
2667  else
2668  {
2669  /* Initialize Command and Response Sub Blocks */
2670  rlDriverMsg_t inMsg = {0};
2671  rlDriverMsg_t outMsg = {0};
2672 
2673  /* Initialize Command and Response Sub Blocks */
2674  rlPayloadSb_t inPayloadSb = {0};
2675  rlPayloadSb_t outPayloadSb = {0};
2676 
2677  /* Fill in-message Payload */
2678  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_RX_GAIN_TEMPLUT_CONF_SB,
2679  &inPayloadSb, (rlUInt8_t *)inData,
2680  (rlUInt16_t)sizeof(rlRxGainTempLutReadReq_t));
2681 
2682  /* Construct command packet */
2683  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
2684 
2685  /* Fill out-message Payload */
2686  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)outData,
2687  (rlUInt16_t)sizeof(rlRxGainTempLutData_t));
2688 
2689  /* Construct response packet */
2690  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2691 
2692  /* Send Command to mmWave Radar Device */
2693  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2694  }
2695  RL_LOGV_ARG0("rlRxGainTempLutRead ends...\n");
2696 
2697  return retVal;
2698 }
2699 
2711 /* Sub block ID: 0x010D, ICD API: AWR_TX_GAIN_TEMPLUT_SET_SB */
2712 /* DesignId : MMWL_DesignId_059 */
2713 /* Requirements : AUTORADAR_REQ-898 */
2714 rlReturnVal_t rlTxGainTempLutSet(rlUInt8_t deviceMap, rlTxGainTempLutData_t *data)
2715 {
2716  rlReturnVal_t retVal;
2717 
2718  /* check if deviceIndex is out of defined value */
2719  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2720  {
2721  /* set return error code */
2722  retVal = RL_RET_CODE_INVALID_INPUT;
2723  }
2724  else
2725  {
2726  /* Package the command with given data and send it to device */
2727  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2728  RL_RF_TX_GAIN_TEMPLUT_CONF_SB, (rlUInt8_t*)data,
2729  (rlUInt16_t)sizeof(rlTxGainTempLutData_t));
2730  }
2731  return retVal;
2732 }
2733 
2747 /* Sub block ID: 0x012D, ICD API: AWR_TX_GAIN_TEMPLUT_GET_SB */
2748 /* DesignId : MMWL_DesignId_060 */
2749 /* Requirements : AUTORADAR_REQ-899 */
2750 rlReturnVal_t rlTxGainTempLutGet(rlUInt8_t deviceMap,
2752 {
2753  rlReturnVal_t retVal;
2754 
2755  RL_LOGV_ARG0("rlTxGainTempLutRead starts...\n");
2756 
2757  /* check if deviceIndex is out of defined value */
2758  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2759  (RL_NULL_PTR == inData))
2760  {
2761  /* set return error code */
2762  retVal = RL_RET_CODE_INVALID_INPUT;
2763  RL_LOGE_ARG0("rlTxGainTempLutRead, Invalid device map\n");
2764  }
2765  else
2766  {
2767  /* Initialize Command and Response Sub Blocks */
2768  rlDriverMsg_t inMsg = {0};
2769  rlDriverMsg_t outMsg = {0};
2770 
2771  /* Initialize Command and Response Sub Blocks */
2772  rlPayloadSb_t inPayloadSb = {0};
2773  rlPayloadSb_t outPayloadSb = {0};
2774 
2775  /* Fill in-message Payload */
2776  rlDriverFillPayload(RL_RF_DYNAMIC_CONF_GET_MSG, RL_RF_TX_GAIN_TEMPLUT_CONF_SB,
2777  &inPayloadSb, (rlUInt8_t *)inData,
2778  (rlUInt16_t)sizeof(rlTxGainTempLutReadReq_t));
2779 
2780  /* Construct command packet */
2781  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
2782 
2783  /* Fill out-message Payload */
2784  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)outData,
2785  (rlUInt16_t)sizeof(rlTxGainTempLutData_t));
2786 
2787  /* Construct response packet */
2788  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
2789 
2790  /* Send Command to mmWave Radar Device */
2791  retVal = rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
2792  }
2793  RL_LOGV_ARG0("rlTxGainTempLutRead ends...\n");
2794 
2795  return retVal;
2796 }
2797 
2818 /* Sub block ID: 0x008A, ICD API: AWR_CAL_MON_FREQUENCY_TX_POWER_LIMITS_SB */
2819 /* DesignId : MMWL_DesignId_066 */
2820 /* Requirements : AUTORADAR_REQ-905 */
2821 rlReturnVal_t rlRfTxFreqPwrLimitConfig(rlUInt8_t deviceMap, rlRfTxFreqPwrLimitMonConf_t* data)
2822 {
2823  rlReturnVal_t retVal;
2824 
2825  /* check if deviceIndex is out of defined value */
2826  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
2827  (RL_NULL_PTR == data))
2828  {
2829  /* set return error code */
2830  retVal = RL_RET_CODE_INVALID_INPUT;
2831  }
2832  else
2833  {
2834  /* Package the command with given data and send it to device */
2835  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
2836  RL_RF_TX_FREQ_PWR_LIMIT_SB,
2837  (rlUInt8_t*)data,
2838  (rlUInt16_t)sizeof(rlRfTxFreqPwrLimitMonConf_t));
2839  }
2840  return retVal;
2841 }
2842 
2874 /* Sub block ID: 0x010E, ICD API: AWR_LOOPBACK_BURST_CONF_SET_SB */
2875 /* DesignId : MMWL_DesignId_062 */
2876 /* Requirements : AUTORADAR_REQ-901 */
2877 rlReturnVal_t rlSetLoopBckBurstCfg(rlUInt8_t deviceMap, rlLoopbackBurst_t *data)
2878 {
2879  rlReturnVal_t retVal;
2880 
2881  /* check if deviceIndex is out of defined value */
2882  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
2883  {
2884  /* set return error code */
2885  retVal = RL_RET_CODE_INVALID_INPUT;
2886  }
2887  else
2888  {
2889  /* Package the command with given data and send it to device */
2890  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
2891  RL_RF_LB_BURST_CFG_SET_SB, (rlUInt8_t*)data,
2892  (rlUInt16_t)sizeof(rlLoopbackBurst_t));
2893  }
2894  return retVal;
2895 }
2896 
2914 /* Sub block ID: 0x010F, ICD API: AWR_DYN_CHIRP_CONF_SET_SB */
2915 /* DesignId : MMWL_DesignId_063 */
2916 /* Requirements : AUTORADAR_REQ-902 */
2917 rlReturnVal_t rlSetDynChirpCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt,
2918  rlDynChirpCfg_t **data)
2919 {
2920  rlReturnVal_t retVal;
2921 
2922  /* check if deviceIndex is out of defined value */
2923  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
2924  (segCnt == 0U))
2925  {
2926  /* set return error code */
2927  retVal = RL_RET_CODE_INVALID_INPUT;
2928  }
2929  else
2930  {
2931  /* Initialize Command and Response Sub Blocks */
2932  rlDriverMsg_t inMsg;
2933  rlDriverMsg_t outMsg = {0};
2934 
2935  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
2936  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
2937 
2938 
2939  /* Initialize Command and Response Sub Blocks */
2940  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlDynChirpCfg_t) + \
2941  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
2942 
2943  /* single sub-block length for chirp config API */
2944  sbLen = (rlUInt16_t)(sizeof(rlDynChirpCfg_t) + (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
2945 
2946 
2947  /* get Max Sub Block count */
2948  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
2949  /*LDRA_INSPECTED 127 D */
2950  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
2951 
2952  retVal = RL_RET_CODE_OK;
2953  /* if requested count of chirpConfig is within one Message packet */
2954  if (segCnt <= maxSbCntInMsg)
2955  {
2956  sbCntInMsg = segCnt;
2957  numChnkOfMsg = 1U;
2958  lastSbCntInMsg = 0U;
2959  }
2960  else
2961  {
2962  sbCntInMsg = maxSbCntInMsg;
2963  numChnkOfMsg = segCnt / maxSbCntInMsg;
2964  lastSbCntInMsg = segCnt % maxSbCntInMsg;
2965  }
2966 
2967  /* Fill in-message packet */
2968  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
2969 
2970  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
2971 
2972  while (retVal == RL_RET_CODE_OK)
2973  {
2974  /* all full messages have been sent, then send last partial message */
2975  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
2976  {
2977  inMsg.opcode.nsbc = lastSbCntInMsg;
2978  }
2979  else
2980  {
2981  inMsg.opcode.nsbc = sbCntInMsg;
2982  }
2983 
2984  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
2985  {
2986  /* Set Command Sub Block*/
2987  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2988  LDRA Tool Issue" */
2989  /*LDRA_INSPECTED 105 D */
2990  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
2991  RL_RF_DYN_CHIRP_CFG_SET_SB);
2992  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2993  LDRA Tool Issue" */
2994  /*LDRA_INSPECTED 105 D */
2995  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlDynChirpCfg_t);
2996  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
2997  LDRA Tool Issue" */
2998  /*LDRA_INSPECTED 105 D */
2999  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
3000 
3001  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
3002  next Config */
3003  /*LDRA_INSPECTED 567 S */
3004  data++;
3005  }
3006  /* Send Command to mmWave Radar Device */
3007  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3008  loopCnt--;
3009 
3010  if (loopCnt == 0U)
3011  {
3012  break;
3013  }
3014  }
3015  }
3016  return retVal;
3017 }
3018 
3038 /* Sub block ID: 0x0111, ICD API: AWR_DYN_CHIRP_ENABLE_SB */
3039 /* DesignId : MMWL_DesignId_064 */
3040 /* Requirements : AUTORADAR_REQ-903 */
3041 rlReturnVal_t rlSetDynChirpEn(rlUInt8_t deviceMap, rlDynChirpEnCfg_t *data)
3042 {
3043  rlReturnVal_t retVal;
3044 
3045  /* check if deviceIndex is out of defined value */
3046  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3047  {
3048  /* set return error code */
3049  retVal = RL_RET_CODE_INVALID_INPUT;
3050  }
3051  else
3052  {
3053  /* Package the command with given data and send it to device */
3054  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3055  RL_RF_DYN_CHIRP_CFG_EN_SB, (rlUInt8_t*)data,
3056  (rlUInt16_t)sizeof(rlDynChirpEnCfg_t));
3057  }
3058  return retVal;
3059 }
3060 
3087 /* Sub block ID: 0x0110, ICD API: AWR_DYN_PERCHIRP_PHASESHIFTER_CONF_SET_SB */
3088 /* DesignId : MMWL_DesignId_065 */
3089 /* Requirements : AUTORADAR_REQ-904 */
3090 rlReturnVal_t rlSetDynPerChirpPhShifterCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt,
3091  rlDynPerChirpPhShftCfg_t **data)
3092 {
3093  rlReturnVal_t retVal;
3094 
3095  /* check if deviceIndex is out of defined value */
3096  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data) || \
3097  (segCnt == 0U))
3098  {
3099  /* set return error code */
3100  retVal = RL_RET_CODE_INVALID_INPUT;
3101  }
3102  else
3103  {
3104  /* Initialize Command and Response Sub Blocks */
3105  rlDriverMsg_t inMsg;
3106  rlDriverMsg_t outMsg = {0};
3107 
3108  /* Index and other paramerters to send multiple sub blocks in one/more commands chunk */
3109  rlUInt16_t sbLen, maxSbCntInMsg, sbCntInMsg, numChnkOfMsg, lastSbCntInMsg, loopCnt, indx;
3110 
3111  /* Initialize Command and Response Sub Blocks */
3112  rlPayloadSb_t inPayloadSb[RL_CMD_PL_LEN_MAX/(sizeof(rlDynPerChirpPhShftCfg_t) + \
3113  RL_SBC_ID_SIZE + RL_SBC_LEN_SIZE)];
3114 
3115  /* single sub-block length for chirp config API */
3116  sbLen = (rlUInt16_t)(sizeof(rlDynPerChirpPhShftCfg_t) + \
3117  (RL_SBC_LEN_SIZE + RL_SBC_ID_SIZE));
3118 
3119  /* get Max Sub Block count */
3120  /* AR_CODE_REVIEW MR:D.4.1 <APPROVED> "sbLen can not be zero" */
3121  /*LDRA_INSPECTED 127 D */
3122  maxSbCntInMsg = (RL_CMD_PL_LEN_MAX /sbLen);
3123 
3124  retVal = RL_RET_CODE_OK;
3125  /* if requested count of chirpConfig is within one Message packet */
3126  if (segCnt <= maxSbCntInMsg)
3127  {
3128  sbCntInMsg = segCnt;
3129  numChnkOfMsg = 1U;
3130  lastSbCntInMsg = 0U;
3131  }
3132  else
3133  {
3134  sbCntInMsg = maxSbCntInMsg;
3135  numChnkOfMsg = segCnt / maxSbCntInMsg;
3136  lastSbCntInMsg = segCnt % maxSbCntInMsg;
3137  }
3138 
3139  /* Fill in-message packet */
3140  rlDriverConstructInMsg(RL_RF_DYNAMIC_CONF_SET_MSG, &inMsg, &inPayloadSb[0]);
3141 
3142  loopCnt = (lastSbCntInMsg == 0U) ? numChnkOfMsg : (numChnkOfMsg + 1U);
3143 
3144  while (retVal == RL_RET_CODE_OK)
3145  {
3146  /* all full messages have been sent, then send last partial message */
3147  if ((loopCnt == 1U) && (lastSbCntInMsg != 0U))
3148  {
3149  inMsg.opcode.nsbc = lastSbCntInMsg;
3150  }
3151  else
3152  {
3153  inMsg.opcode.nsbc = sbCntInMsg;
3154  }
3155 
3156  for (indx = 0U; indx < inMsg.opcode.nsbc; indx++)
3157  {
3158  /* Set Command Sub Block*/
3159  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function.\
3160  LDRA Tool Issue" */
3161  /*LDRA_INSPECTED 105 D */
3162  inPayloadSb[indx].sbid = RL_GET_UNIQUE_SBID(RL_RF_DYNAMIC_CONF_SET_MSG,
3163  RL_RF_DYN_PERCHIRP_PHSHFT_CFG_SET_SB);
3164  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
3165  LDRA Tool Issue" */
3166  /*LDRA_INSPECTED 105 D */
3167  inPayloadSb[indx].len = (rlUInt16_t)sizeof(rlDynPerChirpPhShftCfg_t);
3168  /* AR_CODE_REVIEW MR:R.2.2 <APPROVED> "Values are used by called function. \
3169  LDRA Tool Issue" */
3170  /*LDRA_INSPECTED 105 D */
3171  inPayloadSb[indx].pSblkData = (rlUInt8_t*)(*data);
3172  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to \
3173  next Config */
3174  /*LDRA_INSPECTED 567 S */
3175  data++;
3176  }
3177  /* Send Command to mmWave Radar Device */
3178  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3179  loopCnt--;
3180 
3181  if (loopCnt == 0U)
3182  {
3183  break;
3184  }
3185  }
3186  }
3187  return retVal;
3188 }
3189 
3215 /* Sub block ID: 0x008B, ICD API: AWR_CAL_DATA_RESTORE_SB */
3216 /* DesignId : MMWL_DesignId_067 */
3217 /* Requirements : AUTORADAR_REQ-906 */
3218 rlReturnVal_t rlRfCalibDataRestore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
3219 {
3220  rlReturnVal_t retVal;
3221  rlUInt8_t idx;
3222 
3223  /* check if deviceIndex is out of defined value */
3224  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3225  {
3226  /* set return error code */
3227  retVal = RL_RET_CODE_INVALID_INPUT;
3228  }
3229  else
3230  {
3231  /* Initialize Command and Response Sub Blocks */
3232  rlDriverMsg_t inMsg = {0};
3233  rlDriverMsg_t outMsg = {0};
3234  rlPayloadSb_t inPayloadSb = {0};
3235  rlPayloadSb_t outPayloadSb = {0};
3236  /* set return value to zero by default */
3237  retVal = RL_RET_CODE_OK;
3238  /* Invoke Set Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3239  for (idx = 0U; idx < RL_MAX_CALIB_DATA_CHUNK; idx++)
3240  {
3241  /* Construct command packet */
3242  rlDriverConstructInMsg(RL_RF_STATIC_CONF_SET_MSG, &inMsg, &inPayloadSb);
3243  /* Fill in-message Payload */
3244  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3245  next calibData */
3246  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3247  next calibData */
3248  /*LDRA_INSPECTED 87 S */
3249  /*LDRA_INSPECTED 567 S */
3250  rlDriverFillPayload(RL_RF_STATIC_CONF_SET_MSG, RL_RF_CAL_DATA_RD_WR_SB, &inPayloadSb,
3251  (rlUInt8_t*)(&data->calibChunk[idx]),
3252  (rlUInt16_t)sizeof(rlCalDataStore_t));
3253 
3254  /* Construct response packet */
3255  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3256  /* Fill in-message Payload */
3257  rlDriverFillPayload(0U, 0U, &outPayloadSb, NULL, 0U);
3258 
3259  /* Send Command to mmWave Radar Device */
3260  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3261  /* check for return value */
3262  if (RL_RET_CODE_OK != retVal)
3263  {
3264  /* If command invoke is failed then terminate this loop */
3265  break;
3266  }
3267  }
3268 
3269  }
3270  return retVal;
3271 }
3272 
3297 /* Sub block ID: 0x00AB, ICD API: AWR_CAL_DATA_SAVE_SB */
3298 /* DesignId : MMWL_DesignId_068 */
3299 /* Requirements : AUTORADAR_REQ-906 */
3300 rlReturnVal_t rlRfCalibDataStore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
3301 {
3302  rlReturnVal_t retVal;
3303 
3304  /* check if deviceIndex is out of defined value */
3305  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3306  {
3307  /* set return error code */
3308  retVal = RL_RET_CODE_INVALID_INPUT;
3309  }
3310  else
3311  {
3312  /* Initialize Command and Response Sub Blocks */
3313  rlDriverMsg_t inMsg = {0};
3314  rlDriverMsg_t outMsg = {0};
3315  rlPayloadSb_t inPayloadSb = {0};
3316  rlPayloadSb_t outPayloadSb = {0};
3317  rlCalDataGetCfg_t caldataGetCfg = {0U};
3318  rlUInt8_t idx;
3319  /* set return value to zero by default */
3320  retVal = RL_RET_CODE_OK;
3321  /* Invoke Get Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3322  for (idx = 0U; idx < RL_MAX_CALIB_DATA_CHUNK; idx++)
3323  {
3324  /* Construct command packet */
3325  rlDriverConstructInMsg(RL_RF_STATIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
3326  /* Fill in-message Payload */
3327  rlDriverFillPayload(RL_RF_STATIC_CONF_GET_MSG, RL_RF_CAL_DATA_RD_WR_SB, &inPayloadSb,
3328  (rlUInt8_t*)&caldataGetCfg, (rlUInt16_t)sizeof(rlCalDataGetCfg_t));
3329 
3330  /* Construct response packet */
3331  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3332  /* Fill in-message Payload */
3333  /*AR_CODE_REVIEW MR:R.18.1 <APPROVED> "require pointer increment to jump to
3334  next calibData */
3335  /*AR_CODE_REVIEW MR:R.18.4 <APPROVED> "require pointer increment to jump to
3336  next calibData */
3337  /*LDRA_INSPECTED 87 S */
3338  /*LDRA_INSPECTED 567 S */
3339  rlDriverFillPayload(0U, 0U, &outPayloadSb, (rlUInt8_t*)(&data->calibChunk[idx]), 0U);
3340 
3341  /* Send Command to mmWave Radar Device */
3342  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3343  /* check for return value */
3344  if (RL_RET_CODE_OK != retVal)
3345  {
3346  /* If command invoke is failed then terminate this loop */
3347  break;
3348  }
3349  /* increment Chunk ID for next Get Command */
3350  caldataGetCfg.chunkId++;
3351  }
3352  }
3353  return retVal;
3354 }
3355 
3379 /* Sub block ID: 0x010B, ICD API: AWR_DIGITAL_COMP_EST_CONTROL_SB */
3380 /* DesignId : MMWL_DesignId_061 */
3381 /* Requirements : AUTORADAR_REQ-900 */
3382 rlReturnVal_t rlRfInterRxGainPhaseConfig(rlUInt8_t deviceMap,
3383  rlInterRxGainPhConf_t* data)
3384 {
3385  rlReturnVal_t retVal;
3386 
3387  /* check if deviceIndex is out of defined value */
3388  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3389  {
3390  /* set return error code */
3391  retVal = RL_RET_CODE_INVALID_INPUT;
3392  }
3393  else
3394  {
3395  /* Package the command with given data and send it to device */
3396  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3397  RL_RF_DIG_COMP_EST_CTRL_SB, (rlUInt8_t*)data,
3398  (rlUInt16_t)sizeof(rlInterRxGainPhConf_t));
3399  }
3400  return retVal;
3401 }
3402 
3413 /* Sub block ID: 0x0224, ICD API: AWR_RF_BOOTUPBIST_STATUS_GET_SB */
3414 /* DesignId : MMWL_DesignId_096 */
3415 /* Requirements : AUTORADAR_REQ-911 */
3416 rlReturnVal_t rlGetRfBootupStatus(rlUInt8_t deviceMap, rlRfBootStatusCfg_t *data)
3417 {
3418  rlReturnVal_t retVal;
3419 
3420  /* check for NULL pointer */
3421  if (data == RL_NULL_PTR)
3422  {
3423  /* set error code if data pointer is passed NULL */
3424  retVal = RL_RET_CODE_NULL_PTR;
3425  }
3426  else
3427  {
3428  /* Package the command with given data and send it to device */
3429  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3430  RL_RF_BOOTUP_BIST_STATUS_SB, (rlUInt8_t*)data, 0U);
3431  }
3432 
3433  return retVal;
3434 }
3435 
3456 /* Sub block ID: 0x0112, ICD API: AWR_INTERCHIRP_BLOCKCONTROLS_SB */
3457 /* DesignId : MMWL_DesignId_097 */
3458 /* Requirements : AUTORADAR_REQ-912 */
3459 rlReturnVal_t rlSetInterChirpBlkCtrl(rlUInt8_t deviceMap,
3461 {
3462  rlReturnVal_t retVal;
3463 
3464  /* check if deviceIndex is out of defined value */
3465  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3466  {
3467  /* set return error code */
3468  retVal = RL_RET_CODE_INVALID_INPUT;
3469  }
3470  else
3471  {
3472  /* Package the command with given data and send it to device */
3473  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3474  RL_RF_INTERCHIRP_BLOCK_CTRL_SB, (rlUInt8_t*)data,
3475  (rlUInt16_t)sizeof(rlInterChirpBlkCtrlCfg_t));
3476  }
3477  return retVal;
3478 }
3479 
3508 /* Sub block ID: 0x0113, ICD API: AWR_SUBFRAME_START_CONF_SB */
3509 /* DesignId : MMWL_DesignId_107 */
3510 /* Requirements : AUTORADAR_REQ-938, AUTORADAR_REQ-1021 */
3511 rlReturnVal_t rlSetSubFrameStart(rlUInt8_t deviceMap,
3512  rlSubFrameStartCfg_t *data)
3513 {
3514  rlReturnVal_t retVal;
3515 
3516  /* check if deviceIndex is out of defined value */
3517  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3518  {
3519  /* set return error code */
3520  retVal = RL_RET_CODE_INVALID_INPUT;
3521  }
3522  else
3523  {
3524  /* Package the command with given data and send it to device */
3525  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3526  RL_RF_SUBFRAME_START_SB, (rlUInt8_t*)data,
3527  (rlUInt16_t)sizeof(rlSubFrameStartCfg_t));
3528  }
3529  return retVal;
3530 }
3531 
3550 /* Sub block ID: 0x008C, ICD API: AWR_PHASE_SHIFTER_CAL_DATA_RESTORE_SB */
3551 /* DesignId : MMWL_DesignId_109 */
3552 /* Requirements : AUTORADAR_REQ-1003 */
3553 rlReturnVal_t rlRfPhShiftCalibDataRestore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
3554 {
3555  rlReturnVal_t retVal;
3556  rlUInt8_t idx;
3557 
3558  /* check if deviceIndex is out of defined value */
3559  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3560  {
3561  /* set return error code */
3562  retVal = RL_RET_CODE_INVALID_INPUT;
3563  }
3564  else
3565  {
3566  /* Initialize Command and Response Sub Blocks */
3567  rlDriverMsg_t inMsg = { 0 };
3568  rlDriverMsg_t outMsg = { 0 };
3569  rlPayloadSb_t inPayloadSb = { 0 };
3570  rlPayloadSb_t outPayloadSb = { 0 };
3571  /* set return value to zero by default */
3572  retVal = RL_RET_CODE_OK;
3573  /* Invoke Set Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3574  for (idx = 0U; idx < RL_TX_CNT; idx++)
3575  {
3576  /* Construct command packet */
3577  rlDriverConstructInMsg(RL_RF_STATIC_CONF_SET_MSG, &inMsg, &inPayloadSb);
3578  if (idx == (RL_TX_CNT - 1U))
3579  {
3580  data->PhShiftcalibChunk[idx].calibApply = 1U;
3581  }
3582  else
3583  {
3584  data->PhShiftcalibChunk[idx].calibApply = 0U;
3585  }
3586  data->PhShiftcalibChunk[idx].txIndex = idx;
3587  /* Fill in-message Payload */
3588  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3589  next calibData */
3590  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3591  next calibData */
3592  /*LDRA_INSPECTED 87 S */
3593  /*LDRA_INSPECTED 567 S */
3594  rlDriverFillPayload(RL_RF_STATIC_CONF_SET_MSG, RL_RF_PH_SHIFT_CAL_DATA_RD_WR_SB,
3595  &inPayloadSb, (rlUInt8_t*)(&data->PhShiftcalibChunk[idx]),
3596  (rlUInt16_t)sizeof(rlPhShiftCalibrationStore_t));
3597 
3598  /* Construct response packet */
3599  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3600  /* Fill in-message Payload */
3601  rlDriverFillPayload(0U, 0U, &outPayloadSb, NULL, 0U);
3602 
3603  /* Send Command to mmWave Radar Device */
3604  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3605  /* check for return value */
3606  if (RL_RET_CODE_OK != retVal)
3607  {
3608  /* If command invoke is failed then terminate this loop */
3609  break;
3610  }
3611  }
3612 
3613  }
3614  return retVal;
3615 }
3616 
3636 /* Sub block ID: 0x00AC, ICD API: AWR_PHASE_SHIFTER_CAL_DATA_SAVE_SB */
3637 /* DesignId : MMWL_DesignId_108 */
3638 /* Requirements : AUTORADAR_REQ-1003 */
3639 rlReturnVal_t rlRfPhShiftCalibDataStore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
3640 {
3641  rlReturnVal_t retVal;
3642 
3643  /* check if deviceIndex is out of defined value */
3644  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3645  {
3646  /* set return error code */
3647  retVal = RL_RET_CODE_INVALID_INPUT;
3648  }
3649  else
3650  {
3651  /* Initialize Command and Response Sub Blocks */
3652  rlDriverMsg_t inMsg = {0};
3653  rlDriverMsg_t outMsg = {0};
3654  rlPayloadSb_t inPayloadSb = {0};
3655  rlPayloadSb_t outPayloadSb = {0};
3656  rlPhShiftCalDataGetCfg_t phShifterCaldataGetCfg = {0U};
3657  rlUInt8_t idx;
3658  /* set return value to zero by default */
3659  /* AR_CODE_REVIEW MR:R.2.2 <REVIEWED> "retVal initialized to 0 if not it means error" */
3660  /*LDRA_INSPECTED 8 D */
3661  retVal = RL_RET_CODE_OK;
3662  /* Invoke Get Calibration data command for RL_MAX_CALIB_DATA_CHUNK chunks */
3663  for (idx = 0U; idx < RL_TX_CNT; idx++)
3664  {
3665  if ((RL_NULL_PTR != &data->PhShiftcalibChunk[idx]))
3666  {
3667  phShifterCaldataGetCfg.txIndex = idx;
3668  /* Construct command packet */
3669  rlDriverConstructInMsg(RL_RF_STATIC_CONF_GET_MSG, &inMsg, &inPayloadSb);
3670  /* Fill in-message Payload */
3671  rlDriverFillPayload(RL_RF_STATIC_CONF_GET_MSG, RL_RF_PH_SHIFT_CAL_DATA_RD_WR_SB,
3672  &inPayloadSb, (rlUInt8_t*)&phShifterCaldataGetCfg,
3673  (rlUInt16_t)sizeof(rlPhShiftCalDataGetCfg_t));
3674 
3675  /* Construct response packet */
3676  rlDriverConstructOutMsg(1U, &outMsg, &outPayloadSb);
3677  /* Fill in-message Payload */
3678  /*AR_CODE_REVIEW MR:R.18.1 <REVIEWED> "require pointer increment to jump to
3679  next calibData */
3680  /*AR_CODE_REVIEW MR:R.18.4 <REVIEWED> "require pointer increment to jump to
3681  next calibData */
3682  /*LDRA_INSPECTED 87 S */
3683  /*LDRA_INSPECTED 567 S */
3684  rlDriverFillPayload(0U, 0U, &outPayloadSb,
3685  (rlUInt8_t*)(&data->PhShiftcalibChunk[idx]), 0U);
3686 
3687  /* Send Command to mmWave Radar Device */
3688  retVal += rlDriverCmdInvoke(deviceMap, inMsg, &outMsg);
3689  /* check for return value */
3690  if (RL_RET_CODE_OK != retVal)
3691  {
3692  /* If command invoke is failed then terminate this loop */
3693  break;
3694  }
3695  }
3696  }
3697  }
3698  return retVal;
3699 }
3700 
3711 /* Sub block ID: 0x0223, ICD API: AWR_RF_DIEID_GET_SB */
3712 /* DesignId : MMWL_DesignId_110 */
3713 /* Requirements : AUTORADAR_REQ-1004, AUTORADAR_REQ-1027 */
3714 rlReturnVal_t rlGetRfDieId(rlUInt8_t deviceMap, rlRfDieIdCfg_t *data)
3715 {
3716  rlReturnVal_t retVal;
3717 
3718  /* check for NULL pointer */
3719  if (data == RL_NULL_PTR)
3720  {
3721  /* set error code if data pointer is passed NULL */
3722  retVal = RL_RET_CODE_NULL_PTR;
3723  }
3724  else
3725  {
3726  /* Package the command with given data and send it to device */
3727  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3728  RL_RF_DIEID_STATUS_SB, (rlUInt8_t*)data, 0U);
3729  }
3730 
3731  return retVal;
3732 }
3733 
3744 /* Sub block ID: 0x0221, ICD API: AWR_RF_CPUFAULT_STATUS_GET_SB */
3745 /* DesignId : MMWL_DesignId_123 */
3746 /* Requirements : AUTORADAR_REQ-1039, AUTORADAR_REQ-1060 */
3747 rlReturnVal_t rlRfGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
3748 {
3749  rlReturnVal_t retVal;
3750 
3751  RL_LOGV_ARG0("rlRfGetCpuFault starts...\n");
3752 
3753  /* check if deviceIndex is out of defined value */
3754  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
3755  (RL_NULL_PTR == data))
3756  {
3757  /* set error code if DeviceMAP is invalid or data pointer is null */
3758  retVal = RL_RET_CODE_INVALID_INPUT;
3759  RL_LOGE_ARG0("Invalid input");
3760  }
3761  else
3762  {
3763  /* Package the command with given data and send it to device */
3764  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3765  RL_RF_RFCPUFAULT_STATUS_SB, (rlUInt8_t*)data,
3766  (rlUInt16_t)sizeof(rlCpuFault_t));
3767  }
3768  RL_LOGV_ARG0("rlRfGetCpuFault ends...\n");
3769 
3770  return retVal;
3771 }
3772 
3783 /* Sub block ID: 0x0222, ICD API: AWR_RF_ESMFAULT_STATUS_GET_SB */
3784 /* DesignId : MMWL_DesignId_123 */
3785 /* Requirements : AUTORADAR_REQ-1039 */
3786 rlReturnVal_t rlRfGetEsmFault(rlUInt8_t deviceMap, rlBssEsmFault_t *data)
3787 {
3788  rlReturnVal_t retVal;
3789 
3790  RL_LOGV_ARG0("rlRfGetEsmFault starts...\n");
3791 
3792  /* check if deviceIndex is out of defined value */
3793  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
3794  (RL_NULL_PTR == data))
3795  {
3796  /* set error code if DeviceMAP is invalid or data pointer is null */
3797  retVal = RL_RET_CODE_INVALID_INPUT;
3798  RL_LOGE_ARG0("Invalid input");
3799  }
3800  else
3801  {
3802  /* Package the command with given data and send it to device */
3803  retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_STATUS_GET_MSG,
3804  RL_RF_RFESMFAULT_STATUS_SB, (rlUInt8_t*)data,
3805  (rlUInt16_t)sizeof(rlBssEsmFault_t));
3806  }
3807  RL_LOGV_ARG0("rlRfGetEsmFault ends...\n");
3808 
3809  return retVal;
3810 }
3811 
3890 /* Sub block ID: 0x0115, ICD API: AWR_ADVANCE_CHIRP_CONF_SB */
3891 /* DesignId : MMWL_DesignId_129 */
3892 /* Requirements : AUTORADAR_REQ-1050, AUTORADAR_REQ-1043 */
3893 rlReturnVal_t rlSetAdvChirpConfig(rlUInt8_t deviceMap, rlAdvChirpCfg_t *data)
3894 {
3895  rlReturnVal_t retVal;
3896 
3897  RL_LOGV_ARG0("rlSetAdvChirpConfig starts...\n");
3898 
3899  /* check if deviceIndex is out of defined value */
3900  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3901  {
3902  /* set return error code */
3903  retVal = RL_RET_CODE_INVALID_INPUT;
3904  RL_LOGE_ARG0("rlSetAdvChirpConfig, Invalid device map\n");
3905  }
3906  else
3907  {
3908  /* Package the command with given data and send it to device */
3909  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3910  RL_RF_ADV_CHIRP_CFG_SET_SB,
3911  (rlUInt8_t*)(data),
3912  (rlUInt16_t)sizeof(rlAdvChirpCfg_t));
3913  }
3914 
3915  RL_LOGV_ARG0("rlSetAdvChirpConfig ends...\n");
3916 
3917  return retVal;
3918 }
3919 
3961 /* Sub block ID: 0x0117, ICD API: AWR_MONITOR_TYPE_TRIG_CONF_SB */
3962 /* DesignId : MMWL_DesignId_125 */
3963 /* Requirements : AUTORADAR_REQ-1055 */
3964 rlReturnVal_t rlMonTypeTrigConfig(rlUInt8_t deviceMap, rlMonTypeTrigCfg_t *data)
3965 {
3966  rlReturnVal_t retVal;
3967 
3968  RL_LOGV_ARG0("rlMonTypeTrigConfig starts...\n");
3969 
3970  /* check if deviceIndex is out of defined value */
3971  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
3972  {
3973  /* set return error code */
3974  retVal = RL_RET_CODE_INVALID_INPUT;
3975  RL_LOGE_ARG0("rlMonTypeTrigConfig, Invalid device map\n");
3976  }
3977  else
3978  {
3979  /* Package the command with given data and send it to device */
3980  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
3981  RL_RF_MONITOR_TYPE_TRIG_CONF_SB,
3982  (rlUInt8_t*)(data),
3983  (rlUInt16_t)sizeof(rlMonTypeTrigCfg_t));
3984  }
3985 
3986  RL_LOGV_ARG0("rlMonTypeTrigConfig ends...\n");
3987 
3988  return retVal;
3989 }
3990 
4006 /* Sub block ID: 0x008D, ICD API: AWR_APLL_SYNTH_BW_CONTROL_SB */
4007 /* DesignId : MMWL_DesignId_126 */
4008 /* Requirements : AUTORADAR_REQ-1053 */
4009 rlReturnVal_t rlRfApllSynthBwCtlConfig(rlUInt8_t deviceMap, rlRfApllSynthBwControl_t* data)
4010 {
4011  rlReturnVal_t retVal;
4012 
4013  /* check if deviceIndex is out of defined value */
4014  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
4015  (RL_NULL_PTR == data))
4016  {
4017  /* set return error code */
4018  retVal = RL_RET_CODE_INVALID_INPUT;
4019  }
4020  else
4021  {
4022  /* Package the command with given data and send it to device */
4023  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_STATIC_CONF_SET_MSG,
4024  RL_RF_APLL_SYNTH_BW_CTL_SB,
4025  (rlUInt8_t*)data,
4026  (rlUInt16_t)sizeof(rlRfApllSynthBwControl_t));
4027  }
4028  return retVal;
4029 }
4030 
4060 /* Sub block ID: 0x0116, ICD API: AWR_ADVANCE_CHIRP_GENERIC_LUT_LOAD_SB */
4061 /* DesignId : MMWL_DesignId_130 */
4062 /* Requirements : AUTORADAR_REQ-1050 */
4063 rlReturnVal_t rlSetAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *data)
4064 {
4065  rlReturnVal_t retVal;
4066 
4067  RL_LOGV_ARG0("rlSetAdvChirpLUTConfig starts...\n");
4068 
4069  /* check if deviceIndex is out of defined value */
4070  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
4071  {
4072  /* set return error code */
4073  retVal = RL_RET_CODE_INVALID_INPUT;
4074  RL_LOGE_ARG0("rlSetAdvChirpLUTConfig, Invalid device map\n");
4075  }
4076  else
4077  {
4078  /* Package the command with given data and send it to device */
4079  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
4080  RL_RF_ADV_CHIRP_CFG_LUT_SET_SB,
4081  (rlUInt8_t*)(data),
4082  (rlUInt16_t)sizeof(rlAdvChirpLUTCfg_t));
4083  }
4084 
4085  RL_LOGV_ARG0("rlSetAdvChirpLUTConfig ends...\n");
4086 
4087  return retVal;
4088 }
4089 
4108 /* Sub block ID: 0x0116, ICD API: AWR_ADVANCE_CHIRP_GENERIC_LUT_LOAD_SB */
4109 /* DesignId : MMWL_DesignId_131 */
4110 /* Requirements : AUTORADAR_REQ-1050 */
4111 /*AR_CODE_REVIEW MR:R.2.2 <APPROVED> "numBytes is re initialized under different conditions" */
4112 /*LDRA_INSPECTED 8 D */
4113 rlReturnVal_t rlSetMultiAdvChirpLUTConfig(rlUInt8_t deviceMap,
4114  rlAdvChirpLUTCfg_t* AdvChirpLUTCfgArgs,
4115  rlInt8_t* AdvChirpLUTData)
4116 {
4117  rlReturnVal_t retVal = RL_RET_CODE_OK;
4118  /* Structure used to send the LUT RAM data to populate the LUT at the device end */
4119  rlAdvChirpLUTCfg_t AdvChirpLUTCfgChunk = { 0 };
4120  /* Variables to keep track of the number of chunks and the chunk size */
4121  rlUInt16_t chunkCount = 0U, totalChunkCount, lastChunkSize;
4122 
4123  RL_LOGV_ARG0("rlSetMultiAdvChirpLUTConfig starts...\n");
4124 
4125  /* check if deviceIndex is out of defined value */
4126  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
4127  (RL_NULL_PTR == AdvChirpLUTCfgArgs) || (RL_NULL_PTR == AdvChirpLUTData))
4128  {
4129  /* set return error code */
4130  retVal += RL_RET_CODE_INVALID_INPUT;
4131  RL_LOGE_ARG0("rlSetMultiAdvChirpLUTConfig, Invalid input params\n");
4132  }
4133  else
4134  {
4135  RL_LOGV_ARG2("rlSetMultiAdvChirpLUTConfig with \nlutAddOffset[%d]\nnumBytes[%d] \n\n",\
4136  AdvChirpLUTCfgArgs->lutAddressOffset, AdvChirpLUTCfgArgs->numBytes);
4137 
4138  /* If the LUT size to be programmed is more than 212 bytes, then break them into chunks
4139  of 212 bytes and send them one after the other over SPI */
4140  if (AdvChirpLUTCfgArgs->numBytes > RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE)
4141  {
4142  /* If the overall LUT size is a multiple of 212 bytes */
4143  if ((AdvChirpLUTCfgArgs->numBytes % RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE) == 0U)
4144  {
4145  lastChunkSize = RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE;
4146  totalChunkCount = \
4147  (rlUInt16_t)(AdvChirpLUTCfgArgs->numBytes / RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE);
4148  }
4149  /* Else, keep track of the remaining bytes in the last chunk */
4150  else
4151  {
4152  totalChunkCount = \
4153  (rlUInt16_t)((AdvChirpLUTCfgArgs->numBytes/RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE) + 1U);
4154  lastChunkSize = \
4155  (rlUInt16_t)(AdvChirpLUTCfgArgs->numBytes % RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE);
4156  }
4157  }
4158  /* If the total size of the LUT to be programmed is less than 212 bytes, it can be
4159  sent in a single chunk */
4160  else
4161  {
4162  totalChunkCount = 1U;
4163  /* last chunk size is same as total number of bytes in this case */
4164  lastChunkSize = AdvChirpLUTCfgArgs->numBytes;
4165  }
4166 
4167  while (chunkCount < totalChunkCount)
4168  {
4169  RL_LOGV_ARG1("Sending Advanced Chirp LUT data Chunk [%d]... \n\n", chunkCount);
4170  /* Update the LUT Address offset for every chunk */
4171  AdvChirpLUTCfgChunk.lutAddressOffset = \
4172  (rlUInt16_t)(AdvChirpLUTCfgArgs->lutAddressOffset + \
4173  (chunkCount * RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE));
4174 
4175  /* If the data belongs to last chunk or if it is a single chunk */
4176  if (chunkCount == (totalChunkCount - 1U))
4177  {
4178  AdvChirpLUTCfgChunk.numBytes = lastChunkSize;
4179  }
4180  /* For other intermediate chunks, send the entire length of 212 bytes */
4181  else
4182  {
4183  AdvChirpLUTCfgChunk.numBytes = RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE;
4184  }
4185 
4186  if (AdvChirpLUTCfgChunk.numBytes > 0U)
4187  {
4188  /* Copy the input AdvChirpLUTData to LUT structure */
4189  /*AR_CODE_REVIEW MR:R.18.1 <INSPECTED> "Accessing pointer as array"*/
4190  /*LDRA_INSPECTED 436 S */
4191  (void)memcpy(&AdvChirpLUTCfgChunk.calData[0U], \
4192  &AdvChirpLUTData[chunkCount * RL_MAX_ADV_CHIRP_LUT_CHUNK_SIZE], \
4193  AdvChirpLUTCfgChunk.numBytes);
4194 
4195  RL_LOGV_ARG2("rlSetAdvChirpLUTConfig with \nlutAddOffset[%d]\nnumBytes[%d] \n\n",\
4196  AdvChirpLUTCfgChunk.lutAddressOffset, AdvChirpLUTCfgChunk.numBytes);
4197  /* Send the LUT RAM structure (chunk) to the device */
4198  retVal += rlSetAdvChirpLUTConfig(deviceMap, &AdvChirpLUTCfgChunk);
4199 
4200  if (retVal != RL_RET_CODE_OK)
4201  {
4202  RL_LOGV_ARG2("Advanced Chirp LUT data Chunk [%d] failed with error code %d",\
4203  chunkCount, retVal);
4204  break;
4205  }
4206  }
4207  else
4208  {
4209  /* set return error code */
4210  retVal += RL_RET_CODE_INVALID_INPUT;
4211  RL_LOGV_ARG2("Invalid input, Chirp LUT Chunk [%d] is programmed with %d bytes",\
4212  chunkCount, AdvChirpLUTCfgChunk.numBytes);
4213  }
4214 
4215  chunkCount++;
4216  }
4217  }
4218 
4219  RL_LOGV_ARG0("rlSetMultiAdvChirpLUTConfig ends...\n");
4220 
4221  return retVal;
4222 }
4223 
4240 /* Sub block ID: 0x0118, ICD API: AWR_ADVANCE_CHIRP_DYN_LUT_ADDR_OFFSET_CFG_SB */
4241 /* DesignId : MMWL_DesignId_132 */
4242 /* Requirements : AUTORADAR_REQ-1050 */
4243 rlReturnVal_t rlSetAdvChirpDynLUTAddrOffConfig(rlUInt8_t deviceMap, \
4245 {
4246  rlReturnVal_t retVal;
4247 
4248  RL_LOGV_ARG0("rlSetAdvChirpDynLUTAddrOffConfig starts...\n");
4249 
4250  /* check if deviceIndex is out of defined value */
4251  if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || (RL_NULL_PTR == data))
4252  {
4253  /* set return error code */
4254  retVal = RL_RET_CODE_INVALID_INPUT;
4255  RL_LOGE_ARG0("rlSetAdvChirpDynLUTAddrOffConfig, Invalid device map\n");
4256  }
4257  else
4258  {
4259  /* Package the command with given data and send it to device */
4260  retVal = rlDriverExecuteSetApi(deviceMap, RL_RF_DYNAMIC_CONF_SET_MSG,
4261  RL_RF_ADV_CHIRP_DYN_LUT_ADD_OFF_CONF_SB,
4262  (rlUInt8_t*)(data),
4263  (rlUInt16_t)sizeof(rlAdvChirpDynLUTAddrOffCfg_t));
4264  }
4265 
4266  RL_LOGV_ARG0("rlSetAdvChirpDynLUTAddrOffConfig ends...\n");
4267 
4268  return retVal;
4269 }
4270 
4271 /*
4272  * END OF rl_sensor.c FILE
4273  */
Radar RF LDO bypass enable/disable configuration.
Definition: rl_sensor.h:2103
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:3459
rlReturnVal_t rlGetRfBootupStatus(rlUInt8_t deviceMap, rlRfBootStatusCfg_t *data)
Get radarSS bootup status.
Definition: rl_sensor.c:3416
Test source Enable API parameters RL_RF_TEST_SOURCE_ENABLE_SB.
Definition: rl_sensor.h:1727
Radar RF Calibration monitoring time unit configuration.
Definition: rl_sensor.h:2621
rlReturnVal_t rlSetTestSourceConfig(rlUInt8_t deviceMap, rlTestSource_t *data)
Configures the Test Source.
Definition: rl_sensor.c:1658
Advanced chirp configuration structure.
Definition: rl_sensor.h:4770
Advance Frame Sequence config API parameters rlAdvFrameCfg, 148 bytes.
Definition: rl_sensor.h:1377
rlReturnVal_t rlSetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlProfileCfg_t *data)
Sets Chirp profile Configuration.
Definition: rl_sensor.c:435
rlReturnVal_t rlFrameStartStop(rlUInt8_t deviceMap, rlFrameTrigger_t *data)
Triggers/Stops Transmission of Frames.
Definition: rl_sensor.c:1555
Die ID data structure.
Definition: rl_sensor.h:4731
rlReturnVal_t rlRfInterRxGainPhaseConfig(rlUInt8_t deviceMap, rlInterRxGainPhConf_t *data)
Sets different Rx gain/phase offset.
Definition: rl_sensor.c:3382
rlReturnVal_t rlTxGainTempLutSet(rlUInt8_t deviceMap, rlTxGainTempLutData_t *data)
Overwrites TX gain temperature based Lookup table (LUT)
Definition: rl_sensor.c:2714
API radarSS GPADC API MEAS SET SBC M_API_AR_RF_GPADC_API_SET_SB.
Definition: rl_sensor.h:2037
Dynamic chirp enable configuration.
Definition: rl_sensor.h:4047
rlReturnVal_t rlRfGetTemperatureReport(rlUInt8_t deviceMap, rlRfTempData_t *data)
Gets Time and Temperature information report.
Definition: rl_sensor.c:1738
rlReturnVal_t rlGetRfDieId(rlUInt8_t deviceMap, rlRfDieIdCfg_t *data)
Get device die ID status.
Definition: rl_sensor.c:3714
Structure to hold the BSS ESM Fault data strucutre for event RL_RF_AE_ESMFAULT_SB.
Definition: mmwavelink.h:2090
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:4243
Structure to store all Phase shifter calibration data chunks which device provides in response of rlR...
Definition: rl_sensor.h:4723
Radar RF Phase shift loopback configuration.
Definition: rl_sensor.h:2283
rlReturnVal_t rlRfGetCpuFault(rlUInt8_t deviceMap, rlCpuFault_t *data)
Get RadarSS CPU fault status.
Definition: rl_sensor.c:3747
rlReturnVal_t rlRfSetMiscConfig(rlUInt8_t deviceMap, rlRfMiscConf_t *data)
Sets misc feature such as per chirp phase shifter.
Definition: rl_sensor.c:2372
rlReturnVal_t rlTestSourceEnable(rlUInt8_t deviceMap, rlTestSourceEnable_t *data)
Enables the Test Source.
Definition: rl_sensor.c:1698
rlUInt16_t numBytes
Number of valid bytes to write. Valid range: 4 to 212, must be multiple of 4. .
Definition: rl_sensor.h:5178
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:2575
void rlDriverConstructOutMsg(rlUInt16_t numSblk, rlDriverMsg_t *outMsg, rlPayloadSb_t *payloadPtr)
: Construct command packet based on given message-ID and payload
Definition: rl_driver.c:3068
RX gain temperature LUT inject.
Definition: rl_sensor.h:3230
Test source config API parameters E_API_AR_TEST_SOURCE_CONF_SB.
Definition: rl_sensor.h:1673
rlReturnVal_t rlSetLowPowerModeConfig(rlUInt8_t deviceMap, rlLowPowerModeCfg_t *data)
Sets Low Power Mode Configuration.
Definition: rl_sensor.c:1396
Tx freq and power limit configuration.
Definition: rl_sensor.h:3423
rlReturnVal_t rlGetProfileConfig(rlUInt8_t deviceMap, rlUInt16_t profileId, rlProfileCfg_t *data)
Gets Chirp profile Configuration.
Definition: rl_sensor.c:522
rlReturnVal_t rlRfInit(rlUInt8_t deviceMap)
Initializes the RF/Analog Subsystem.
Definition: rl_sensor.c:1611
rlUInt8_t rlDriverGetPlatformId(void)
Returns RL Platform ID (i.e. where mmWaveLink is executing)
Definition: rl_driver.c:2357
Get phase shift calibration data configuration structure.
Definition: rl_sensor.h:4616
Chirp config API parameters. This structure contains fine dithering to coarse profile defined in rlPr...
Definition: rl_sensor.h:865
rlReturnVal_t rlRfGetEsmFault(rlUInt8_t deviceMap, rlBssEsmFault_t *data)
Get RadarSS ESM fault status.
Definition: rl_sensor.c:3786
Frame config API parameters.
Definition: rl_sensor.h:943
rlReturnVal_t rlRfSetCalMonFreqLimitConfig(rlUInt8_t deviceMap, rlRfCalMonFreqLimitConf_t *data)
Set Calibration monitoring Frequency Limit.
Definition: rl_sensor.c:2475
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:3964
rlReturnVal_t rlSetAdcOutConfig(rlUInt8_t deviceMap, rlAdcOutCfg_t *data)
Sets ADC Output Configuration.
Definition: rl_sensor.c:153
Radar RF Init Calibration configuration.
Definition: rl_sensor.h:2793
rlReturnVal_t rlRfDynamicPowerSave(rlUInt8_t deviceMap, rlDynPwrSave_t *data)
: Configure dynamic power saving feature.
Definition: rl_sensor.c:1829
rlReturnVal_t rlRfSetCalMonTimeUnitConfig(rlUInt8_t deviceMap, rlRfCalMonTimeUntConf_t *data)
Set Calibration monitoring time unit.
Definition: rl_sensor.c:2424
Phase shift calibration data which application will receive from radarSS and will feed in to the Devi...
Definition: rl_sensor.h:4651
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:2821
Sub-frame trigger API.
Definition: rl_sensor.h:4599
rlReturnVal_t rlRfPhShiftCalibDataRestore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
Injects phase shifter calibration data to the device.
Definition: rl_sensor.c:3553
Dynamic power saving API parameters.
Definition: rl_sensor.h:1833
rlReturnVal_t rlGetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t *data)
Gets Frame Configuration.
Definition: rl_sensor.c:1078
void rlDriverConstructInMsg(rlUInt16_t msgId, rlDriverMsg_t *inMsg, rlPayloadSb_t *payloadPtr)
: Construct command packet (inMsg) based on given message-ID and payload
Definition: rl_driver.c:3033
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:5184
rlUInt8_t calibApply
Set this to 1 after injecting calibration data for all Txs to enable the firmware calibration....
Definition: rl_sensor.h:4664
API RF device Config SBC M_API_AR_RF_DEV_CONF_SBC.
Definition: rl_sensor.h:1859
rlReturnVal_t rlRfSetPSLoopbackConfig(rlUInt8_t deviceMap, rlRfPSLoopbackCfg_t *data)
Enable/Disable Phase shift loopback for all enabled profiles.
Definition: rl_sensor.c:2195
Radar RF Phase Shift enable/disable configuration.
Definition: rl_sensor.h:2170
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:2021
rlReturnVal_t rlSensorStop(rlUInt8_t deviceMap)
Stops Transmission of Frames.
Definition: rl_sensor.c:1495
rlUInt16_t nsbc
Number of Sub Blocks in Payload.
Definition: rl_driver.h:349
Radar RF Calibration monitoring Frequency Limit configuration.
Definition: rl_sensor.h:2753
RF characterization Time and Temperature data structure.
Definition: rl_sensor.h:1742
Frame config API parameters.
Definition: rl_sensor.h:1255
TX gain temperature LUT read.
Definition: rl_sensor.h:3200
Array of coefficients for the RF programmable filter.
Definition: rl_sensor.h:2446
rlReturnVal_t rlSetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t *data)
Sets Advance Frame Configuration.
Definition: rl_sensor.c:1190
rlReturnVal_t rlDriverExecuteGetApi(rlUInt8_t deviceMap, rlUInt16_t msgId, rlUInt16_t sbcID, rlUInt8_t *msgData, rlUInt16_t inLen)
: Construct get message and invoke command.
Definition: rl_driver.c:3132
Get calibration data configuration structure.
Definition: rl_sensor.h:4136
Advanced Chirp Dynamic LUT Address Offset Configuration Structure Configure LUT address offset dynami...
Definition: rl_sensor.h:5191
Radar RF IF loopback configuration.
Definition: rl_sensor.h:2399
rlReturnVal_t rlRfPhShiftCalibDataStore(rlUInt8_t deviceMap, rlPhShiftCalibrationData_t *data)
Read calibration data from the device.
Definition: rl_sensor.c:3639
rlReturnVal_t rlSetFrameConfig(rlUInt8_t deviceMap, rlFrameCfg_t *data)
Sets Frame Configuration.
Definition: rl_sensor.c:1017
MMWL_EXPORT rlReturnVal_t rlDeviceAdvFrameConfigApply(rlUInt8_t deviceMap, rlAdvFrameDataCfg_t *data)
Sets Advance Frame data path Configuration.
Definition: rl_device.c:2118
Dynamic chirp configuration for 16 chirp configurations.
Definition: rl_sensor.h:3974
rlReturnVal_t rlRfCalibDataStore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
Read calibration data from the device.
Definition: rl_sensor.c:3300
rlReturnVal_t rlEnableContMode(rlUInt8_t deviceMap, rlContModeEn_t *data)
Enable/Disable Continous mode.
Definition: rl_sensor.c:1351
rlReturnVal_t rlRxGainTempLutSet(rlUInt8_t deviceMap, rlRxGainTempLutData_t *data)
Overwrite RX gain temperature Lookup Table(LUT) in Radar SS.
Definition: rl_sensor.c:2616
rlReturnVal_t rlSetContModeConfig(rlUInt8_t deviceMap, rlContModeCfg_t *data)
Sets Continous mode Configuration.
Definition: rl_sensor.c:1311
rlUInt16_t lutAddressOffset
Start address offset at which to populate the bytes of patterns. Address offset has to be multiple ...
Definition: rl_sensor.h:5173
rlReturnVal_t rlRfCalibDataRestore(rlUInt8_t deviceMap, rlCalibrationData_t *data)
Injects calibration data to the device.
Definition: rl_sensor.c:3218
MMWL_EXPORT rlReturnVal_t rlDeviceFrameConfigApply(rlUInt8_t deviceMap, rlFrameApplyCfg_t *data)
Sets Frame data path Configuration.
Definition: rl_device.c:2168
Calibration data which application will receive from radarSS and will feed in to the Device in next p...
Definition: rl_sensor.h:4152
APLL Synthesizer Bandwidth Control.
Definition: rl_sensor.h:5108
RHCP Payload Structure.
Definition: rl_driver.h:161
rlReturnVal_t rlDriverCmdInvoke(rlUInt8_t deviceMap, rlDriverMsg_t inMsg, rlDriverMsg_t *outMsg)
Invokes a command to mmwave radar Device. Implements mmwave radar Host Communication Protocol(RHCP)
Definition: rl_driver.c:2739
rlReturnVal_t rlSetMultiBpmChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlBpmChirpCfg_t **data)
Sets Binary Phase Modulation configuration for multiple Chirp.
Definition: rl_sensor.c:285
rlReturnVal_t rlRfSetDeviceCfg(rlUInt8_t deviceMap, rlRfDevCfg_t *data)
: Set different RadarSS device configurations
Definition: rl_sensor.c:1879
Binary phase modulation common configuration.
Definition: rl_sensor.h:499
The DFE Statistics Report Contents.
Definition: rl_sensor.h:1822
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:4659
Dynamic per chirp phase shifter configuration.
Definition: rl_sensor.h:4092
mmwave radar Driver Payload
Definition: rl_driver.h:355
TX gain temperature LUT inject.
Definition: rl_sensor.h:3335
rlUInt16_t startStop
Start/Stop Frame 0x0000 - Stop the transmission of frames after the current frame 0x0001 - Trigge...
Definition: rl_sensor.h:1575
rlReturnVal_t rlSetChannelConfig(rlUInt8_t deviceMap, rlChanCfg_t *data)
Sets the Rx and Tx Channel Configuration.
Definition: rl_sensor.c:107
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:241
Radar RF PA loopback configuration.
Definition: rl_sensor.h:2244
rlReturnVal_t rlSetSubFrameStart(rlUInt8_t deviceMap, rlSubFrameStartCfg_t *data)
Triggers the next sub-frame in software triggered sub-frame mode.
Definition: rl_sensor.c:3511
rlReturnVal_t rlSetGpAdcConfig(rlUInt8_t deviceMap, rlGpAdcCfg_t *data)
: Configure GP ADC data parameters
Definition: rl_sensor.c:1925
void rlDriverFillPayload(rlUInt16_t msgId, rlUInt16_t sbcID, rlPayloadSb_t *payloadPtr, rlUInt8_t *data, rlUInt16_t inLen)
: Fill payload based on given message-ID, sub-block ID and data.
Definition: rl_driver.c:3099
Binary phase modulation common configuration.
Definition: rl_sensor.h:468
Radar RF Miscconfiguration.
Definition: rl_sensor.h:2569
rlUInt16_t reserved
Reserved for Future use.
Definition: rl_sensor.h:1579
Inter Chirp block control configuration.
Definition: rl_sensor.h:4484
Structure to store all Calibration data chunks which device provides in response of rlRfCalibDataStor...
Definition: rl_sensor.h:4258
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:3090
rlAdvFrameDataCfg_t frameData
Advance Frame data configuration. Applicable with AWR1243/2243 device only.
Definition: rl_sensor.h:1386
rlReturnVal_t rlSetBpmCommonConfig(rlUInt8_t deviceMap, rlBpmCommonCfg_t *data)
Sets Binary Phase Modulation Common Configuration.
Definition: rl_sensor.c:199
rlUInt16_t reserved
Reserved for Future use.
Definition: rl_sensor.h:1272
rlReturnVal_t rlSetDynChirpCfg(rlUInt8_t deviceMap, rlUInt16_t segCnt, rlDynChirpCfg_t **data)
Injects chirp configuration to be programmed dynamically.
Definition: rl_sensor.c:2917
Radar RF Run time calibration configuration.
Definition: rl_sensor.h:2855
Advance Frame Sequence config API parameters rlAdvFrameCfg, 148 bytes.
Definition: rl_sensor.h:1135
Continous Mode Enable API parameters.
Definition: rl_sensor.h:1543
Radar RF programmable filter configuration.
Definition: rl_sensor.h:2497
Advanced Chirp LUT Configuration Structure Load a generic chirp parameter LUT (firmware RAM of size 1...
Definition: rl_sensor.h:5155
Monitor Type Trigger configuration structure.
Definition: rl_sensor.h:5068
rlReturnVal_t rlRfSetPALoopbackConfig(rlUInt8_t deviceMap, rlRfPALoopbackCfg_t *data)
Enable/Disable PA loopback for all enabled profiles.
Definition: rl_sensor.c:2145
Structure to hold the MSS/radarSS CPU Fault data strucutre for event RL_DEV_AE_MSS_CPUFAULT_SB and RL...
Definition: mmwavelink.h:2358
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:934
rlReturnVal_t rlRfSetProgFiltCoeffRam(rlUInt8_t deviceMap, rlRfProgFiltCoeff_t *data)
Set Programmable Filter coefficient RAM.
Definition: rl_sensor.c:2287
rlUInt32_t numChirps
Number of Chirps per Frame.
Definition: rl_sensor.h:1260
rlReturnVal_t rlGetAdvFrameConfig(rlUInt8_t deviceMap, rlAdvFrameCfg_t *data)
Gets Advance Frame Configuration.
Definition: rl_sensor.c:1238
Continous Mode config API parameters.
Definition: rl_sensor.h:1392
Loopback burst set configuration.
Definition: rl_sensor.h:3568
RX gain temperature LUT read.
Definition: rl_sensor.h:3170
rlReturnVal_t rlSetMultiAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *AdvChirpLUTCfgArgs, rlInt8_t *AdvChirpLUTData)
Multi Advanced chirp LUT configuration API.
Definition: rl_sensor.c:4113
BSS Bootup status data structure.
Definition: rl_sensor.h:4431
rlReturnVal_t rlSetAdvChirpLUTConfig(rlUInt8_t deviceMap, rlAdvChirpLUTCfg_t *data)
Set the Advanced chirp LUT configuration to the device.
Definition: rl_sensor.c:4063
rlReturnVal_t rlSensorStart(rlUInt8_t deviceMap)
Triggers Transmission of Frames.
Definition: rl_sensor.c:1441
rlReturnVal_t rlSetDynChirpEn(rlUInt8_t deviceMap, rlDynChirpEnCfg_t *data)
Triggers copy of chirp config from SW to HW RAM.
Definition: rl_sensor.c:3041
rlReturnVal_t rlRfSetProgFiltConfig(rlUInt8_t deviceMap, rlRfProgFiltConf_t *data)
Set Programmable Filter configuration.
Definition: rl_sensor.c:2329
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:2238
rlReturnVal_t rlSetMultiChirpCfg(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t **data)
Injects chirp configuration to be programmed dynamically.
Definition: rl_sensor.c:860
rlReturnVal_t rlSetAdvChirpConfig(rlUInt8_t deviceMap, rlAdvChirpCfg_t *data)
Set the Advanced chirp configuration to the device.
Definition: rl_sensor.c:3893
Frame Trigger API parameters RL_RF_FRAMESTARTSTOP_CONF_SB.
Definition: rl_sensor.h:1560
rlReturnVal_t rlRfInitCalibConfig(rlUInt8_t deviceMap, rlRfInitCalConf_t *data)
Set RF Init Calibration Mask bits and report type.
Definition: rl_sensor.c:2523
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:1268
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:2877
Inter-Rx gain and phase offset configuration.
Definition: rl_sensor.h:4266
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:1780
rlReturnVal_t rlRfApllSynthBwCtlConfig(rlUInt8_t deviceMap, rlRfApllSynthBwControl_t *data)
Control bandwidth of the APLL and Synthesizer.
Definition: rl_sensor.c:4009
rlReturnVal_t rlGetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t chirpStartIdx, rlUInt16_t chirpEndIdx, rlChirpCfg_t *data)
Gets Chirp Configuration.
Definition: rl_sensor.c:722
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:4624
rlReturnVal_t rlDriverExecuteSetApi(rlUInt8_t deviceMap, rlUInt16_t msgId, rlUInt16_t sbcID, rlUInt8_t *msgData, rlUInt16_t inLen)
: Construct set message and invoke command.
Definition: rl_driver.c:3188
rlReturnVal_t rlSetChirpConfig(rlUInt8_t deviceMap, rlUInt16_t cnt, rlChirpCfg_t *data)
Sets Chirp Configuration.
Definition: rl_sensor.c:597
rlReturnVal_t rlDriverIsDeviceMapValid(rlUInt8_t deviceMap)
Checks if given deviecMap is valid wrt to global DeviceMap set to mmWaveLink.
Definition: rl_driver.c:2394
rlAdvFrameSeqCfg_t frameSeq
Advance Frame sequence and Subframe configuration.
Definition: rl_sensor.h:1382

Copyright 2020, Texas Instruments Incorporated