xWRL1432 MMWAVE-L-SDK  05.03.00
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 8
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 
210 typedef struct DPU_DopplerProcHWA_HwaCfg_t
211 {
215  uint8_t winSym;
216 
226  uint32_t windowSize;
227 
229  int32_t *window;
230 
232  uint32_t winRamOffset;
233 
240 
243 
247 
258 typedef struct DPU_DopplerProcHWA_EdmaCfg_t
259 {
262 
265 
268 
272 
283 typedef struct DPU_DopplerProcHWA_HW_Resources_t
284 {
287 
290 
293 
296 
298  /* NOTE: Application needs to provide address of the EDMA interrupt object.
299  * This needs to be done as there might be multiple subframes configured
300  * and each subframe needs EDMA interrupt to be registered.
301  */
304 
305 
321 typedef struct DPU_DopplerProcHWA_StaticConfig_t
322 {
324  uint8_t numTxAntennas;
325 
327  uint8_t numRxAntennas;
328 
331 
333  uint16_t numRangeBins;
334 
337 
339  uint16_t numDopplerBins;
340 
343 
345  uint8_t doppFFT_is16b;
346 
348 
359 typedef struct DPU_DopplerProcHWA_Config_t
360 {
363 
366 
368 
369 
379 typedef struct DPU_DopplerProcHWA_OutParams_t
380 {
384 
385 
390 int32_t DPU_DopplerProcHWA_GetNumUsedHwaParamSets(DPU_DopplerProcHWA_Handle handle, uint8_t *numUsedHwaParamSets);
391 
392 #ifdef __cplusplus
393 }
394 #endif
395 
396 #endif
DPU_DopplerProcHWA_HwaCfg::dmaTrigSrcPingChan
uint8_t dmaTrigSrcPingChan
HWA param set dma trigger source ping channel.
Definition: dopplerprochwa.h:242
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:215
DPU_DopplerProcHWA_HwaCfg::paramSetStartIdx
uint32_t paramSetStartIdx
HWA paramset Start index. Application has to ensure that paramSetStartIdx is such that [paramSetSt...
Definition: dopplerprochwa.h:239
DPU_DopplerProcHWA_Config
dopplerProc DPU configuration parameters
Definition: dopplerprochwa.h:360
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:322
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::numVirtualAntennas
uint8_t numVirtualAntennas
Number of virtual antennas.
Definition: dopplerprochwa.h:330
DPU_DopplerProcHWA_EdmaCfg::edmaHotSig
DPU_DopplerProc_Edma edmaHotSig
EDMA configuration for hot signature.
Definition: dopplerprochwa.h:270
DPU_DopplerProcHWA_OutParams
DPU processing output parameters.
Definition: dopplerprochwa.h:380
DPU_DopplerProcHWA_EdmaCfg::edmaHandle
EDMA_Handle edmaHandle
EDMA driver handle.
Definition: dopplerprochwa.h:261
dpif_detmatrix.h
Defines the detection matrix buffer interface.
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:449
DPU_DopplerProcHWA_HwaCfg
dopplerProc DPU HWA configuration parameters
Definition: dopplerprochwa.h:211
DPU_DopplerProcHWA_Config::staticCfg
DPU_DopplerProcHWA_StaticConfig staticCfg
Static configuration.
Definition: dopplerprochwa.h:365
DPU_DopplerProcHWA_OutParams::stats
DPU_DopplerProc_stats stats
DPU statistics.
Definition: dopplerprochwa.h:382
dp_error.h
Base error codes for the data path Modules.
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:327
dpedmahwa.h
EDMA Configuration Utility API definitions for HWA.
DPU_DopplerProcHWA_StaticConfig::numDopplerChirps
uint16_t numDopplerChirps
Number of Doppler chirps.
Definition: dopplerprochwa.h:336
DPU_DopplerProcHWA_HwaCfg::dmaTrigSrcPongChan
uint8_t dmaTrigSrcPongChan
HWA param set dma trigger source pong channel.
Definition: dopplerprochwa.h:245
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:264
DPU_DopplerProcHWA_Config::hwRes
DPU_DopplerProcHWA_HW_Resources hwRes
HW resources.
Definition: dopplerprochwa.h:362
DPU_DopplerProcHWA_StaticConfig::numTxAntennas
uint8_t numTxAntennas
Number of transmit antennas.
Definition: dopplerprochwa.h:324
DPU_DopplerProcHWA_HW_Resources::detMatrix
DPIF_DetMatrix detMatrix
Detection matrix (range-doppler heatmap)
Definition: dopplerprochwa.h:295
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:345
DPIF_RadarCube
Radar Cube Buffer Interface.
Definition: dpif_radarcube.h:104
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:267
DPU_DopplerProcHWA_HW_Resources
Doppler DPU HW configuration parameters.
Definition: dopplerprochwa.h:284
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:286
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:226
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:469
DPU_DopplerProcHWA_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: dopplerprochwa.h:302
DPU_DopplerProcHWA_HW_Resources::radar_1D_FFT_Cube
DPIF_RadarCube radar_1D_FFT_Cube
Radar Cube of range FFT.
Definition: dopplerprochwa.h:292
DPU_DopplerProcHWA_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: dopplerprochwa.h:333
DPU_DopplerProcHWA_EdmaCfg
dopplerProc DPU EDMA configuration parameters
Definition: dopplerprochwa.h:259
DPU_DopplerProcHWA_HwaCfg::window
int32_t * window
Pointer to Doppler FFT window coefficients.
Definition: dopplerprochwa.h:229
DPU_DopplerProcHWA_HwaCfg::winRamOffset
uint32_t winRamOffset
HWA window RAM offset in number of samples.
Definition: dopplerprochwa.h:232
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:564
DPU_DopplerProcHWA_StaticConfig::numDopplerBins
uint16_t numDopplerBins
Number of Doppler bins.
Definition: dopplerprochwa.h:339
DPU_DopplerProcHWA_StaticConfig::log2NumDopplerBins
uint8_t log2NumDopplerBins
Log2 of number of Doppler bins.
Definition: dopplerprochwa.h:342
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:289