xWRL6432 MMWAVE-L-SDK  05.04.00.01
aoaprochwa.h
Go to the documentation of this file.
1 /*
2  * NOTE:
3  * (C) Copyright 2023 Texas Instruments, Inc.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
54 /**************************************************************************
55  *************************** Include Files ********************************
56  **************************************************************************/
57 #ifndef AOAPROCHWA_H_
58 #define AOAPROCHWA_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 */
78 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
91 #define DPU_AOAPROCHWA_EINVAL (DP_ERRNO_AOA_PROC_BASE-1)
92 
96 #define DPU_AOAPROCHWA_ENOMEM (DP_ERRNO_AOA_PROC_BASE-2)
97 
101 #define DPU_AOAPROCHWA_EINPROGRESS (DP_ERRNO_AOA_PROC_BASE-3)
102 
106 #define DPU_AOAPROCHWA_EHWARES (DP_ERRNO_AOA_PROC_BASE-4)
107 
111 #define DPU_AOAPROCHWA_ESEMA (DP_ERRNO_AOA_PROC_BASE-5)
112 
116 #define DPU_AOAPROCHWA_ESEMASTATUS (DP_ERRNO_AOA_PROC_BASE-6)
117 
121 #define DPU_AOAPROCHWA_EEXCEEDHWAMEM (DP_ERRNO_AOA_PROC_BASE-7)
122 
126 #define DPU_AOAPROCHWA_ECUBEFORMAT (DP_ERRNO_AOA_PROC_BASE-8)
127 
131 #define DPU_AOAPROCHWA_EDETMFORMAT (DP_ERRNO_AOA_PROC_BASE-9)
132 
136 #define DPU_AOAPROCHWA_EDETMSIZE (DP_ERRNO_AOA_PROC_BASE-10)
137 
141 #define DPU_AOAPROCHWA_EWINDSIZE (DP_ERRNO_AOA_PROC_BASE-11)
142 
151 #define DPU_AOAPROCHWA_MAX_NUM_HWA_PARAMSET 12
152 
158 #define DPU_AOAPROCHWA_NUM_HWA_PARAMSET_DOPPLER_FFT 6
159 
165 #define DPU_AOAPROCHWA_NUM_HWA_PARAMSET_DOPPLER_FFT_ONLY 2
166 
172 #define DPU_AOAPROCHWA_NUM_HWA_PARAMSET_AOA 6
173 
177 #define DPU_AOAPROCHWA_NUM_HWA_MEMBANKS 4
178 
182 typedef void* DPU_AoAProcHWA_Handle;
183 
193 typedef struct DPU_AoAProcHWA_InitCfg_t
194 {
197 
199 
210 typedef struct DPU_AoAProcHWA_HwaCfg_t
211 {
212 
216  uint8_t winSym;
217 
227  uint32_t windowSize;
228 
230  int32_t *window;
231 
233  uint32_t winRamOffset;
234 
239  uint32_t vectorRamSize;
240 
242  cmplx32ImRe_t *vectorRam;
243 
245  uint32_t vecRamOffset;
246 
253 
256 
259 
262 
265 
267 
278 typedef struct DPU_AoAProcHWA_EdmaCfg_t
279 {
282 
285 
288 
291 
294 
297 
299 
310 typedef struct DPU_AoAProcHWA_HW_Resources_t
311 {
314 
317 
320 
323 
325  uint32_t *maxVal_elev_azim;
326 
328  /* NOTE: Application needs to provide address of the EDMA interrupt object.
329  * This needs to be done as there might be multiple subframes configured
330  * and each subframe needs EDMA interrupt to be registered.
331  */
334 
345 typedef struct DPU_AoAProcHWA_maxDetMatrix_Resources_t
346 {
348  uint16_t *rangeGatesCount;
349 
351  uint16_t *range_idx_arr;
352 
355 
357  int16_t *doppler_idx_arr;//Pointer to array of size [MAX_NUM_RANGE_BINS][MAX_NUM_POINTS];
358 
360  cmplx32ImRe_t *antenna_array;
361 
363  uint8_t max_num_points;
364 
368 
380 typedef struct DPU_AoAProcHWA_StaticConfig_t
381 {
383  uint8_t numTxAntennas;
384 
386  uint8_t numRxAntennas;
387 
390 
392  uint16_t numRangeBins;
393 
396 
398  uint16_t numDopplerBins;
399 
402 
404  uint8_t doppFFT_is16b;
405 
407  uint8_t azimuthFFTSize;
408 
411 
414 
417 
420 
422  uint8_t numRows_Antenna;
423 
425 
436 typedef struct DPU_AoAProcHWA_Config_t
437 {
440 
443 
445 
447 
448 
458 typedef struct DPU_AoAProcHWA_OutParams_t
459 {
463 
469 
470 #ifdef __cplusplus
471 }
472 #endif
473 
474 #endif
DPU_AoAProcHWA_HW_Resources
AoA DPU HW configuration parameters.
Definition: aoaprochwa.h:311
DPU_AoAProcHWA_HwaCfg
AoAProc DPU HWA configuration parameters.
Definition: aoaprochwa.h:211
DPU_AoAProcHWA_maxDetMatrix_Resources::doppler_idx_arr
int16_t * doppler_idx_arr
Array to store Doppler index corresponding to range index for which Angle FFT is to be applied.
Definition: aoaprochwa.h:357
DPU_AoAProcHWA_HwaCfg::paramSetStartIdx
uint32_t paramSetStartIdx
HWA paramset Start index. Application has to ensure that paramSetStartIdx is such that [paramSetSt...
Definition: aoaprochwa.h:252
DPU_AoAProcHWA_StaticConfig::numVirtualAntennas
uint8_t numVirtualAntennas
Number of virtual antennas.
Definition: aoaprochwa.h:389
DPU_AoAProcHWA_HwaCfg::winRamOffset
uint32_t winRamOffset
HWA window RAM offset in number of samples.
Definition: aoaprochwa.h:233
dpif_detmatrix.h
Defines the detection matrix buffer interface.
DPU_AoAProcHWA_EdmaCfg::edmaIn_dopplerFFT
DPU_AoAProc_Edma edmaIn_dopplerFFT
EDMA configuration for Input data (Radar Angle Matrix -> HWA memory).
Definition: aoaprochwa.h:287
DPU_AoAProcHWA_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: aoaprochwa.h:227
DPU_AoAProcHWA_AoAprocess
int32_t DPU_AoAProcHWA_AoAprocess(DPU_AoAProcHWA_Handle handle, DPU_AoAProcHWA_OutParams *outParams)
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:451
DPU_AoAProcHWA_HwaCfg::vecRamOffset
uint32_t vecRamOffset
HWA vector multiplication RAM offset in number of samples.
Definition: aoaprochwa.h:245
DPU_AoAProcHWA_Handle
void * DPU_AoAProcHWA_Handle
Handle for AoA Processing DPU.
Definition: aoaprochwa.h:182
DPU_AoAProcHWA_Config
AoAProc DPU configuration parameters.
Definition: aoaprochwa.h:437
DPU_AoAProcHWA_HwaCfg::hwaDmaTriggerDoppPong
uint8_t hwaDmaTriggerDoppPong
HWA param set dma trigger source channel.
Definition: aoaprochwa.h:258
DPU_AoAProcHWA_Dopplerprocess
int32_t DPU_AoAProcHWA_Dopplerprocess(DPU_AoAProcHWA_Handle handle, DPU_AoAProcHWA_OutParams *outParams)
DPU_AoAProcHWA_StaticConfig::log2NumDopplerBins
uint8_t log2NumDopplerBins
Log2 of number of Doppler bins.
Definition: aoaprochwa.h:401
DPU_AoAProcHWA_maxDetMatrix_Resources
AoA DPU HW configuration parameters.
Definition: aoaprochwa.h:346
DPU_AoAProcHWA_init
DPU_AoAProcHWA_Handle DPU_AoAProcHWA_init(DPU_AoAProcHWA_InitParams *initCfg, int32_t *errCode)
DPU_AoAProcHWA_StaticConfig::elevationFFTSize
uint8_t elevationFFTSize
Elevation FFT Size.
Definition: aoaprochwa.h:416
DPU_AoAProcHWA_HwaCfg::vectorRamSize
uint32_t vectorRamSize
Vector Multiplication RAM size in bytes. This is the number of coefficients to be programmed in the H...
Definition: aoaprochwa.h:239
DPU_AoAProcHWA_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: aoaprochwa.h:392
DPU_AoAProcHWA_OutParams
DPU processing output parameters.
Definition: aoaprochwa.h:459
DPU_AoAProcHWA_Config::hwRes
DPU_AoAProcHWA_HW_Resources hwRes
HW resources.
Definition: aoaprochwa.h:439
DPU_AoAProcHWA_HwaCfg::window
int32_t * window
Pointer to Doppler FFT window coefficients.
Definition: aoaprochwa.h:230
dpedmahwa.h
EDMA Configuration Utility API definitions for HWA.
DPU_AoAProcHWA_EdmaCfg
AoAProc DPU EDMA configuration parameters.
Definition: aoaprochwa.h:279
DPU_AoAProcHWA_EdmaCfg::edmaHotSigDoppler
DPU_AoAProc_Edma edmaHotSigDoppler
EDMA configuration for hot signature before Doppler FFT.
Definition: aoaprochwa.h:290
DPU_AoAProcHWA_InitParams::hwaHandle
HWA_Handle hwaHandle
HWA Handle.
Definition: aoaprochwa.h:196
DPU_AoAProcHWA_maxDetMatrix_Resources::angle_idx_doppler_count_arr
uint16_t * angle_idx_doppler_count_arr
// Array to store the number of MAX POINTS for a range index for which AoA is to be applied
Definition: aoaprochwa.h:354
DPU_AoAProcHWA_HwaCfg::winSym
uint8_t winSym
Indicates if HWA window is symmetric or non-symmetric. Use HWA macro definitions for symmetric/non-sy...
Definition: aoaprochwa.h:216
dpif_anglemat.h
Defines the data path radar cube data interface.
DPU_AoAProcHWA_Config::maxDetmatrix_res
DPU_AoAProcHWA_maxDetMatrix_Resources maxDetmatrix_res
Definition: aoaprochwa.h:444
DPU_AoAProcHWA_StaticConfig::numRxAntennas
uint8_t numRxAntennas
Number of receive antennas.
Definition: aoaprochwa.h:386
DPU_AoAProcHWA_OutParams::stats
DPU_AoAProc_stats stats
DPU statistics.
Definition: aoaprochwa.h:461
DPU_AoAProcHWA_HW_Resources::radar_1D_FFT_Cube
DPIF_RadarCube radar_1D_FFT_Cube
Radar Cube.
Definition: aoaprochwa.h:319
DPU_AoAProcHWA_StaticConfig::numRows_Antenna
uint8_t numRows_Antenna
Num of antenna in elevation dimension.
Definition: aoaprochwa.h:422
DPU_AoAProcHWA_StaticConfig::doppFFT_is16b
uint8_t doppFFT_is16b
Flag to set Doppler FFT to 16-bit(1-True)/32-bit(0-False)
Definition: aoaprochwa.h:404
DPU_AoAProcHWA_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: aoaprochwa.h:332
DPU_AoAProcHWA_HW_Resources::edmaCfg
DPU_AoAProcHWA_EdmaCfg edmaCfg
EDMA configuration.
Definition: aoaprochwa.h:313
DPU_AoAProcHWA_HW_Resources::maxVal_elev_azim
uint32_t * maxVal_elev_azim
Matrix where the azimuth-elevation FFT max values is stored (this matrix should be in M4 for ease of ...
Definition: aoaprochwa.h:325
DPU_AoAProcHWA_StaticConfig::azimuthFFTSize
uint8_t azimuthFFTSize
Azimuth FFT Size.
Definition: aoaprochwa.h:407
DPU_AoAProcHWA_maxDetMatrix_Resources::range_idx_arr
uint16_t * range_idx_arr
Array to store range index for which Doppler FFT is to be applied.
Definition: aoaprochwa.h:351
DPU_AoAProcHWA_StaticConfig::numDopplerBins
uint16_t numDopplerBins
Number of Doppler bins.
Definition: aoaprochwa.h:398
DPU_AoAProcHWA_maxDetMatrix_Resources::rangeGatesCount
uint16_t * rangeGatesCount
Range Gates count.
Definition: aoaprochwa.h:348
DPU_AoAProc_stats
Data processing Unit statistics.
Definition: aoaproc_common.h:128
aoaproc_common.h
Implements Common definition across AoAProc DPU.
DPU_AoAProcHWA_HW_Resources::hwaCfg
DPU_AoAProcHWA_HwaCfg hwaCfg
HWA configuration.
Definition: aoaprochwa.h:316
DPIF_RadarCube
Radar Cube Buffer Interface.
Definition: dpif_radarcube.h:105
DPU_AoAProcHWA_StaticConfig::numTxAntennas
uint8_t numTxAntennas
Number of transmit antennas.
Definition: aoaprochwa.h:383
hwa.h
DPU_AoAProcHWA_deinit
int32_t DPU_AoAProcHWA_deinit(DPU_AoAProcHWA_Handle handle)
dpif_radarcube.h
Defines the data path radar cube data interface.
DPU_AoAProcHWA_HW_Resources::angleMat
DPIF_Anglemat angleMat
Angle Matrix on which Elevation-Azimuth FFT is to be applied.
Definition: aoaprochwa.h:322
DPU_AoAProcHWA_StaticConfig::numCols_Antenna
uint8_t numCols_Antenna
Num of antenna in azimuth dimension.
Definition: aoaprochwa.h:419
DPU_AoAProcHWA_StaticConfig::log2NumAzimuthBins
uint8_t log2NumAzimuthBins
Log2 of number of Azimuth FFT bins.
Definition: aoaprochwa.h:410
DPU_AoAProcHWA_InitParams
AoAProc DPU initial configuration parameters.
Definition: aoaprochwa.h:194
DPU_AoAProcHWA_maxDetMatrix_Resources::antenna_array_elements
uint8_t antenna_array_elements
Number of antenna elements under consideration.
Definition: aoaprochwa.h:366
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:471
DPU_AoAProcHWA_StaticConfig::numDopplerChirps
uint16_t numDopplerChirps
Number of Doppler chirps.
Definition: aoaprochwa.h:395
DPU_AoAProcHWA_maxDetMatrix_Resources::max_num_points
uint8_t max_num_points
Number of max points under consideration.
Definition: aoaprochwa.h:363
DPU_AoAProcHWA_HwaCfg::hwaDmaTriggerAoAPong
uint8_t hwaDmaTriggerAoAPong
HWA param set dma trigger source channel.
Definition: aoaprochwa.h:264
DPU_AoAProcHWA_HwaCfg::vectorRam
cmplx32ImRe_t * vectorRam
Pointer to Vector Multiplication RAM coefficients.
Definition: aoaprochwa.h:242
DPU_AoAProcHWA_StaticConfig
AoA DPU static configuration parameters.
Definition: aoaprochwa.h:381
DPU_AoAProcHWA_EdmaCfg::edmaIn_rangeFFT
DPU_AoAProc_Edma edmaIn_rangeFFT
EDMA configuration for Input data (Radar FFT cube -> HWA memory).
Definition: aoaprochwa.h:284
DPU_AoAProcHWA_EdmaCfg::edmaHandle
EDMA_Handle edmaHandle
EDMA driver handle of TPCC B.
Definition: aoaprochwa.h:281
DPU_AoAProcHWA_EdmaCfg::edmaOut_maxAoA
DPU_AoAProc_Edma edmaOut_maxAoA
EDMA configuration for hot signature before AoA FFT.
Definition: aoaprochwa.h:296
DPIF_Anglemat
Angle Matrix Buffer Interface.
Definition: dpif_anglemat.h:80
dpedma.h
EDMA Configuration Utility API definitions.
DPU_AoAProcHWA_EdmaCfg::edmaHotSigAoA
DPU_AoAProc_Edma edmaHotSigAoA
EDMA configuration for hot signature before AoA FFT.
Definition: aoaprochwa.h:293
HWA_Handle
void * HWA_Handle
A handle that is returned from a HWA_open() call.
Definition: hwa/v0/hwa.h:620
DPU_AoAProcHWA_Config::staticCfg
DPU_AoAProcHWA_StaticConfig staticCfg
Static configuration.
Definition: aoaprochwa.h:442
DPU_AoAProcHWA_HwaCfg::hwaDmaTriggerDoppPing
uint8_t hwaDmaTriggerDoppPing
HWA param set dma trigger source channel.
Definition: aoaprochwa.h:255
DPU_AoAProc_Edma
AoAProc DPU EDMA configuration parameters.
Definition: aoaproc_common.h:110
DPU_AoAProcHWA_HwaCfg::hwaDmaTriggerAoAPing
uint8_t hwaDmaTriggerAoAPing
HWA param set dma trigger source channel.
Definition: aoaprochwa.h:261
DPU_AoAProcHWA_config
int32_t DPU_AoAProcHWA_config(DPU_AoAProcHWA_Handle handle, DPU_AoAProcHWA_Config *cfg)
DPU_AoAProcHWA_StaticConfig::log2NumElevationBins
uint8_t log2NumElevationBins
Log2 of number of Elevation FFT bins.
Definition: aoaprochwa.h:413
DPU_AoAProcHWA_maxDetMatrix_Resources::antenna_array
cmplx32ImRe_t * antenna_array
Antenna array to store elements before applying elevation-azimuth FFT.
Definition: aoaprochwa.h:360