xWRL6432 MMWAVE-L-SDK  05.04.00.01
dopplerprochwa.h
Go to the documentation of this file.
1 /*
2  *
3  * NOTE:
4  * (C) Copyright 2023 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 
54 /**************************************************************************
55  *************************** Include Files ********************************
56  **************************************************************************/
57 #ifndef DOPPLERPROCHWA_H_
58 #define DOPPLERPROCHWA_H_
59 
60 /* Standard Include Files. */
61 #include <stdint.h>
62 #include <stdlib.h>
63 #include <stddef.h>
64 #include <string.h>
65 #include <stdio.h>
66 #include <math.h>
67 
68 /* mmWave SDK Driver/Common Include Files */
69 #include <drivers/hwa.h>
70 
71 /* DPIF Components Include Files */
76 
77 /* mmWave SDK Data Path Include Files */
78 #include <datapath/dpif/dp_error.h>
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84 
93 #define DPU_DOPPLERPROCHWA_EINVAL (DP_ERRNO_DOPPLER_PROC_BASE-1)
94 
98 #define DPU_DOPPLERPROCHWA_ENOMEM (DP_ERRNO_DOPPLER_PROC_BASE-2)
99 
103 #define DPU_DOPPLERPROCHWA_EINPROGRESS (DP_ERRNO_DOPPLER_PROC_BASE-3)
104 
108 #define DPU_DOPPLERPROCHWA_EHWARES (DP_ERRNO_DOPPLER_PROC_BASE-4)
109 
113 #define DPU_DOPPLERPROCHWA_ESEMA (DP_ERRNO_DOPPLER_PROC_BASE-5)
114 
118 #define DPU_DOPPLERPROCHWA_ESEMASTATUS (DP_ERRNO_DOPPLER_PROC_BASE-6)
119 
123 #define DPU_DOPPLERPROCHWA_EEXCEEDHWAMEM (DP_ERRNO_DOPPLER_PROC_BASE-7)
124 
128 #define DPU_DOPPLERPROCHWA_ECUBEFORMAT (DP_ERRNO_DOPPLER_PROC_BASE-8)
129 
133 #define DPU_DOPPLERPROCHWA_EDETMFORMAT (DP_ERRNO_DOPPLER_PROC_BASE-9)
134 
138 #define DPU_DOPPLERPROCHWA_EDETMSIZE (DP_ERRNO_DOPPLER_PROC_BASE-10)
139 
143 #define DPU_DOPPLERPROCHWA_EWINDSIZE (DP_ERRNO_DOPPLER_PROC_BASE-11)
144 
154 #define DPU_DOPPLERPROCHWA_MAX_NUM_HWA_PARAMSET 12
155 
161 #define DPU_DOPPLERPROCHWA_NUM_HWA_PARAMSET_PER_RANGE_BIN 2
162 
166 #define DPU_DOPPLERPROCHWA_NUM_HWA_MEMBANKS 4
167 
171 #define DPU_DOPPLERPROCHWA_FIRST_SCALING_DISABLED ((uint8_t)0U)
172 
176 #define DPU_DOPPLERPROCHWA_FIRST_SCALING_ENABLED ((uint8_t)1U)
177 
178 
183 
193 typedef struct DPU_DopplerProcHWA_InitCfg_t
194 {
197 
199 
206 typedef volatile struct DPU_DopplerProcHWA_HwaSumOutput_t
207 {
208  int32_t sumIm;
209  int32_t sumRe;
211 
222 typedef struct DPU_DopplerProcHWA_HwaCfg_t
223 {
227  uint8_t winSym;
228 
238  uint32_t windowSize;
239 
241  int32_t *window;
242 
244  uint32_t winRamOffset;
245 
252 
255 
259 
270 typedef struct DPU_DopplerProcHWA_EdmaCfg_t
271 {
274 
277 
280 
284 
295 typedef struct DPU_DopplerProcHWA_HW_Resources_t
296 {
299 
302 
305 
308 
310  /* NOTE: Application needs to provide address of the EDMA interrupt object.
311  * This needs to be done as there might be multiple subframes configured
312  * and each subframe needs EDMA interrupt to be registered.
313  */
316 
327 typedef struct DPU_DopplerProcHWA_compressCfg_t
328 {
329 
331 
332  /* number of complex samples to compress */
334 
336 
352 typedef struct DPU_DopplerProcHWA_StaticConfig_t
353 {
355  uint8_t numTxAntennas;
356 
358  uint8_t numRxAntennas;
359 
362 
364  uint16_t numRangeBins;
365 
368 
370  uint16_t numDopplerBins;
371 
374 
376  uint8_t doppFFT_is16b;
377 
380 
383 
386 
388 
399 typedef struct DPU_DopplerProcHWA_Config_t
400 {
403 
406 
408 
409 
419 typedef struct DPU_DopplerProcHWA_OutParams_t
420 {
424 
425 
430 int32_t DPU_DopplerProcHWA_GetNumUsedHwaParamSets(DPU_DopplerProcHWA_Handle handle, uint8_t *numUsedHwaParamSets);
431 
432 #ifdef __cplusplus
433 }
434 #endif
435 
436 #endif
DPU_DopplerProcHWA_HwaCfg::dmaTrigSrcPingChan
uint8_t dmaTrigSrcPingChan
HWA param set dma trigger source ping channel.
Definition: dopplerprochwa.h:254
DPU_DopplerProcHWA_HwaCfg::winSym
uint8_t winSym
Indicates if HWA window is symmetric or non-symmetric. Use HWA macro definitions for symmetric/non-sy...
Definition: dopplerprochwa.h:227
DPU_DopplerProcHWA_HwaCfg::paramSetStartIdx
uint32_t paramSetStartIdx
HWA paramset Start index. Application has to ensure that paramSetStartIdx is such that [paramSetSt...
Definition: dopplerprochwa.h:251
DPU_DopplerProcHWA_Config
dopplerProc DPU configuration parameters
Definition: dopplerprochwa.h:400
DPU_DopplerProcHWA_StaticConfig::isCompressionEnabled
bool isCompressionEnabled
compression enable/disable flag for radar cube data
Definition: dopplerprochwa.h:382
DPU_DopplerProcHWA_init
DPU_DopplerProcHWA_Handle DPU_DopplerProcHWA_init(DPU_DopplerProcHWA_InitParams *initCfg, int32_t *errCode)
DPU_DopplerProcHWA_StaticConfig
Doppler DPU static configuration parameters.
Definition: dopplerprochwa.h:353
DPU_DopplerProcHWA_HwaSumOutput::sumRe
int32_t sumRe
Sum real.
Definition: dopplerprochwa.h:209
DPIF_DetMatrix
Detection matrix buffer interface.
Definition: dpif_detmatrix.h:81
dopplerproc_common.h
Implements Common definition across dopplerProc DPU.
DPU_DopplerProcHWA_InitParams
dopplerProc DPU initial configuration parameters
Definition: dopplerprochwa.h:194
DPU_DopplerProcHWA_StaticConfig::isDetMatrixLogScale
bool isDetMatrixLogScale
Detection matrix format 0 - Linear 32-bit integer, 1 - 16-bit log2 magnitude in Q11 format.
Definition: dopplerprochwa.h:379
DPU_DopplerProcHWA_StaticConfig::numVirtualAntennas
uint8_t numVirtualAntennas
Number of virtual antennas.
Definition: dopplerprochwa.h:361
DPU_DopplerProcHWA_EdmaCfg::edmaHotSig
DPU_DopplerProc_Edma edmaHotSig
EDMA configuration for hot signature.
Definition: dopplerprochwa.h:282
DPU_DopplerProcHWA_OutParams
DPU processing output parameters.
Definition: dopplerprochwa.h:420
DPU_DopplerProcHWA_compressCfg::numComplexElements
uint32_t numComplexElements
Definition: dopplerprochwa.h:333
DPU_DopplerProcHWA_EdmaCfg::edmaHandle
EDMA_Handle edmaHandle
EDMA driver handle.
Definition: dopplerprochwa.h:273
dpif_detmatrix.h
Defines the detection matrix buffer interface.
DPU_DopplerProcHWA_compressCfg::compressionFactor
uint8_t compressionFactor
Definition: dopplerprochwa.h:330
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:451
DPU_DopplerProcHWA_HwaCfg
dopplerProc DPU HWA configuration parameters
Definition: dopplerprochwa.h:223
DPU_DopplerProcHWA_Config::staticCfg
DPU_DopplerProcHWA_StaticConfig staticCfg
Static configuration.
Definition: dopplerprochwa.h:405
DPU_DopplerProcHWA_OutParams::stats
DPU_DopplerProc_stats stats
DPU statistics.
Definition: dopplerprochwa.h:422
dp_error.h
Base error codes for the data path Modules.
DPU_DopplerProcHWA_compressCfg
Compression parameters.
Definition: dopplerprochwa.h:328
DPU_DopplerProcHWA_GetNumUsedHwaParamSets
int32_t DPU_DopplerProcHWA_GetNumUsedHwaParamSets(DPU_DopplerProcHWA_Handle handle, uint8_t *numUsedHwaParamSets)
DPU_DopplerProc_Edma
dopplerProc DPU EDMA configuration parameters
Definition: dopplerproc_common.h:70
DPU_DopplerProcHWA_StaticConfig::numRxAntennas
uint8_t numRxAntennas
Number of receive antennas.
Definition: dopplerprochwa.h:358
dpedmahwa.h
EDMA Configuration Utility API definitions for HWA.
DPU_DopplerProcHWA_StaticConfig::numDopplerChirps
uint16_t numDopplerChirps
Number of Doppler chirps.
Definition: dopplerprochwa.h:367
DPU_DopplerProcHWA_HwaCfg::dmaTrigSrcPongChan
uint8_t dmaTrigSrcPongChan
HWA param set dma trigger source pong channel.
Definition: dopplerprochwa.h:257
DPU_DopplerProcHWA_StaticConfig::compressCfg
DPU_DopplerProcHWA_compressCfg compressCfg
compression parameters for radar cube data
Definition: dopplerprochwa.h:385
DPU_DopplerProcHWA_config
int32_t DPU_DopplerProcHWA_config(DPU_DopplerProcHWA_Handle handle, DPU_DopplerProcHWA_Config *cfg)
DPU_DopplerProcHWA_deinit
int32_t DPU_DopplerProcHWA_deinit(DPU_DopplerProcHWA_Handle handle)
DPU_DopplerProcHWA_EdmaCfg::edmaIn
DPU_DopplerProc_Edma edmaIn
EDMA configuration for Input data (Radar cube -> HWA memory).
Definition: dopplerprochwa.h:276
DPU_DopplerProcHWA_HwaSumOutput
Sum filled by HWA statistics block.
Definition: dopplerprochwa.h:207
DPU_DopplerProcHWA_Config::hwRes
DPU_DopplerProcHWA_HW_Resources hwRes
HW resources.
Definition: dopplerprochwa.h:402
DPU_DopplerProcHWA_StaticConfig::numTxAntennas
uint8_t numTxAntennas
Number of transmit antennas.
Definition: dopplerprochwa.h:355
DPU_DopplerProcHWA_HW_Resources::detMatrix
DPIF_DetMatrix detMatrix
Detection matrix (range-doppler heatmap)
Definition: dopplerprochwa.h:307
DPU_DopplerProcHWA_StaticConfig::doppFFT_is16b
uint8_t doppFFT_is16b
Flag to set Doppler FFT to 16-bit(1-True)/32-bit(0-False)
Definition: dopplerprochwa.h:376
DPIF_RadarCube
Radar Cube Buffer Interface.
Definition: dpif_radarcube.h:105
DPU_DopplerProcHWA_InitParams::hwaHandle
HWA_Handle hwaHandle
HWA Handle.
Definition: dopplerprochwa.h:196
DPU_DopplerProcHWA_process
int32_t DPU_DopplerProcHWA_process(DPU_DopplerProcHWA_Handle handle, DPU_DopplerProcHWA_OutParams *outParams)
hwa.h
DPU_DopplerProcHWA_EdmaCfg::edmaOutDetectionMatrix
DPU_DopplerProc_Edma edmaOutDetectionMatrix
EDMA configuration for Output data (HWA memory -> detection matrix).
Definition: dopplerprochwa.h:279
DPU_DopplerProcHWA_HW_Resources
Doppler DPU HW configuration parameters.
Definition: dopplerprochwa.h:296
dpif_radarcube.h
Defines the data path radar cube data interface.
DPU_DopplerProcHWA_HW_Resources::edmaCfg
DPU_DopplerProcHWA_EdmaCfg edmaCfg
EDMA configuration.
Definition: dopplerprochwa.h:298
DPU_DopplerProcHWA_HwaCfg::windowSize
uint32_t windowSize
Doppler FFT window size in bytes. This is the number of coefficients to be programmed in the HWA for ...
Definition: dopplerprochwa.h:238
DPU_DopplerProcHWA_HwaSumOutput::sumIm
int32_t sumIm
Sum imaginary.
Definition: dopplerprochwa.h:208
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:471
DPU_DopplerProcHWA_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: dopplerprochwa.h:314
DPU_DopplerProcHWA_HW_Resources::radar_1D_FFT_Cube
DPIF_RadarCube radar_1D_FFT_Cube
Radar Cube of range FFT.
Definition: dopplerprochwa.h:304
DPU_DopplerProcHWA_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: dopplerprochwa.h:364
DPU_DopplerProcHWA_EdmaCfg
dopplerProc DPU EDMA configuration parameters
Definition: dopplerprochwa.h:271
DPU_DopplerProcHWA_HwaCfg::window
int32_t * window
Pointer to Doppler FFT window coefficients.
Definition: dopplerprochwa.h:241
DPU_DopplerProcHWA_HwaCfg::winRamOffset
uint32_t winRamOffset
HWA window RAM offset in number of samples.
Definition: dopplerprochwa.h:244
DPU_DopplerProcHWA_Handle
void * DPU_DopplerProcHWA_Handle
Handle for Doppler Processing DPU.
Definition: dopplerprochwa.h:182
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:620
DPU_DopplerProcHWA_StaticConfig::numDopplerBins
uint16_t numDopplerBins
Number of Doppler bins.
Definition: dopplerprochwa.h:370
DPU_DopplerProcHWA_StaticConfig::log2NumDopplerBins
uint8_t log2NumDopplerBins
Log2 of number of Doppler bins.
Definition: dopplerprochwa.h:373
DPU_DopplerProc_stats
Data processing Unit statistics.
Definition: dopplerproc_common.h:88
DPU_DopplerProcHWA_HW_Resources::hwaCfg
DPU_DopplerProcHWA_HwaCfg hwaCfg
HWA configuration.
Definition: dopplerprochwa.h:301