xWRL6432 MMWAVE-L-SDK  05.04.00.01
HWA

The HWA driver provides APIs to configure, trigger and obtain results from the hardware accelerator

Features Supported

  • All HWA operating modes: FFT, CFAR and compression/decompression
  • API to program common HWA registers, HWA param sets
  • API to program pre/post processing blocks and core computational units
  • Interrupt and polling mode of operations - param done, processing done
  • Manual or DMA trigger for data copy from/to HWA memories

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • HWA instances selection
  • Init/Deinit API integration with SYSCFG

Features NOT Supported

  • None

Important Usage Guidelines

  • The HWA Driver needs to be initialized once across the System. This is done using the HWA_init. None of the HWA API can be used without invoking this API. Note: This API is integrated into Sysconfig and can be skipped by user if Sysconfig is used for integrating HWA
  • Once the HWA Driver has been initialized; the HWA Driver instance can be opened using the HWA_open. The HWA_open can be called multiple times from different context to obtain a valid HWA handle. However, only the first call to HWA_open will perform the hardware initialization. Other subsequent calls will just return the already open handle.

Example Usage

Include the below file to access the APIs

#include <drivers/hwa.h>

Instance Open Example

int32_t status = SystemP_SUCCESS;
HWA_CommonConfig commonCfg;
HWA_ParamConfig paramCfg;
uint32_t paramIdx = 0U; /* Can be any paramset as per need */
/* Open HWA driver */
gHwaHandle = HWA_open(0, NULL, &status);
DebugP_assert(gHwaHandle == NULL);
/* Init Common Params */
memset(&commonCfg, 0, sizeof(commonCfg));
commonCfg.fftConfig.twidDitherEnable = 0U;
commonCfg.paramStartIdx = paramIdx;
commonCfg.paramStopIdx = paramIdx;
commonCfg.numLoops = (commonCfg.paramStopIdx - commonCfg.paramStartIdx) + 1U;
status = HWA_configCommon(gHwaHandle, &commonCfg);
/* Init param set */
memset(&paramCfg , 0, sizeof(paramCfg));
/* ... Add init all other parameters as per need */
status = HWA_configParamSet(gHwaHandle, paramIdx, &paramCfg, NULL);

Instance Close Example

int32_t status;
status = HWA_close(gHwaHandle);

Instance Processing Example

int32_t status;
uint32_t dmaCh = 0U; /* Can be any DMA channel as per need */
/* Enable HWA */
status = HWA_enable(gHwaHandle, 1U);
status = HWA_reset(gHwaHandle);
/* Trigger and wait */
status = HWA_setDMA2ACCManualTrig(gHwaHandle, dmaCh);
/* Wait for Done Callback */
/* Disable HWA */
status = HWA_enable(gHwaHandle, 0U);

API

APIs for HWA

HWA_enable
int32_t HWA_enable(HWA_Handle handle, uint8_t flagEnDis)
Function to enable the state machine of the HWA. This should be called after paramset and RAM have be...
HWA_reset
int32_t HWA_reset(HWA_Handle handle)
Function to reset the internal state machine of the HWA.
HWA_setDMA2ACCManualTrig
int32_t HWA_setDMA2ACCManualTrig(HWA_Handle handle, uint8_t idx)
Function to manually trigger the execution of the state machine waiting on DMA via software.
HWA_COMMONCONFIG_MASK_TWIDDITHERENABLE
#define HWA_COMMONCONFIG_MASK_TWIDDITHERENABLE
Definition: hwa/v0/hwa.h:543
HWA_open
HWA_Handle HWA_open(uint32_t index, HWA_OpenConfig *hwaCfg, int32_t *errCode)
Function to initialize HWA specified by the particular index value.
HWA_CommonConfig::numLoops
uint16_t numLoops
Definition: hwa/v0/hwa.h:702
HWA_CommonConfig::paramStartIdx
uint8_t paramStartIdx
Definition: hwa/v0/hwa.h:705
HWA_CommonConfig::twidDitherEnable
uint8_t twidDitherEnable
Definition: hwa/v0/hwa.h:730
HWA_close
int32_t HWA_close(HWA_Handle handle)
Function to close a HWA peripheral specified by the HWA handle.
HWA_ParamConfig::triggerMode
uint8_t triggerMode
Definition: hwa/v0/hwa.h:1257
HWA_CommonConfig::paramStopIdx
uint8_t paramStopIdx
Definition: hwa/v0/hwa.h:708
HWA_configCommon
int32_t HWA_configCommon(HWA_Handle handle, HWA_CommonConfig *commonConfig)
Function to set the common HWA configuration parameters needed for the next operations/iterations/par...
HWA_CommonConfig::configMask
uint32_t configMask
Definition: hwa/v0/hwa.h:699
HWA_CommonConfig::fftConfig
struct HWA_CommonConfig::@0 fftConfig
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
HWA_configParamSet
int32_t HWA_configParamSet(HWA_Handle handle, uint8_t paramsetIdx, HWA_ParamConfig *paramConfig, HWA_SrcDMAConfig *dmaConfig)
Function to set the HWA configuration parameters for a given paramSet.
HWA_COMMONCONFIG_MASK_NUMLOOPS
#define HWA_COMMONCONFIG_MASK_NUMLOOPS
Definition: hwa/v0/hwa.h:536
HWA_ACCELMODE_FFT
#define HWA_ACCELMODE_FFT
Definition: hwa/v0/hwa.h:322
hwa.h
HWA_CommonConfig
HWA Common Config.
Definition: hwa/v0/hwa.h:698
HWA_ParamConfig
HWA Paramset Config.
Definition: hwa/v0/hwa.h:1256
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:159
HWA_TRIG_MODE_DMA
#define HWA_TRIG_MODE_DMA
Definition: hwa/v0/hwa.h:310
HWA_ParamConfig::accelMode
uint8_t accelMode
Definition: hwa/v0/hwa.h:1263