xWRL6432 MMWAVE-L-SDK  05.04.00.01
zoomproc.h
Go to the documentation of this file.
1 /*
2  *
3  * NOTE:
4  * (C) Copyright 2018 - 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 
51 /**************************************************************************
52  *************************** Include Files ********************************
53  **************************************************************************/
54 #ifndef ZOOMPROC_H_
55 #define ZOOMPROC_H_
56 
57 /* Standard Include Files. */
58 #include <stdint.h>
59 #include <stdlib.h>
60 #include <stddef.h>
61 #include <string.h>
62 #include <stdio.h>
63 
64 /* MCU Plus SDK Drivers include files */
65 #include <drivers/hwa.h>
66 
67 /* mmWave SDK Data Path Include Files */
70 #include <datapath/dpif/dp_error.h>
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
79 #define DPU_ZOOMPROC_NUM_HWA_PARAM_SETS 1U
80 
89 #define DPU_ZOOMPROC_EINVAL (DP_ERRNO_ZOOM_PROC_BASE-1)
90 
94 #define DPU_ZOOMPROC_ENOMEM (DP_ERRNO_ZOOM_PROC_BASE-2)
95 
99 #define DPU_ZOOMPROC_EINTERNAL (DP_ERRNO_ZOOM_PROC_BASE-3)
100 
104 #define DPU_ZOOMPROC_ENOTIMPL (DP_ERRNO_ZOOM_PROC_BASE-4)
105 
109 #define DPU_ZOOMPROC_EINPROGRESS (DP_ERRNO_ZOOM_PROC_BASE-5)
110 
114 #define DPU_ZOOMPROC_ECMD (DP_ERRNO_ZOOM_PROC_BASE-6)
115 
119 #define DPU_ZOOMPROC_ESEMA (DP_ERRNO_ZOOM_PROC_BASE-7)
120 
128 typedef uint32_t DPU_ZoomProc_InputMode;
129 #define DPU_ZoomProc_InputMode_MAPPED (uint32_t) 0U
130 #define DPU_ZoomProc_InputMode_ISOLATED (uint32_t) 1U
131 #define DPU_ZoomProc_InputMode_HWA_INTERNAL_MEM (uint32_t) 2U
132 
142 typedef struct DPU_ZoomProc_HwaConfig_t
143 {
146 
148  uint8_t numParamSet;
149 
152 
154  uint8_t dmaTrigSrcChan;
155 
157 
167 typedef struct DPU_ZoomProc_EDMAInputConfig_t
168 {
173 
177 
187 typedef struct DPU_ZoomProc_EDMAOutputConfig_t
188 {
193 
195 
196 
206 typedef struct DPU_ZoomProc_HW_Resources_t
207 {
210 
213 
216 
219 
222 
224  cmplx32ImRe_t *zoomDftOut;
225 
227  uint32_t zoomDftOutSize;
228 
230  uint16_t *zoomInRbin;
231 
233 
243 typedef struct DPU_ZoomProc_StaticConfig_t
244 {
246  uint8_t numTxAntennas;
247 
250 
253 
254  /* Number of ADC samples */
255  //uint16_t numAdcSamples;
256 
258  float freqRes;
259 
261  float zoomRngFactor; // 3.0e8 * chirpRampTime/(2 * chirpBandwidth)
262 
264  uint16_t numRangeBins;
265 
267  uint16_t numDftBins;
268 
270  uint16_t zoomFftSize;
271 
274 
276  uint16_t interpFactor;
277 
279  uint16_t *peakLoc;
280 
283 
286 
288  uint8_t lowPowerMode;
290 
300 typedef struct DPU_ZoomProc_Config_t
301 {
304 
307 
309 
319 typedef struct DPU_ZoomProc_InitParams_t
320 {
324 
334 typedef struct DPU_ZoomProc_OutParams_t
335 {
338 
342 
349 typedef void* DPU_ZoomProc_Handle ;
350 
360 typedef struct ZoomProcObj_t
361 {
363 
366 
369 
372 
374 
376  uint8_t dataInTrigger;
377 
379  uint8_t dataOutTrigger;
380 
383 
386 
388  uint32_t hwaMemBankAddr[SOC_HWA_NUM_MEM_BANKS];
389 
391  cmplx16ImRe_t *ADCdataBuf;
392 
394  cmplx32ImRe_t *zoomDftOut;
395 
397  uint16_t *zoomInRbin;
398 
401 
404 
406  uint32_t numProcess;
407 
410 
411 }ZoomProcObj;
412 
413 /*================================================================
414  zoomProc DPU exposed APIs
415  ================================================================*/
417 (
418  DPU_ZoomProc_InitParams *initParams,
419  int32_t* errCode
420 );
421 
423 (
424  DPU_ZoomProc_Handle handle,
425  DPU_ZoomProc_Config* zoomCfg
426 );
427 
429 (
430  DPU_ZoomProc_Handle handle,
431  DPU_ZoomProc_OutParams* outParams
432 );
433 
435 (
436  DPU_ZoomProc_Handle handle
437 );
438 
439 #ifdef __cplusplus
440 }
441 #endif
442 
443 #endif
DPU_ZoomProc_EDMAOutputConfig
ZoomProc EDMA configuration.
Definition: zoomproc.h:188
DPU_ZoomProc_HW_Resources::edmaInCfg
DPU_ZoomProc_EDMAInputConfig edmaInCfg
EDMA configuration for zoomProc data Input.
Definition: zoomproc.h:215
DPU_ZoomProc_Config
Range FFT configuration.
Definition: zoomproc.h:301
DPU_ZoomProc_HW_Resources::zoomInRbin
uint16_t * zoomInRbin
Zoom in frequencies as range bin locations based on 1D FFT resolution.
Definition: zoomproc.h:230
DPU_ZoomProc_HW_Resources::zoomDftOutSize
uint32_t zoomDftOutSize
DFT output buffer size.
Definition: zoomproc.h:227
DPU_ZoomProc_StaticConfig::lowPowerMode
uint8_t lowPowerMode
Low power mode 0-disabled, 1-enabled, 2-test mode (power stays on, system coftware components reset)
Definition: zoomproc.h:288
DPU_ZoomProc_HW_Resources::hwaCfg
DPU_ZoomProc_HwaConfig hwaCfg
HWA configuration.
Definition: zoomproc.h:212
SOC_HWA_NUM_MEM_BANKS
#define SOC_HWA_NUM_MEM_BANKS
number of HWA memory banks
Definition: cslr_soc_defines.h:281
ZoomProcObj::dataOutTrigger
uint8_t dataOutTrigger
ZoomProc HWA data output paramset trigger.
Definition: zoomproc.h:379
DPU_ZoomProc_StaticConfig::zoomSamplesOneSide
uint16_t zoomSamplesOneSide
number of samples to zoom on either side of peak freq of interest
Definition: zoomproc.h:273
DPU_ZoomProc_InitParams
zoomProc output parameters populated during zoomProc Processing time
Definition: zoomproc.h:320
DPU_ZoomProc_StaticConfig::numTxAntennas
uint8_t numTxAntennas
Number of transmit antennas.
Definition: zoomproc.h:246
ZoomProcObj::params
DPU_ZoomProc_StaticConfig params
ZoomProc static configuration.
Definition: zoomproc.h:368
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:451
ZoomProcObj::initParms
DPU_ZoomProc_InitParams initParms
Definition: zoomproc.h:362
DPIF_ADCBufData
ADC Data buffer definition.
Definition: dpif_adcdata.h:111
DPU_ZoomProc_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: zoomproc.h:221
ZoomProcObj::ADCdataBuf
cmplx16ImRe_t * ADCdataBuf
Pointer to ADC buffer.
Definition: zoomproc.h:391
DPU_ZoomProc_StaticConfig::numChirpsPerFrame
uint16_t numChirpsPerFrame
Number of chirps per frame.
Definition: zoomproc.h:282
DPU_ZoomProc_HwaConfig::dataInputMode
DPU_ZoomProc_InputMode dataInputMode
Data Input Mode, to configure EDMA in for the adc input.
Definition: zoomproc.h:151
ZoomProcObj::dataOutZoomChan
uint8_t dataOutZoomChan
DMA data out event channel.
Definition: zoomproc.h:400
DPU_ZoomProc_InputMode
uint32_t DPU_ZoomProc_InputMode
DPU Operating Modes.
Definition: zoomproc.h:128
DPU_ZoomProc_StaticConfig::freqRes
float freqRes
Range FFT frequency bin resolution.
Definition: zoomproc.h:258
DPU_ZoomProc_EDMAInputConfig::dataIn
DPEDMA_ChanCfg dataIn
EDMA configuration for zoomProc data Input This is needed only in DPU_ZoomProc_InputMode_ISOLATED.
Definition: zoomproc.h:172
dp_error.h
Base error codes for the data path Modules.
ZoomProcObj::isTestMode
bool isTestMode
Definition: zoomproc.h:373
DPU_ZoomProc_EDMAInputConfig::dataInSignature
DPEDMA_ChanCfg dataInSignature
EDMA configuration for zoomProc data Input Signature.
Definition: zoomproc.h:175
DPU_ZoomProc_OutParams::zoomRangeMeas
float zoomRangeMeas
zoomProc stats
Definition: zoomproc.h:337
dpedmahwa.h
EDMA Configuration Utility API definitions for HWA.
DPU_ZoomProc_StaticConfig::numDftBins
uint16_t numDftBins
Number of zoom DFT bins.
Definition: zoomproc.h:267
ZoomProcObj::numProcess
uint32_t numProcess
Total number of zoomProc DPU processing.
Definition: zoomproc.h:406
dpif_adcdata.h
Defines RF ADCBuf interface.
DPU_ZoomProc_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: zoomproc.h:264
DPU_ZoomProc_HW_Resources::zoomDftOut
cmplx32ImRe_t * zoomDftOut
Pointer to DFT output buffer.
Definition: zoomproc.h:224
DPU_ZoomProc_InitParams::hwaHandle
HWA_Handle hwaHandle
HWA Handle.
Definition: zoomproc.h:322
ZoomProcObj::numEdmaDataOutCnt
uint32_t numEdmaDataOutCnt
Total number of data output EDMA done interrupt.
Definition: zoomproc.h:409
DPU_ZoomProc_Config::staticCfg
DPU_ZoomProc_StaticConfig staticCfg
zoomProc static configuration
Definition: zoomproc.h:306
DPU_ZoomProc_init
DPU_ZoomProc_Handle DPU_ZoomProc_init(DPU_ZoomProc_InitParams *initParams, int32_t *errCode)
ZoomProcObj::dataInTrigger
uint8_t dataInTrigger
ZoomProc HWA data input paramset trigger.
Definition: zoomproc.h:376
ZoomProcObj::inProgress
bool inProgress
zoomProc DPU is in processing state
Definition: zoomproc.h:403
ZoomProcObj::edmaHandle
EDMA_Handle edmaHandle
EDMA Handle.
Definition: zoomproc.h:365
DPU_ZoomProc_StaticConfig
ZoomProc static configuration.
Definition: zoomproc.h:244
ZoomProcObj::zoomInRbin
uint16_t * zoomInRbin
Zoom in frequencies as range bin locations based on 1D FFT resolution.
Definition: zoomproc.h:397
DPU_ZoomProc_OutParams::endOfChirp
bool endOfChirp
End of Chirp indication for rangeProcHWA.
Definition: zoomproc.h:340
DPU_ZoomProc_HwaConfig
ZoomProc HWA configuration.
Definition: zoomproc.h:143
DPU_ZoomProc_HW_Resources::edmaHandle
EDMA_Handle edmaHandle
EDMA Handle.
Definition: zoomproc.h:209
DPU_ZoomProc_HW_Resources::edmaOutCfg
DPU_ZoomProc_EDMAOutputConfig edmaOutCfg
EDMA configuration for zoomProc data Output.
Definition: zoomproc.h:218
DPU_ZoomProc_HW_Resources
ZoomProc hardware resources.
Definition: zoomproc.h:207
ZoomProcObj::hwaCfg
DPU_ZoomProc_HwaConfig hwaCfg
HWA configuration.
Definition: zoomproc.h:371
DPU_ZoomProc_Config::hwRes
DPU_ZoomProc_HW_Resources hwRes
zoomProc hardware resources
Definition: zoomproc.h:303
DPU_ZoomProc_config
int32_t DPU_ZoomProc_config(DPU_ZoomProc_Handle handle, DPU_ZoomProc_Config *zoomCfg)
DPU_ZoomProc_HwaConfig::dmaTrigSrcChan
uint8_t dmaTrigSrcChan
ZoomProc HWA data input paramset dma trigger source channel.
Definition: zoomproc.h:154
hwa.h
ZoomProcObj
ZoomProc DPU Object.
Definition: zoomproc.h:361
ZoomProcObj::edmaDoneSemaHandle
SemaphoreP_Object edmaDoneSemaHandle
EDMA done semaphore.
Definition: zoomproc.h:382
DPU_ZoomProc_deinit
int32_t DPU_ZoomProc_deinit(DPU_ZoomProc_Handle handle)
dpif_radarcube.h
Defines the data path radar cube data interface.
DPU_ZoomProc_StaticConfig::ADCBufData
DPIF_ADCBufData ADCBufData
ADCBuf buffer interface.
Definition: zoomproc.h:285
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:471
DPU_ZoomProc_StaticConfig::numVirtualAntennas
uint8_t numVirtualAntennas
Number of virtual antennas.
Definition: zoomproc.h:249
DPU_ZoomProc_process
int32_t DPU_ZoomProc_process(DPU_ZoomProc_Handle handle, DPU_ZoomProc_OutParams *outParams)
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
DPU_ZoomProc_StaticConfig::isTestMode
bool isTestMode
Enable for offline ADC test mode.
Definition: zoomproc.h:252
DPU_ZoomProc_StaticConfig::interpFactor
uint16_t interpFactor
interpolation factor for zoom in
Definition: zoomproc.h:276
DPU_ZoomProc_HwaConfig::paramSetStartIdx
uint8_t paramSetStartIdx
HWA paramset Start index.
Definition: zoomproc.h:145
DPU_ZoomProc_StaticConfig::zoomRngFactor
float zoomRngFactor
Chirp ramp end time/duration - in sec.
Definition: zoomproc.h:261
DPU_ZoomProc_StaticConfig::zoomFftSize
uint16_t zoomFftSize
zoom FFT size
Definition: zoomproc.h:270
DPU_ZoomProc_EDMAInputConfig
ZoomProc EDMA configuration.
Definition: zoomproc.h:168
dpedma.h
EDMA Configuration Utility API definitions.
ZoomProcObj::zoomDftOut
cmplx32ImRe_t * zoomDftOut
Pointer to Radar Cube buffer.
Definition: zoomproc.h:394
HWA_Handle
void * HWA_Handle
A handle that is returned from a HWA_open() call.
Definition: hwa/v0/hwa.h:620
DPU_ZoomProc_HwaConfig::numParamSet
uint8_t numParamSet
Number of HWA param sets must be DPU_ZOOMPROC_NUM_HWA_PARAM_SETS.
Definition: zoomproc.h:148
ZoomProcObj::hwaDoneSemaHandle
SemaphoreP_Object hwaDoneSemaHandle
HWA Processing Done semaphore Handle.
Definition: zoomproc.h:385
DPU_ZoomProc_Handle
void * DPU_ZoomProc_Handle
zoomProc DPU Handle
Definition: zoomproc.h:349
DPU_ZoomProc_EDMAOutputConfig::dataOutZoom
DPEDMA_ChanCfg dataOutZoom
EDMA configuration for zoomProc data Out. It must be a HWACC triggered EDMA channel.
Definition: zoomproc.h:192
DPU_ZoomProc_StaticConfig::peakLoc
uint16_t * peakLoc
1D FFT peak bin location
Definition: zoomproc.h:279
DPU_ZoomProc_OutParams
zoomProc output parameters populated during zoomProc Processing time
Definition: zoomproc.h:335
DPEDMA_ChanCfg
EDMA channel configuration.
Definition: dpedma.h:132