xWRL1432 MMWAVE-L-SDK  05.03.00
rangeprochwa.h
Go to the documentation of this file.
1 /*
2  *
3  * NOTE:
4  * (C) Copyright 2018 - 2022 Texas Instruments, Inc.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the
16  * distribution.
17  *
18  * Neither the name of Texas Instruments Incorporated nor the names of
19  * its contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
50 /**************************************************************************
51  *************************** Include Files ********************************
52  **************************************************************************/
53 #ifndef RANGEPROCHWA_H
54 #define RANGEPROCHWA_H
55 
56 /* Standard Include Files. */
57 #include <stdint.h>
58 #include <stdlib.h>
59 #include <stddef.h>
60 #include <string.h>
61 #include <stdio.h>
62 
63 /* MCU Plus SDK Drivers include files */
64 #include <drivers/hwa.h>
65 
66 /* mmWave SDK Data Path Include Files */
69 #include <datapath/dpif/dp_error.h>
72 #include <datapath/dpu/rangeproc/v0/rangeproc_common.h>
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
79 #define DPU_RANGEPROCHWA_NUM_HWA_PARAM_SETS 4U
80 
82 #define DPU_RANGEPROCHWA_DCRANGESIGMEAN_BYTE_ALIGNMENT_DSP 8U
83 
85 #define DPU_RANGEPROCHWA_DCRANGESIGMEAN_BYTE_ALIGNMENT_R5F 4U
86 
88 #define DPU_RANGEPROCHWA_RADARCUBE_BYTE_ALIGNMENT_R5F CSL_CACHE_L1D_LINESIZE
89 
91 #define DPU_RANGEPROCHWA_RADARCUBE_BYTE_ALIGNMENT_DSP (sizeof(int16_t))
92 
100 #define DPU_RANGEPROCHWA_EINVAL (DP_ERRNO_RANGE_PROC_BASE-1)
101 
105 #define DPU_RANGEPROCHWA_ENOMEM (DP_ERRNO_RANGE_PROC_BASE-2)
106 
110 #define DPU_RANGEPROCHWA_EINTERNAL (DP_ERRNO_RANGE_PROC_BASE-3)
111 
115 #define DPU_RANGEPROCHWA_ENOTIMPL (DP_ERRNO_RANGE_PROC_BASE-4)
116 
120 #define DPU_RANGEPROCHWA_EINPROGRESS (DP_ERRNO_RANGE_PROC_BASE-5)
121 
125 #define DPU_RANGEPROCHWA_ECMD (DP_ERRNO_RANGE_PROC_BASE-6)
126 
130 #define DPU_RANGEPROCHWA_ESEMA (DP_ERRNO_RANGE_PROC_BASE-7)
131 
135 #define DPU_RANGEPROCHWA_EDCREMOVAL (DP_ERRNO_RANGE_PROC_BASE-8)
136 
140 #define DPU_RANGEPROCHWA_EADCBUF_INTF (DP_ERRNO_RANGE_PROC_BASE-9)
141 
145 #define DPU_RANGEPROCHWA_ERADARCUBE_INTF (DP_ERRNO_RANGE_PROC_BASE-10)
146 
150 #define DPU_RANGEPROCHWA_EWINDOW (DP_ERRNO_RANGE_PROC_BASE-11)
151 
155 #define DPU_RANGEPROCHWA_EBUTTERFLYSCALE (DP_ERRNO_RANGE_PROC_BASE-12)
156 
160  #define DPU_RANGEPROCHWA_EEDMA_ERROR (DP_ERRNO_RANGE_PROC_BASE-13)
161 
176 typedef uint32_t DPU_RangeProcHWA_InputMode;
177 #define DPU_RangeProcHWA_InputMode_MAPPED (uint32_t) 0U
178 #define DPU_RangeProcHWA_InputMode_ISOLATED (uint32_t) 1U
179 #define DPU_RangeProcHWA_InputMode_HWA_INTERNAL_MEM (uint32_t) 2U
180 
190 typedef uint32_t DPU_RangeProcHWA_Cmd;
191 #define DPU_RangeProcHWA_Cmd_dcRangeCfg (uint32_t) 0
192 #define DPU_RangeProcHWA_Cmd_triggerProc (uint32_t) 1
193 
203 typedef struct DPU_RangeProcHWA_FFTtuning_t{
209 
216 
218 
219 
229 typedef struct DPU_RangeProcHWA_HwaConfig_t
230 {
233 
235  uint8_t numParamSet;
236 
240  uint8_t hwaWinSym;
241 
243  uint16_t hwaWinRamOffset;
244 
247 
249  uint8_t dmaTrigSrcChan[2];
250 
253 
255 
265 typedef struct DPU_RangeProcHWA_EDMAInputConfig_t
266 {
271 
275 
285 typedef struct DPU_RangeProcHWA_EDMAOutputConfigPath_t
286 {
291 
295 
298 
300 
301 
302 
303 
324 typedef struct DPU_RangeProcHWA_EDMAOutputConfig_t
325 {
326 
329  uint32_t dummySrc;
331  uint32_t dummyDst;
332 
334 
335 
345 typedef struct DPU_RangeProcHWA_HW_Resources_t
346 {
349 
352 
355 
358 
360  /* NOTE: Application needs to provide address of the EDMA interrupt object.
361  * This needs to be done as there might be multiple subframes configured
362  * and each subframe needs EDMA interrupt to be registered.
363  */
365 
374  cmplx32ImRe_t *dcRangeSigMean;
375 
378 
386 
390 
400 typedef struct DPU_RangeProcHWA_StaticConfig_t
401 {
403  uint8_t numTxAntennas;
404 
407 
409  uint16_t numRangeBins;
410 
412 // uint16_t numFFTBins;
414  uint16_t rangeFftSize;
415 
417  uint16_t isChirpDataReal;
418 
421 
424 
427 
430 
433 
438  int32_t *window;
439 
444  uint32_t windowSize;
445 
448 
454 
457 
461 
464 
467 
470 
472  uint8_t lowPowerMode;
474 
484 typedef struct DPU_RangeProcHWA_DynamicConfig_t
485 {
487  DPU_RangeProc_CalibDcRangeSigCfg *calibDcRangeSigCfg;
489 
499 typedef struct DPU_RangeProcHWA_Config_t
500 {
503 
506 
510 
520 typedef struct DPU_RangeProcHWA_InitParams_t
521 {
525 
535 typedef struct DPU_RangeProcHWA_OutParams_t
536 {
539 
541  DPU_RangeProc_stats stats;
543 
550 typedef void* DPU_RangeProcHWA_Handle ;
551 
552 /*================================================================
553  rangeProcHWA DPU exposed APIs
554  ================================================================*/
556 (
557  DPU_RangeProcHWA_InitParams *initParams,
558  int32_t* errCode
559 );
560 
562 (
564  DPU_RangeProcHWA_Config* rangeHwaCfg
565 );
566 
568 (
570  DPU_RangeProcHWA_OutParams* outParams
571 );
572 
574 (
577  void* arg,
578  uint32_t argSize
579 );
580 
582 (
584 );
585 
587 (
589  uint8_t *numUsedHwaParamSets
590 );
591 
592 #ifdef __cplusplus
593 }
594 #endif
595 
596 #endif
DPU_RangeProcHWA_InitParams::hwaHandle
HWA_Handle hwaHandle
HWA Handle.
Definition: rangeprochwa.h:523
DPU_RangeProcHWA_HwaConfig::numParamSet
uint8_t numParamSet
Number of HWA param sets must be DPU_RANGEPROCHWA_NUM_HWA_PARAM_SETS.
Definition: rangeprochwa.h:235
DPU_RangeProcHWA_HW_Resources::radarCube
DPIF_RadarCube radarCube
Radar cube data interface. Radar cube buffer (radarCube.data) For R5F: Byte alignment Requirement = D...
Definition: rangeprochwa.h:385
DPU_RangeProcHWA_Cmd
uint32_t DPU_RangeProcHWA_Cmd
rangeProc control command
Definition: rangeprochwa.h:190
DPU_RangeProcHWA_HW_Resources::edmaHandle
EDMA_Handle edmaHandle
EDMA Handle.
Definition: rangeprochwa.h:348
DPU_RangeProcHWA_HwaConfig::hwaWinRamOffset
uint16_t hwaWinRamOffset
HWA windowing RAM offset in number of samples.
Definition: rangeprochwa.h:243
DPU_RangeProcHWA_StaticConfig::numVirtualAntennas
uint8_t numVirtualAntennas
Number of virtual antennas.
Definition: rangeprochwa.h:406
DPU_RangeProcHWA_OutParams::endOfChirp
bool endOfChirp
End of Chirp indication for rangeProcHWA.
Definition: rangeprochwa.h:538
DPU_RangeProcHWA_HwaConfig::dataInputMode
DPU_RangeProcHWA_InputMode dataInputMode
Data Input Mode,.
Definition: rangeprochwa.h:246
DPU_RangeProcHWA_EDMAInputConfig::dataInSignature
DPEDMA_ChanCfg dataInSignature
EDMA configuration for rangeProc data Input Signature.
Definition: rangeprochwa.h:273
DPU_RangeProcHWA_EDMAOutputConfigPath
RangeProc EDMA configuration.
Definition: rangeprochwa.h:286
DPU_RangeProcHWA_FFTtuning::fftOutputDivShift
uint16_t fftOutputDivShift
Specify amount of right (divide) shift to apply to convert HWA internal 24-bit Range FFT output to 16...
Definition: rangeprochwa.h:208
DPU_RangeProcHWA_StaticConfig::isBpmEnabled
bool isBpmEnabled
Flag that indicates if BPM is enabled. BPM can only be enabled/disabled during configuration time.
Definition: rangeprochwa.h:460
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:449
DPU_RangeProcHWA_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: rangeprochwa.h:364
DPU_RangeProcHWA_StaticConfig
RangeProcHWA static configuration.
Definition: rangeprochwa.h:401
DPIF_ADCBufData
ADC Data buffer definition.
Definition: dpif_adcdata.h:111
DPU_RangeProcHWA_StaticConfig::numChirpsPerFrame
uint16_t numChirpsPerFrame
Number of chirps per frame.
Definition: rangeprochwa.h:420
DPU_RangeProcHWA_HwaConfig::paramSetStartIdx
uint8_t paramSetStartIdx
HWA paramset Start index.
Definition: rangeprochwa.h:232
DPU_RangeProcHWA_StaticConfig::rangeFFTtuning
DPU_RangeProcHWA_FFTtuning rangeFFTtuning
Range FFT Tuning Params.
Definition: rangeprochwa.h:456
DPU_RangeProcHWA_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: rangeprochwa.h:409
DPU_RangeProcHWA_StaticConfig::enableMinorMotion
bool enableMinorMotion
Minor motion detection enable flag.
Definition: rangeprochwa.h:466
DPU_RangeProcHWA_StaticConfig::enableMajorMotion
bool enableMajorMotion
Major motion detection enable flag.
Definition: rangeprochwa.h:463
DPU_RangeProcHWA_StaticConfig::windowSize
uint32_t windowSize
Range FFT window coefficients size in bytes non-symmetric window, size = sizeof(uint32_t) * numADCSam...
Definition: rangeprochwa.h:444
DPU_RangeProcHWA_StaticConfig::window
int32_t * window
Range FFT window coefficients, Appliation provided windows coefficients After DPU_RangeProcHWA_config...
Definition: rangeprochwa.h:438
dp_error.h
Base error codes for the data path Modules.
DPU_RangeProcHWA_HwaConfig::hardwareTrigSrc
uint8_t hardwareTrigSrc
HWA hardware trigger source. This is used only in DPU_RangeProcHWA_InputMode_HWA_INTERNAL_MEM mode.
Definition: rangeprochwa.h:252
DPU_RangeProcHWA_StaticConfig::numDopplerChirpsPerFrame
uint16_t numDopplerChirpsPerFrame
Number of Doppler chirps per frame.
Definition: rangeprochwa.h:423
DPEDMA_2LinkChanCfg
EDMA channel configuration with 2 shadow channels.
Definition: dpedma.h:190
DPU_RangeProcHWA_StaticConfig::numMinorMotionChirpsPerFrame
uint16_t numMinorMotionChirpsPerFrame
Number of chirps per frame for Minor Motion Detection.
Definition: rangeprochwa.h:429
DPU_RangeProcHWA_EDMAOutputConfigPath::dataOutMinor
DPEDMA_ChanCfg dataOutMinor
EDMA configuration for rangeProc data Out for Minor Motion Radar cube.
Definition: rangeprochwa.h:294
DPU_RangeProcHWA_HW_Resources
RangeProcHWA hardware resources.
Definition: rangeprochwa.h:346
DPU_RangeProcHWA_process
int32_t DPU_RangeProcHWA_process(DPU_RangeProcHWA_Handle handle, DPU_RangeProcHWA_OutParams *outParams)
DPU_RangeProcHWA_HwaConfig
RangeProc HWA configuration.
Definition: rangeprochwa.h:230
dpedmahwa.h
EDMA Configuration Utility API definitions for HWA.
DPU_RangeProcHWA_init
DPU_RangeProcHWA_Handle DPU_RangeProcHWA_init(DPU_RangeProcHWA_InitParams *initParams, int32_t *errCode)
DPU_RangeProcHWA_Config::hwRes
DPU_RangeProcHWA_HW_Resources hwRes
rangeProc hardware resources
Definition: rangeprochwa.h:502
DPU_RangeProcHWA_StaticConfig::ADCBufData
DPIF_ADCBufData ADCBufData
ADCBuf buffer interface.
Definition: rangeprochwa.h:447
DPU_RangeProcHWA_HW_Resources::hwaCfg
DPU_RangeProcHWA_HwaConfig hwaCfg
HWA configuration.
Definition: rangeprochwa.h:351
dpif_adcdata.h
Defines RF ADCBuf interface.
DPU_RangeProcHWA_HW_Resources::dcRangeSigMean
cmplx32ImRe_t * dcRangeSigMean
Pointer to Calibrate DC Range signature buffer The size of the buffer = DPU_RANGEPROC_SIGNATURE_COMP_...
Definition: rangeprochwa.h:374
DPU_RangeProcHWA_InputMode
uint32_t DPU_RangeProcHWA_InputMode
RangeProc data input mode.
Definition: rangeprochwa.h:176
DPU_RangeProcHWA_StaticConfig::frmCntrModNumFramesPerMinorMot
uint32_t frmCntrModNumFramesPerMinorMot
Frame counter to support power saving mode.
Definition: rangeprochwa.h:469
DPU_RangeProcHWA_StaticConfig::rangeFftSize
uint16_t rangeFftSize
Number of bins used in Range FFT Calculation.
Definition: rangeprochwa.h:414
DPU_RangeProcHWA_OutParams
rangeProcHWA output parameters populated during rangeProc Processing time
Definition: rangeprochwa.h:536
DPU_RangeProcHWA_EDMAInputConfig
RangeProc EDMA configuration.
Definition: rangeprochwa.h:266
DPU_RangeProcHWA_Config::staticCfg
DPU_RangeProcHWA_StaticConfig staticCfg
rangeProc static configuration
Definition: rangeprochwa.h:505
DPU_RangeProcHWA_GetNumUsedHwaParamSets
int32_t DPU_RangeProcHWA_GetNumUsedHwaParamSets(DPU_RangeProcHWA_Handle handle, uint8_t *numUsedHwaParamSets)
DPU_RangeProcHWA_InitParams
rangeProcHWA output parameters populated during rangeProc Processing time
Definition: rangeprochwa.h:521
DPU_RangeProcHWA_EDMAInputConfig::dataIn
DPEDMA_2LinkChanCfg dataIn
EDMA configuration for rangeProc data Input This is needed only in DPU_RangeProcHWA_InputMode_ISOLATE...
Definition: rangeprochwa.h:270
DPU_RangeProcHWA_HW_Resources::dcRangeSigMeanSize
uint32_t dcRangeSigMeanSize
DC range calibration scratch buffer size.
Definition: rangeprochwa.h:377
DPU_RangeProcHWA_Config
Range FFT configuration.
Definition: rangeprochwa.h:500
DPIF_RadarCube
Radar Cube Buffer Interface.
Definition: dpif_radarcube.h:104
DPU_RangeProcHWA_StaticConfig::lowPowerMode
uint8_t lowPowerMode
Low power mode 0-disabled, 1-enabled, 2-test mode (power stays on, system coftware components reset)
Definition: rangeprochwa.h:472
DPU_RangeProcHWA_EDMAOutputConfigPath::dataOutMajor
DPEDMA_ChanCfg dataOutMajor
EDMA configuration for rangeProc data Out for Major Motion Radar cube It must be a HWACC triggered ED...
Definition: rangeprochwa.h:290
hwa.h
DPU_RangeProcHWA_DynamicConfig
RangeProcHWA dynamic configuration.
Definition: rangeprochwa.h:485
DPU_RangeProcHWA_EDMAOutputConfig::dummyDst
uint32_t dummyDst
Dummy location
Definition: rangeprochwa.h:331
dpif_radarcube.h
Defines the data path radar cube data interface.
DPU_RangeProcHWA_HW_Resources::edmaOutCfg
DPU_RangeProcHWA_EDMAOutputConfig edmaOutCfg
EDMA configuration for rangeProc data Output.
Definition: rangeprochwa.h:357
DPU_RangeProcHWA_StaticConfig::numFramesPerMinorMotProc
uint16_t numFramesPerMinorMotProc
Number of frames per Minor Motion Processing.
Definition: rangeprochwa.h:432
DPU_RangeProcHWA_StaticConfig::resetDcRangeSigMeanBuffer
uint8_t resetDcRangeSigMeanBuffer
Flag to reset dcRangeSigMean buffer 1 - to reset the dcRangeSigMean buffer and counter 0 - do not res...
Definition: rangeprochwa.h:453
DPU_RangeProcHWA_control
int32_t DPU_RangeProcHWA_control(DPU_RangeProcHWA_Handle handle, DPU_RangeProcHWA_Cmd cmd, void *arg, uint32_t argSize)
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:469
DPU_RangeProcHWA_StaticConfig::isChirpDataReal
uint16_t isChirpDataReal
1 if ADC Samples are real
Definition: rangeprochwa.h:417
DPU_RangeProcHWA_config
int32_t DPU_RangeProcHWA_config(DPU_RangeProcHWA_Handle handle, DPU_RangeProcHWA_Config *rangeHwaCfg)
DPU_RangeProcHWA_Handle
void * DPU_RangeProcHWA_Handle
rangeProc DPU Handle
Definition: rangeprochwa.h:550
DPU_RangeProcHWA_OutParams::stats
DPU_RangeProc_stats stats
rangeProcHWA stats
Definition: rangeprochwa.h:541
DPU_RangeProcHWA_HwaConfig::hwaWinSym
uint8_t hwaWinSym
Flag to indicate if HWA windowing is symmetric see HWA_WINDOW_SYMM definitions in HWA driver's doxyge...
Definition: rangeprochwa.h:240
DPU_RangeProcHWA_EDMAOutputConfig::dummySrc
uint32_t dummySrc
Dummy location.
Definition: rangeprochwa.h:329
DPU_RangeProcHWA_deinit
int32_t DPU_RangeProcHWA_deinit(DPU_RangeProcHWA_Handle handle)
DPU_RangeProcHWA_HW_Resources::radarCubeMinMot
DPIF_RadarCube radarCubeMinMot
Radar cube data interface for Minor Motion Detection.
Definition: rangeprochwa.h:388
DPU_RangeProcHWA_HW_Resources::edmaInCfg
DPU_RangeProcHWA_EDMAInputConfig edmaInCfg
EDMA configuration for rangeProc data Input.
Definition: rangeprochwa.h:354
DPU_RangeProcHWA_EDMAOutputConfigPath::evtDecim
DPEDMA_2LinkChanCfg evtDecim
EDMA for chirp event decimation for minor motion detection
Definition: rangeprochwa.h:297
DPU_RangeProcHWA_StaticConfig::numDopplerChirpsPerProc
uint16_t numDopplerChirpsPerProc
Number of Doppler chirps per processing, determines the radar cube size.
Definition: rangeprochwa.h:426
dpedma.h
EDMA Configuration Utility API definitions.
HWA_Handle
void * HWA_Handle
A handle that is returned from a HWA_open() call.
Definition: hwa/v0/hwa.h:564
DPU_RangeProcHWA_Config::dynCfg
DPU_RangeProcHWA_DynamicConfig dynCfg
rangeProc dynamic configuration
Definition: rangeprochwa.h:508
DPU_RangeProcHWA_StaticConfig::numTxAntennas
uint8_t numTxAntennas
Number of transmit antennas.
Definition: rangeprochwa.h:403
DPU_RangeProcHWA_FFTtuning
rangeProc FFT tuning parameters for HWA based Range FFT
Definition: rangeprochwa.h:203
DPU_RangeProcHWA_EDMAOutputConfig
RangeProc output EDMA configuration.
Definition: rangeprochwa.h:325
DPU_RangeProcHWA_DynamicConfig::calibDcRangeSigCfg
DPU_RangeProc_CalibDcRangeSigCfg * calibDcRangeSigCfg
Pointer to Calibrate DC Range signature configuration.
Definition: rangeprochwa.h:487
DPU_RangeProcHWA_FFTtuning::numLastButterflyStagesToScale
uint16_t numLastButterflyStagesToScale
Specify number of Last butterfly stages to scale to avoid clipping within HWA FFT stages....
Definition: rangeprochwa.h:215
DPEDMA_ChanCfg
EDMA channel configuration.
Definition: dpedma.h:132