Functions
FFTC LLD Functions
FFTC LLD Data Structures & APIs

Functions

int32_t Fftc_mapDFTSizeToIndex (uint32_t dftBlockSize)
int32_t Fftc_compileQueueLocalConfigParams (Fftc_QLocalCfg *pFFTLocalCfg, uint8_t *pData, uint32_t *pLen)
int32_t Fftc_recompileQueueLocalDFTParams (int32_t dftSize, Fftc_DFTMode dftMode, uint8_t *pData)
int32_t Fftc_recompileQueueLocalCyclicPrefixParams (int32_t cyclicPrefixLen, uint8_t *pData)
int32_t Fftc_createControlHeader (Fftc_ControlHdr *pFFTCfgCtrlHdr, uint8_t *pData, uint32_t *pLen)
int32_t Fftc_createDftSizeList (uint16_t *pDftSizeList, uint32_t dftSizeListLen, uint8_t *pData, uint32_t *pLen)
int32_t Fftc_modifyLocalCfgPresentControlHeader (int32_t bLocalConfigPresent, uint8_t *pData)
int32_t Fftc_lldOpen (uint8_t instNum, void *cfgRegs, Fftc_LldObj *pFFTCLldObj)
int32_t Fftc_lldClose (Fftc_LldObj *pFFTCLldObj)
int32_t Fftc_readPidReg (Fftc_LldObj *pFFTCLldObj, Fftc_PeripheralIdParams *pPIDCfg)
int32_t Fftc_readGlobalConfigReg (Fftc_LldObj *pFFTCLldObj, Fftc_GlobalCfg *pFFTGlobalCfg)
int32_t Fftc_writeGlobalConfigReg (Fftc_LldObj *pFFTCLldObj, Fftc_GlobalCfg *pFFTGlobalCfg)
void Fftc_doSoftwareReset (Fftc_LldObj *pFFTCLldObj)
void Fftc_doSoftwareContinue (Fftc_LldObj *pFFTCLldObj)
int32_t Fftc_isHalted (Fftc_LldObj *pFFTCLldObj)
int32_t Fftc_writeEmulationControlReg (Fftc_LldObj *pFFTCLldObj, Fftc_EmulationControlParams *pEmulationCfg)
int32_t Fftc_readEmulationControlReg (Fftc_LldObj *pFFTCLldObj, Fftc_EmulationControlParams *pEmulationCfg)
int32_t Fftc_writeEoiReg (Fftc_LldObj *pFFTCLldObj, int32_t eoiVal)
int32_t Fftc_readEoiReg (Fftc_LldObj *pFFTCLldObj)
void Fftc_clearQueueClippingDetectReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum)
int32_t Fftc_readQueueClippingDetectReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum)
int32_t Fftc_readBlockDestQStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_DestQStatusReg *pFFTDestQStatus)
int32_t Fftc_readBlockShiftStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_ScalingShiftingStatusReg *pFFTShiftStatus)
int32_t Fftc_readBlockCyclicPrefixStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_CyclicPrefixStatusReg *pFFTCyclicStatus)
int32_t Fftc_readBlockControlStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_ControlStatusReg *pFFTControlStatus)
int32_t Fftc_readBlockFreqShiftStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_FreqShiftStatusReg *pFFTFreqShiftStatus)
int32_t Fftc_readBlockPktSizeStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_PktSizeStatusReg *pFFTPktSizeStatus)
int32_t Fftc_readBlockTagStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_TagStatusReg *pFFTTagStatus)
int32_t Fftc_readErrorIntRawStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_clearErrorIntRawStatusReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_writeErrorIntEnableSetReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_readErrorIntEnableSetReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_clearErrorIntEnableReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_writeHaltOnErrorReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_readHaltOnErrorReg (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_ErrorParams *pErrorCfg)
int32_t Fftc_writeQueueConfigRegs (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_QLocalCfg *pFFTLocalCfg)
int32_t Fftc_readQueueConfigRegs (Fftc_LldObj *pFFTCLldObj, Fftc_QueueId qNum, Fftc_QLocalCfg *pFFTLocalCfg)
int32_t Fftc_writeDftSizeListGroupReg (Fftc_LldObj *pFFTCLldObj, uint16_t *pDftSizeList, uint32_t dftSizeListLen)
int32_t Fftc_readDftSizeListGroupReg (Fftc_LldObj *pFFTCLldObj, uint16_t *pDftSizeList)

Function Documentation

int32_t Fftc_clearErrorIntEnableReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_clearErrorIntEnableReg

brief
This API clears the various interrupt enable bits of FFTC Error Interrupt Enable and Set Register corresponding to the bit fields enabled in the input error params structure.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the interrupt error bits needs to be cleared.
[in]pErrorCfgInput error params structure that specifies which of the interrupt error bits need to be cleared.
Returns:
int32_t
  • -1 - Invalid input error params/instance handle passed.
  • 0 - Successfully cleared the interrupt enable bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input error params handle 'pErrorCfg' must be a valid pointer with all its bit field positions initialized to either 0/1 to indicate if the corresponding interrupt error bit must be cleared in the register.
Postcondition:

FFTC Error Interrupt Enable and Set Register contents cleared.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
        
        errorParams.bIsIntOnEOP        =   0;
        errorParams.bIsDebugHalt       =   1;
        errorParams.bIsConfigWordError =   1;
        errorParams.bIsDescBufferError =   1;
        errorParams.bIsEopError        =   0;
        errorParams.bIsConfigInvalError=   0;

        if (Fftc_clearErrorIntEnableReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error clearing FFTC error interrupt enable register.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // Error interrupt enable cleared successfully.
            ...
        }

        ...

============================================================================

int32_t Fftc_clearErrorIntRawStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_clearErrorIntRawStatusReg

brief
This API clears the various error status bits of FFTC Error Interrupt Raw Status and Set Register corresponding to the bit fields enabled in the input error params structure.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the error status bits needs to be cleared.
[in]pErrorCfgInput error params structure that specifies which of the error status bits need to be cleared.
Returns:
int32_t
  • -1 - Invalid input error params/instance handle passed.
  • 0 - Successfully cleared the status bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input error params structure handle passed must be a valid pointer with all its fields set up to 0/1 to indicate whether to clear the corresponding error bit in the register.
Postcondition:

FFTC Error Interrupt Raw Status and Set Register contents cleared as per input provided in 'pErrorCfg'.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
        
        errorParams.bIsIntOnEOP        =   0;
        errorParams.bIsDebugHalt       =   1;
        errorParams.bIsConfigWordError =   1;
        errorParams.bIsDescBufferError =   1;
        errorParams.bIsEopError        =   0;
        errorParams.bIsConfigInvalError=   0;

        if (Fftc_clearErrorIntRawStatusReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error clearing FFTC error status.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // Error Status cleared successfully.
            ...
        }

        ...

============================================================================

void Fftc_clearQueueClippingDetectReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum 
)

============================================================================
Fftc_clearQueueClippingDetectReg

brief
This API clears the contents (clipping count) of the FFTC Queue Clipping Detect Register for a given queue id.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue ID for which the clipping count must be reset.
Returns:
void
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input parameter 'qNum' must be a valid queue id between 0 and 3.
Postcondition:

FFTC Queue X Clipping Detect Register contents cleared.
    Fftc_LldObj                 fftcLldObj;
    ...

    if (Fftc_clearQueueClippingDetectReg (&fftcLldObj, 1) != 0)
    {
        // FFTC queue 1 clipping detect register clear failed.
    }
    else
    {
        // FFTC Queue 1 clipping detect register clear successful.
    }
    ...

============================================================================

int32_t Fftc_compileQueueLocalConfigParams ( Fftc_QLocalCfg pFFTLocalCfg,
uint8_t *  pData,
uint32_t *  pLen 
)

============================================================================
Fftc_compileQueueLocalConfigParams

brief
This API translates the FFTC queue specific local configuration provided by the driver/application in 'pFFTLocalCfg' parameter into a format understood by the FFTC engine and populates the output parameter 'pData' with it. The data obtained from this API with an appropriate control header can thus be used for sending queue configuration to FFTC engine through CPPI. This API assumes that the output parameter passed 'pData' has been allocated memory.

Parameters:
[in]pFFTLocalCfgInput local configuration structure with all necessary options set by the application/driver.
[out]pDataData buffer filled in as a result of successful translation of the queue configuration provided as input to this function.
[out]pLenData buffer length pointer that will be incremented by the number of bytes configured by this API. This parameter will be updated only if the API was successful.
Returns:
int32_t
  • -1 - Invalid/Insufficient local configuration provided.
  • 0 - Successfully compiled the local configuration parameters.
Precondition:

The Data buffer pointer 'pData' must have been allocated memory before passing to this API. Also 'pLen' pointer passed to this API must be a valid pointer.
Postcondition:

The output params structure pData is populated accordingly and pLen parameter is updated with the number of bytes of configuration data filled in by this API.
        Fftc_QLocalCfg          fftLocalCfg;
        uint8_t                 localCfgData[256];
        uint32_t                dataLen;

        ...

        // Setup the queue configuration parameters
        fftLocalCfg.destQRegConfig.cppiDestQNum     =   3;
        fftLocalCfg.destQRegConfig.bOutputFFTShift  =   0;
        ...
        fftLocalCfg.controlRegConfig.dftSize        =   512;
        fftLocalCfg.controlRegConfig.dftMode        =   Fftc_DFTMode_DFT;
        ...


        // Compile the configuration into FFT engine compatible 
        // format.
        if(Fftc_compileQueueLocalConfigParams (&fftLocalCfg, localCfgData, &dataLen) > 0)
        {
            // FFT local configuration compilation failed.
            // do error recovery.
            ...
        }
        else
        {
            // proceed formulating the FFTC control header in 
            // CPPI packet.
            ...
        }

============================================================================

int32_t Fftc_createControlHeader ( Fftc_ControlHdr pFFTCfgCtrlHdr,
uint8_t *  pData,
uint32_t *  pLen 
)

============================================================================
Fftc_createControlHeader

brief
This API compiles the FFTC Control Header as per the input configuration specified in 'pFFTCfgCtrlHdr' and stores it in the output parameter specified 'pData'. This API assumes that the output parameter passed 'pData' has been allocated memory before passing it to this API.

Parameters:
[in]pFFTCfgCtrlHdrFFTC control header configuration as specified by the application/driver that needs to be formatted for FFTC engine format.
[out]pDataData buffer to be filled in with the formatted FFTC control header.
[out]pLenData buffer length pointer that will be incremented by the number of bytes configured by this API. This parameter will be updated only if the API was successful.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully compiled the control header.
Precondition:

The data buffer pointer passed to this API 'pData' must have been allocated memory before passing to this API. 'pLen' should be a valid pointer.
Postcondition:

The output params structure 'pData' is populated accordingly and the number of bytes configured by this API is updated in the 'pLen' parameter.
        Fftc_ControlHdr             fftCfgCtrlHdr;
        uint8_t                     CtrlHdrData[256];
        uint32_t                    dataLen;

        ...

        // Setup the FFT control header configuration.
        fftCfgCtrlHdr.psFieldLen            =   4;
        fftCfgCtrlHdr.dftSizeListLen        =   5;
        fftCfgCtrlHdr.bPSPassThruPresent    =   1;
        fftCfgCtrlHdr.bDFTSizeListPresent   =   1;
        fftCfgCtrlHdr.bLocalConfigPresent   =   1;

        if (Fftc_createControlHeader(&fftCfgCtrlHdr, CtrlHdrData, &dataLen) != 0)
        {
            // Error returned by the API. Invalid Data Handle?
            // exit
        }
        else
        {
            //Proceed to putting together the rest of
            //the queue local configuration and pass
            //through data.
            ...
        }

============================================================================

int32_t Fftc_createDftSizeList ( uint16_t *  pDftSizeList,
uint32_t  dftSizeListLen,
uint8_t *  pData,
uint32_t *  pLen 
)

============================================================================
Fftc_createDftSizeList

brief
This API compiles the FFTC DFT size list specified by 'pDftSizeList' and 'dftSizeListLen' input parameters and stores it in the output parameter specified 'pData'. This API assumes that the output parameter passed 'pData' has been allocated memory before passing it to this API.

The DFT sizes passed to this API in 'pDftSizeList' are assumed to be valid values and are not validated by this API.

Parameters:
[in]pDftSizeListList of DFT block sizes that needs to be formatted to FFTC H/w format.
[in]dftSizeListLenNumber of DFT block sizes specified in 'pDftSizeList' input. The maximum number of FFT blocks supported by hardware is 128. The caller needs to ensure that this limit is not exceeded.
[out]pDataData buffer to be filled in with the formatted FFTC size list configuration.
[out]pLenData buffer length pointer that will be incremented by the number of bytes configured by this API. This parameter will be updated only if the API was successful.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully compiled the size list.
Precondition:

The data buffer pointer passed to this API 'pData' must have been allocated memory before passing to this API. 'pLen' should be a valid pointer. All DFT block sizes specified in'pDftSizeList' must be valid values. Please consult FFTC Users guide for legal values.
Postcondition:

The output params structure 'pData' is populated accordingly and the number of bytes configured by this API is updated in the 'pLen' parameter.
        uint16_t                      dftSizeList[32];
        uint32_t                      numDftBlocks, i;
        uint8_t                       fftRequestData[256];
        uint32_t                      dataLen;

        ...

        // Setup the DFT size list configuration.
        numDftBlocks = 32;
        for (i = 0; i < numDftBlocks; i ++)
            dftSizeList [i] = 0x80; // program the DFT block size in the same order as they
                                   // will appear in data.

        if (Fftc_createDftSizeList(dftSizeList, numDftBlocks, fftRequestData, &dataLen) != 0)
        {
            // Error returned by the API. Invalid Data Handle?
            // exit
        }
        else
        {
            //DFT size list compilation successful.
            ...
        }

============================================================================

void Fftc_doSoftwareContinue ( Fftc_LldObj *  pFFTCLldObj)

============================================================================
Fftc_doSoftwareContinue

brief
This API configures the FFTC Control Register to continue FFTC engine processing without resetting any state machines or configuration registers.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
Returns:

None.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API.
Postcondition:

FFTC Control Register's Continue bit set.
        Fftc_LldObj                 fftcLldObj;
        ...

        // Check if FFTC engine halted, if so resume it
        if (Fftc_isHalted(&fftcLldObj) == 1)
        {
            // Let FFTC continue its processing
            Fftc_doSoftwareContinue (&fftcLldObj);      
        }

        ...

============================================================================

void Fftc_doSoftwareReset ( Fftc_LldObj *  pFFTCLldObj)

============================================================================
Fftc_doSoftwareReset

brief
This API configures the FFTC Control Register to perform a software reset on the FFTC engine. The software reset resets the FFTC state machine and all FFTC configuration registers to initial values.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
Returns:

None.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API.
Postcondition:

FFTC Control Register's 'software reset' bit configured
        Fftc_LldObj                 fftcLldObj;

        ...

        // Issue a software reset to the FFTC engine
        Fftc_doSoftwareReset (&fftcLldObj);

        ...

============================================================================

int32_t Fftc_isHalted ( Fftc_LldObj *  pFFTCLldObj)

============================================================================
Fftc_isHalted

brief
This API reads the FFTC Status Register and returns 1 to indicate that the FFTC engine is halted on error or emulation and 0 otherwise.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
Returns:
int32_t
  • -1 - Invalid FFTC instance object
  • 0 - FFTC engine not halted
  • 1 - FFTC engine halted
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API.
Postcondition:

None.
        Fftc_LldObj                 fftcLldObj;
        ...

        // Check if FFTC engine halted, if so resume it
        if (Fftc_isHalted(&fftcLldObj) == 1)
        {
            // Let FFTC continue its processing
            Fftc_write_ctrlReg (&fftcLldObj, 1, 0);      
        }

        ...

============================================================================

int32_t Fftc_lldClose ( Fftc_LldObj *  pFFTCLldObj)

============================================================================
Fftc_lldClose

brief
This API resets the contents of the FFTC LLD Object handle passed to this function. The FFTC Object handle is no longer valid for use with any of the FFTC LLD MMR access APIs.

Parameters:
[out]pFFTCLldObjPointer to FFTC LLD Object structure that needs to be de-initialized.
Returns:
int32_t
  • -1 - Invalid LLD object handle provided.
  • 0 - Successfully de-initialized the LLD object provided.
Precondition:

The output FFTC LLD object structure 'pFFTCLldObj' passed must be a valid pointer.
Postcondition:

The FFTC LLD object pointer's contents are all de-initialized. This object pointer is no longer valid for use with any of the FFTC LLD MMR access APIs.
        Fftc_LldObj                 fftcLldObj;

        if (Fftc_lldClose (&fftcLldObj) != 0)
        {
            // Error closing FFTC LLD for CSL_FFTC_A instance
            ...
        }
        else
        {
            // Successfully closed FFTC LLD for instance A
            ...
        }

============================================================================

int32_t Fftc_lldOpen ( uint8_t  instNum,
void *  cfgRegs,
Fftc_LldObj *  pFFTCLldObj 
)

============================================================================
Fftc_lldOpen

brief
This API initializes the output param 'pFFTCLldObj' with the configuration register overlay address for the FFTC peripheral instance corresponding to the instance number passed in 'instNum' parameter. This API MUST be called to initialize the FFTC LLD object corresponding to a specific FFTC peripheral instance before any of the FFTC LLD APIs are invoked to configure that instance MMR.

Parameters:
[in]instNumFFTC peripheral instance number for which the LLD object needs to be initialized.
[in]cfgRegsConfiguration registers (MMR) base address for this FFTC instance.
[out]pFFTCLldObjPointer to FFTC LLD Object structure that needs to be initialized with the instance's configuration register overlay base address.
Returns:
int32_t
  • -1 - Invalid LLD object handle/ invalid instance number provided.
  • 0 - Successfully initialized the LLD object with the appropriate base address for the instance number provided.
Precondition:

The output FFTC LLD object structure 'pFFTCLldObj' passed must be a valid pointer.
Postcondition:

The FFTC LLD object pointer passed is populated with appropriate base address for the configuration registers for the corresponding instance number.
        Fftc_LldObj                 fftcLldObj;

        if (Fftc_lldOpen (CSL_FFTC_A, 0x021F0000, &fftcLldObj) != 0)
        {
            // Error opening FFTC LLD for CSL_FFTC_A instance
            ...
        }
        else
        {
            // Successfully opened FFTC LLD for instance A
            ...
        }

============================================================================

int32_t Fftc_mapDFTSizeToIndex ( uint32_t  dftBlockSize)

============================================================================
Fftc_mapDFTSizeToIndex

brief
This API takes DFT block size as input and returns the corresponding index into the DFT table.

Parameters:
[in]dftBlockSizeThe DFT/IDFT block size in bytes that needs to be translated into a DFT block size table index. Please consult the FFTC User Guide for all valid block size values recognized by the FFTC Engine.
Returns:
int32_t
  • -1 - Invalid DFT size specified
  • >=0 - A valid index (ranging between 0 and 49) into the DFT size table for the size specified.
Precondition:

None.
Postcondition:

None.
        int32_t     dftIndex;

        if ((dftIndex = Fftc_mapDFTSizeToIndex (512)) != -1)
        {
            // Proceed with FFTC configuration.
            ...
        }
        else
        {
            // DFT block size specified not a legal
            // value. error.
        }          

============================================================================

int32_t Fftc_modifyLocalCfgPresentControlHeader ( int32_t  bLocalConfigPresent,
uint8_t *  pData 
)

============================================================================
Fftc_modifyLocalCfgPresentControlHeader

brief
This API modifies a pre-compiled FFTC Control header obtained from Fftc_createControlHeader() API, to just toggle the "Local Configuration Data Present" bit. It leaves the rest of the header unchanged. This API assumes that the output parameter passed 'pData' has been allocated memory and properly setup using Fftc_createControlHeader() API before.

Parameters:
[in]bLocalConfigPresentuint8_tean flag, when set to 1 indicates that a local configuration follows the control header.
[in,out]pDataControl Header buffer to be modified with the local config bit.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully compiled the control header.
Precondition:

The data buffer passed to this API 'pData' must be initialized using Fftc_createControlHeader() before calling this API to modify the local configuration bit.
Postcondition:

The output params structure 'pData' is populated accordingly.
        Fftc_ControlHdr             fftCfgCtrlHdr;
        uint8_t                     CtrlHdrData[256];

        ...

        // Setup the FFT control header configuration.
        fftCfgCtrlHdr.psFieldLen            =   4;
        fftCfgCtrlHdr.dftSizeListLen        =   5;
        fftCfgCtrlHdr.bPSPassThruPresent    =   1;
        fftCfgCtrlHdr.bDFTSizeListPresent   =   1;
        fftCfgCtrlHdr.bLocalConfigPresent   =   1;

        if (Fftc_createControlHeader(&fftCfgCtrlHdr, CtrlHdrData) != 0)
        {
            // Error returned by the API. Invalid Data Handle?
            // exit
        }
        else
        {
            //Proceed to putting together the rest of
            //the queue local configuration and pass
            //through data.
            ...
        }

        if (Fftc_modifyLocalCfgPresentControlHeader (0, CtrlHdrData) != 0)
        {
            //Error. Invalid Control header data pointer??
            //exit
        }
        else
        {
            //Configuration successful. Proceed to next step.
        }

============================================================================

int32_t Fftc_readBlockControlStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_ControlStatusReg pFFTControlStatus 
)

============================================================================
Fftc_readBlockControlStatusReg

brief
This API reads the FFTC Block X Control Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTControlStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTControlStatusOutput parameter handle that will be filled in with all the blocks control status register.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTControlStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTControlStatus' must be a valid pointer and must have been allocated space enough to hold the control status for all the three blocks/buffers.
Postcondition:

'pFFTControlStatus' is populated with the FFTC Block X Control Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ControlStatusReg           controlStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the control status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockControlStatusReg (&fftcLldObj, controlStatus) != 0)
        {
            // FFTC control status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockCyclicPrefixStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_CyclicPrefixStatusReg pFFTCyclicStatus 
)

============================================================================
Fftc_readBlockCyclicPrefixStatusReg

brief
This API reads the FFTC Block X Cyclic Prefix Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTCyclicStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTCyclicStatusOutput parameter handle that will be filled in with all the blocks cyclic prefix status register.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTCyclicStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTCyclicStatus' must be a valid pointer and must have been allocated space enough to hold the cyclic prefix status for all the three blocks/buffers.
Postcondition:

'pFFTCyclicStatus' is populated with the FFTC Block X Cyclic Prefix Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_CyclicPrefixStatusReg      cyclicStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the cyclic prefix status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockCyclicPrefixStatusReg (&fftcLldObj, cyclicStatus) != 0)
        {
            // FFTC cyclic prefix status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockDestQStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_DestQStatusReg pFFTDestQStatus 
)

============================================================================
Fftc_readBlockDestQStatusReg

brief
This API reads the FFTC Block X Destination Queue Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTDestQStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTDestQStatusOutput parameter handle that will be filled in with all the blocks destination queue register status.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTDestQStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTDestQStatus' must be a valid pointer and must have been allocated space enough to hold the destination queue status for all the three blocks/buffers.
Postcondition:

'pFFTDestQStatus' is populated with the FFTC Block X Destination Queue Status Register contents for all three blocks/buffers.
      Fftc_LldObj             fftcLldObj;
        Fftc_DestQStatusReg     destQStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the destination queue status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockDestQStatusReg (&fftcLldObj, destQStatus) != 0)
        {
            // FFT destination queue status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockFreqShiftStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_FreqShiftStatusReg pFFTFreqShiftStatus 
)

============================================================================
Fftc_readBlockFreqShiftStatusReg

brief
This API reads the FFTC Block X LTE Frequency Shift Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTFreqShiftStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTFreqShiftStatusOutput parameter handle that will be filled in with all the blocks frequency shift status register contents.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTFreqShiftStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTFreqShiftStatus' must be a valid pointer and must have been allocated space enough to hold the frequency shift status for all the three blocks/buffers.
Postcondition:

'pFFTFreqShiftStatus' is populated with the FFTC Block X LTE Frequency Shift Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_FreqShiftStatusReg         freqShiftStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the frequency shift status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockFreqShiftStatusReg (&fftcLldObj, freqShiftStatus) != 0)
        {
            // FFTC LTE Frequency shift status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockPktSizeStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_PktSizeStatusReg pFFTPktSizeStatus 
)

============================================================================
Fftc_readBlockPktSizeStatusReg

brief
This API reads the FFTC Block X Packet Size Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTPktSizeStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTPktSizeStatusOutput parameter handle that will be filled in with all the blocks packet size status register contents.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTPktSizeStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTPktSizeStatus' must be a valid pointer and must have been allocated space enough to hold the packet size status for all the three blocks/buffers.
Postcondition:

'pFFTPktSizeStatus' is populated with the FFTC Block X Packet Size Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_PktSizeStatusReg           pktSizeStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the packet size status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockPktSizeStatusReg (&fftcLldObj, pktSizeStatus) != 0)
        {
            // FFTC packet size status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockShiftStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_ScalingShiftingStatusReg pFFTShiftStatus 
)

============================================================================
Fftc_readBlockShiftStatusReg

brief
This API reads the FFTC Block X Scaling & Shifting Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTShiftStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTShiftStatusOutput parameter handle that will be filled in with all the blocks scaling and shifting register status.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTShiftStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTShiftStatus' must be a valid pointer and must have been allocated space enough to hold the scaling & shifting status for all the three blocks/buffers.
Postcondition:

'pFFTShiftStatus' is populated with the FFTC Block X Scaling and Shifting Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ScalingShiftingStatusReg   shiftStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the scaling and shifting status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockShiftStatusReg (&fftcLldObj, shiftStatus) != 0)
        {
            // FFTC scaling and shifting status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readBlockTagStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_TagStatusReg pFFTTagStatus 
)

============================================================================
Fftc_readBlockTagStatusReg

brief
This API reads the FFTC Block X Tag Status Register for the last three blocks processed by FFT engine and returns the retrieved status in the output parameter passed 'pFFTTagStatus'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTTagStatusOutput parameter handle that will be filled in with all the blocks tag status register contents.
Returns:
int32_t
  • -1 - Invalid input parameters.
  • 0 - Successfully populated 'pFFTTagStatus' with block status.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pFFTTagStatus' must be a valid pointer and must have been allocated space enough to hold the tag status for all the three blocks/buffers.
Postcondition:

'pFFTTagStatus' is populated with the FFTC Block X Tag Status register contents for all three buffers.
      Fftc_LldObj                     fftcLldObj;
        Fftc_TagStatusReg               tagStatus[FFTC_NUM_INTERNAL_BUFFERS];

        ...

        // Retrieve the tag status register for all the
        // three blocks/buffers.
        if(Fftc_readBlockTagStatusReg (&fftcLldObj, tagStatus) != 0)
        {
            // FFTC tag status read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_readDftSizeListGroupReg ( Fftc_LldObj *  pFFTCLldObj,
uint16_t *  pDftSizeList 
)

============================================================================
Fftc_readDftSizeListGroupReg

brief
This API reads all of the 26 DFT Size List Group Registers and returns the contents of these registers to the caller in the output parameter 'pDftSizeList'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pDftSizeListList of DFT block sizes read from the FFTC engine H/w.
Returns:
int32_t
  • -1 - Invalid input configuration/handles provided.
  • 0 - Successfully read the DFT size list to the output parameter 'pDftSizeList'.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The application must have allocated enough space for 'pDftSizeList' output parameter to hold all the 128 DFT block sizes from the hardware. Each DFT block size needs 16 bits to represent it and there can be at most 128 block sizes, so the output parameter should have been reserved space for 2 bytes (16 bits) * 128.
Postcondition:

The output parameter 'pDftSizeList' is populated with contents of DFT Size List Group Registers.
      Fftc_LldObj                 fftcLldObj;  
        uint16_t                    dftSizeList[128];

        ...

        // Read the DFT size list configuration.
        if (Fftc_readDftSizeListGroupReg(&fftcLldObj, dftSizeList) != 0)
        {
            // Error returned by the API. 
            // exit
        }
        else
        {
            //DFT size list read successful.
            ...
        }

============================================================================

int32_t Fftc_readEmulationControlReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_EmulationControlParams pEmulationCfg 
)

============================================================================
Fftc_readEmulationControlReg

brief
This API reads the FFTC Emulation Control Register and populates the output parameter 'pEmulationCfg' with its contents.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pEmulationCfgOutput parameter handle that needs to be filled with the emulation settings from FFTC engine.
Returns:
int32_t
  • -1 - Invalid input handle.
  • 0 - Successfully populated the output param handle.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output param handle passed 'pEmulationCfg' must be a valid pointer.
Postcondition:

None.
        Fftc_LldObj                 fftcLldObj;
        Fftc_EmulationControlParams emulCfg;

        if (Fftc_readEmulationControlReg (&fftcLldObj, &emulCfg) != 0)
        {
            // Invalid emulation config handle passed ??
            ...
        }
        else
        {
            // Continue processing.
            ...
        }

============================================================================

int32_t Fftc_readEoiReg ( Fftc_LldObj *  pFFTCLldObj)

============================================================================
Fftc_readEoiReg

brief
This API reads the contents of FFTC End of Interrupt (EOI) Register and returns its contents to the caller.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
Returns:
int32_t
  • -1 - Invalid input handle.
  • >=0 - EOI value read from the FFTC End of Interrupt Register.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API.
Postcondition:

None.
    Fftc_LldObj                 fftcLldObj;

    ...

    Fftc_readEoiReg (&fftcLldObj);

    ...

============================================================================

int32_t Fftc_readErrorIntEnableSetReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_readErrorIntEnableSetReg

brief
This API reads the FFTC Error and Interrupt Enable and Set register and populates its contents into the output error configuration structure.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the interrupt error configuration bits needs to be read.
[out]pErrorCfgOutput error params structure that will need to be filled with the register contents.
Returns:
int32_t
  • -1 - Invalid output error params/instance handle passed.
  • 0 - Successfully read the interrupt enable bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. Output param handle 'pErrorCfg' must be a valid pointer and must have been allocated memory before passing to this API.
Postcondition:

FFTC Error Interrupt Enable and Set Register read and its values populated into the 'pErroCfg' output param structure.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
       
        // Read the error configuration for queue 0 
        if (Fftc_readErrorIntEnableSetReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error reading FFTC error interrupt enable set register for queue 0.
            // Check the output handle we passed.
            ...
        }
        else
        {  
            // Error Interrupt enable register contents successfully
            // populated in 'errorParams'
            ...
        }

        ...

============================================================================

int32_t Fftc_readErrorIntRawStatusReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_readErrorIntRawStatusReg

brief
This API reads the FFTC Error Interrupt Raw Status and Set Register contents to retrieve a snapshot of all the errors that have been encountered by the FFTC engine irrespective of whether the corresponding interrupt is enabled.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the error interrupt status needs to be retrieved.
[out]pErrorCfgOutput error params structure that will be filled in by this API with the various errors raw status.
Returns:
int32_t
  • -1 - Invalid output param handle passed / invalid instance handle passed.
  • 0 - Success.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output error params structure handle 'pErrorCfg' passed must be a valid pointer.
Postcondition:

None
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorStatus;
        
        ...

        if (Fftc_readErrorIntRawStatusReg (&fftcLldObj, 0, &errorStatus) != 0)
        {
            // Error retrieving FFTC error status.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // Error Status retrieved successfully.
            ...
        }

        ...

============================================================================

int32_t Fftc_readGlobalConfigReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_GlobalCfg pFFTGlobalCfg 
)

============================================================================
Fftc_readGlobalConfigReg

brief
This API loads the contents of FFTC Configuration Register in the output parameter structure handle passed 'pFFTGlobalCfg'. This API assumes that 'pFFTGlobalCfg' is a valid pointer.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pFFTGlobalCfgHandle to FFTC Global configuration structure that needs to be filled in with contents of the FFTC Global Configuration register.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully loaded the register contents into the output param structure.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output Global configuration structure 'pFFTGlobalCfg' passed must be a valid pointer.
Postcondition:

Contents of FFTC Global Configuration register are loaded into 'pFFTGlobalCfg'.
        Fftc_LldObj      fftcLldObj;
        Fftc_GlobalCfg   fftcGlobalCfg;

        if (Fftc_readGlobalConfigReg (&fftcLldObj, &fftcGlobalCfg) != 0)
        {
            // Error reading FFTC Configuration register.
            ...
        }
        else
        {
            // Successfully read FFTC global configuration register.
            ...
        }

============================================================================

int32_t Fftc_readHaltOnErrorReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_readHaltOnErrorReg

brief
This API reads the Halt bit for the various FFTC errors from the FFTC Halt On Error Register. The Halt bit indicates if the FFTC engine should halt when the corresponding error in FFTC Error Interrupt Enables Status register is encountered.

Note: The 'bIsDebugHalt' bit value of the output error params structure is always set to 1, since a Debug Halt always generates a halt whether or not enabled here.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the interrupt halt bit needs to be read.
[out]pErrorCfgOutput error params structure with contents of the FFTC Halt on error register.
Returns:
int32_t
  • -1 - Invalid output error params/instance handle passed.
  • 0 - Successfully read the interrupt halt bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. Output param handle 'pErrorCfg' must be a valid pointer and must have been allocated memory before passing to this API.
Postcondition:

FFTC Halt on Error Register contents populated into 'pErroCfg' output params structure.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
       
        // read Halt on Error register configuration for queue 0
        if (Fftc_readHaltOnErrorReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error reading FFTC halt on error register.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // halt on error read successful.
            ...
        }

        ...

============================================================================

int32_t Fftc_readPidReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_PeripheralIdParams pPIDCfg 
)

============================================================================
Fftc_readPidReg

brief
This API loads the contents of FFTC PID Register in the output parameter structure passed 'pPIDCfg'. This API assumes that 'pPIDCfg' is a valid pointer.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[out]pPIDCfgHandle to FFTC PID configuration structure that needs to be filled in with contents of the PID register.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully loaded the register contents into the output param structure.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output PID configuration structure 'pPIDCfg' passed must be a valid pointer.
Postcondition:

Contents of FFTC PID register are loaded into 'pPIDCfg'.
        Fftc_LldObj                 fftcLldObj;
        Fftc_PeripheralIdParams     pidCfg;

        if (Fftc_readPidReg (&fftcLldObj, &pidCfg) != 0)
        {
            // Error reading PID register.
            ...
        }
        else
        {
            // Successfully read PID Register contents
            ...
        }

============================================================================

int32_t Fftc_readQueueClippingDetectReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum 
)

============================================================================
Fftc_readQueueClippingDetectReg

brief
This API reads the contents of FFTC Queue x Clipping Detect Register and returns its contents, the clipping counter to the caller.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue ID for which the clipping count must be read.
Returns:
int32_t -1 - Invalid FFTC LLD instance object handle.
  • >0 - Clipping count on success, i.e., the number of FFT blocks where one or more clipping events were detected for the queue id specified.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input parameter 'qNum' must be a valid queue id between 0 and 3.
Postcondition:

None.
    Fftc_LldObj                 fftcLldObj;
    uint32_t                    clipping_count;
    ...

    if ((clipping_count = Fftc_readQueueClippingDetectReg (&fftcLldObj, 1)) == -1)
    {
        // queue 1 clipping detect register read failed.
    }
    else
    {
        // retrieved clipping count successfully.
    }
    ...

============================================================================

int32_t Fftc_readQueueConfigRegs ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_QLocalCfg pFFTLocalCfg 
)

============================================================================
Fftc_readQueueConfigRegs

brief
This API reads the FFTC Queue Specific Registers :- Queue x Destination queue Register, Queue x Scaling and Shifting Register, Queue x Cyclic Prefix Register, Queue x Control Register and Queue x LTE Frequency Shift Register for a given queue id 'qNum' and fills in the retrieved configuration in the output parameter passed 'pFFTLocalCfg'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumSpecifies which of the 4 FFTC queues (0-3) MMRs to read
[out]pFFTLocalCfgOutput parameter handle that will be filled in with the queue local configuration snapshot read from the MMRs for the specified FFTC queue.
Returns:
int32_t
  • -1 - Invalid output parameter handle 'pFFTLocalCfg'/ invalid FFTC LLD object instance handle.
  • 0 - Successfully populated 'pFFTLocalCfg' with a snapshot of queue local MMR config.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The output queue local configuration param handle passed must be a valid pointer.
Postcondition:

'pFFTLocalCfg' is populated with the configuration from the following queue local configuration registers: Queue x Destination queue Register, Queue x Scaling and Shifting Register, Queue x Cyclic Prefix Register, Queue x Control Register and Queue x LTE Frequency Shift Register.
      Fftc_LldObj                 fftcLldObj;
        Fftc_QLocalCfg              qCfg;

        ...

        // Retrieve the queue 0 MMRs configuration.
        if(Fftc_readQueueConfigRegs (&fftcLldObj, 0, &qCfg) != 0)
        {
            // FFT queue 0 configuration read failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================

int32_t Fftc_recompileQueueLocalCyclicPrefixParams ( int32_t  cyclicPrefixLen,
uint8_t *  pData 
)

============================================================================
Fftc_recompileQueueLocalCyclicPrefixParams

brief
This API just configures 'cyclic_prefix_addition' bits in the Queue x Cyclic Prefix Register assuming that everything else in the input local configuration parameters has not changed. This API assumes that the input configuration parameters pointer passed to this API 'pData' has been compiled fully at least once before using the API Fftc_compileQueueLocalConfigParams().

Parameters:
[in]cyclicPrefixLenNumber of samples of cyclic prefix to add.
[in,out]pDataData buffer that needs to be modified with the cyclic prefix parameter provided.
Returns:
int32_t
  • -1 - Invalid/Insufficient local configuration provided.
  • 0 - Successfully configured the data buffer.
Precondition:

Fftc_compileQueueLocalConfigParams() API must have been called at least once to initialize the 'pData' with complete local configuration.
Postcondition:

The output params buffer 'pData' is populated accordingly.
        Fftc_QLocalCfg          fftLocalCfg;
        uint8_t                 localCfgData[256];

        ...

        // Setup the queue configuration parameters
        fftLocalCfg.destQRegConfig.cppiDestQNum     =   3;
        fftLocalCfg.destQRegConfig.bOutputFFTShift  =   0;
        ...
        fftLocalCfg.controlRegConfig.dftSize        =   512;
        fftLocalCfg.controlRegConfig.dftMode        =   Fftc_DFTMode_DFT;
        ...


        // Compile the configuration into FFT engine compatible 
        // format.
        if(Fftc_compileQueueLocalConfigParams (&fftLocalCfg, localCfgData) > 0)
        {
            // FFT local configuration compilation failed.
            // do error recovery.
            ...
        }
        else
        {
            // proceed formulating the FFTC control header in 
            // CPPI packet.
            ...
        }

        Fftc_recompileQueueLocalCyclicPrefixParams (32,  localCfgData);

============================================================================

int32_t Fftc_recompileQueueLocalDFTParams ( int32_t  dftSize,
Fftc_DFTMode  dftMode,
uint8_t *  pData 
)

============================================================================
Fftc_recompileQueueLocalDFTParams

brief
This API just configures 'DFT_IDFTelect' and 'DFTize' bits in the Queue x Control Register assuming that everything else in the input local configuration parameters has not changed. This API assumes that the input configuration parameters pointer passed to this API 'pData' has been compiled fully at least once before using the API Fftc_compileQueueLocalConfigParams().

Parameters:
[in]dftSizeDFT block size in bytes to be configured
[in]dftModeIndicates whether DFT/IDFT transformation must be performed. 0 indicates IDFT, 1 for DFT.
[in,out]pDataData buffer to be filled in with the DFT parameters provided.
Returns:
int32_t
  • -1 - Invalid/Insufficient local configuration provided.
  • 0 - Successfully configured.
Precondition:

Fftc_compileQueueLocalConfigParams() API must have been called before to populate the 'pData' with complete local configuration.
Postcondition:

The output params buffer 'pData' is populated accordingly.
        Fftc_QLocalCfg          fftLocalCfg;
        uint8_t                 localCfgData[256];

        ...

        // Setup the queue configuration parameters
        fftLocalCfg.destQRegConfig.cppiDestQNum =   3;
        fftLocalCfg.destQRegConfig.bOutputFFTShift    = 0;
        ...
        fftLocalCfg.controlRegConfig.dftSize          =   512;
        fftLocalCfg.controlRegConfig.dftMode          =   Fftc_DFTMode_IDFT;
        ...


        // Compile the configuration into FFT engine compatible 
        // format.
        if(Fftc_compileQueueLocalConfigParams (&fftLocalCfg, localCfgData) > 0)
        {
            // FFT local configuration compilation failed.
            // do error recovery.
            ...
        }
        else
        {
            // proceed formulating the FFTC control header in 
            // CPPI packet.
            ...
        }

        Fftc_recompileQueueLocalDFTParams (6144, Fftc_DFTMode_DFT,  localCfgData);

============================================================================

int32_t Fftc_writeDftSizeListGroupReg ( Fftc_LldObj *  pFFTCLldObj,
uint16_t *  pDftSizeList,
uint32_t  dftSizeListLen 
)

============================================================================
Fftc_writeDftSizeListGroupReg

brief
This API compiles the FFTC DFT size list specified by 'pDftSizeList' and 'dftSizeListLen' input parameters and writes the DFT Size List Group Registers accordingly.

This API doesnt validate the DFT block sizes specified in 'pDftSizeList' input parameter.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]pDftSizeListList of DFT block sizes that needs to be programmed to FFTC engine.
[in]dftSizeListLenNumber of DFT block sizes specified in 'pDftSizeList' input. The maximum number of FFT blocks supported by hardware is 128. The caller needs to ensure that this limit is not exceeded.
Returns:
int32_t
  • -1 - Invalid configuration/handles provided.
  • 0 - Successfully wrote the DFT size list to the register.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The DFT block sizes passed in 'pDftSizeList' should be all legal values as per the FFTC user guide.
Postcondition:

The DFT Size List Group Registers are programmed according to input passed.
      Fftc_LldObj         fftcLldObj;
        uint16_t            dftSizeList[32];
        uint32_t            numDftBlocks, i;

        ...

        // Setup the DFT size list configuration.
        numDftBlocks = 32;
        for (i = 0; i < numDftBlocks; i ++)
            dftSizeList [i] = xxx; // program the DFT block size in the same order as they
                                   // will appear in data.

        if (Fftc_writeDftSizeListGroupReg(&fftcLldObj, dftSizeList, numDftBlocks) != 0)
        {
            // Error returned by the API. 
            // exit
        }
        else
        {
            //DFT size list configuration successful.
            ...
        }

============================================================================

int32_t Fftc_writeEmulationControlReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_EmulationControlParams pEmulationCfg 
)

============================================================================
Fftc_writeEmulationControlReg

brief
This API configures the FFTC Emulation Control Register as per the input specified in 'pEmulationCfg' input parameter.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]pEmulationCfgInput parameter handle that holds the emulation settings for FFTC engine.
Returns:
int32_t
  • -1 - Invalid input handle.
  • 0 - Successfully configured the register.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input configuration structure handle passed, 'pEmulationCfg' must be a valid pointer and is assumed to contain valid values as defined in the FFTC User Guide.
Postcondition:

FFTC Emulation Control Register configured.
        Fftc_LldObj                 fftcLldObj;
        Fftc_EmulationControlParams emulCfg;

        emulCfg.bEmuRtSel       =   0x0;
        emulCfg.bEmuSoftStop    =   0x1;
        emulCfg.bEmuFreeRun     =   0x0;

        if (Fftc_writeEmulationControlReg (&fftcLldObj, &emulCfg) != 0)
        {
            // Invalid emulation config handle passed ??
            ...
        }
        else
        {
            // Continue processing.
            ...
        }

============================================================================

int32_t Fftc_writeEoiReg ( Fftc_LldObj *  pFFTCLldObj,
int32_t  eoiVal 
)

============================================================================
Fftc_writeEoiReg

brief
This API configures the FFTC EOI Register as per the EOI Value provided as input to acknowledge an interrupt.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]eoiValEOI value to appropriately acknowledge an FFTC interrupt received by the application.
Returns:
int32_t
  • -1 - Invalid input handle.
  • 0 - Successfully wrote EOI.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API.
Postcondition:

FFTC EOI Register configured.
    Fftc_LldObj                 fftcLldObj;
    ...

    Fftc_writeEoiReg (&fftcLldObj, 1);

    ...

============================================================================

int32_t Fftc_writeErrorIntEnableSetReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_writeErrorIntEnableSetReg

brief
This API sets up the interrupt enable status bits for the various FFTC errors corresponding to the bit fields enabled in the input error configuration structure.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the interrupt error status bits needs to be set.
[in]pErrorCfgInput error params structure that specifies the error status bits for which the interrupt needs to be enabled.
Returns:
int32_t
  • -1 - Invalid input error params/instance handle passed.
  • 0 - Successfully setup the interrupt status bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. Input param handle 'pErrorCfg' must be a valid pointer with all fields configured to either 0/1 to indicate which of the error bits need to be setup for interrupts in the register.
Postcondition:

FFTC Error Interrupt Enable and Set Register configured.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
        
        errorParams.bIsIntOnEOP        =   0;
        errorParams.bIsDebugHalt       =   1;
        errorParams.bIsConfigWordError =   1;
        errorParams.bIsDescBufferError =   1;
        errorParams.bIsEopError        =   0;
        errorParams.bIsConfigInvalError=   0;

        if (Fftc_writeErrorIntEnableSetReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error setting up FFTC error interrupt enable status.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // Error Interrupt Status setup successfully.
            ...
        }

        ...

============================================================================

int32_t Fftc_writeGlobalConfigReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_GlobalCfg pFFTGlobalCfg 
)

============================================================================
Fftc_writeGlobalConfigReg

brief
This API configures the FFTC Configuration Register with the configuration passed in 'pFFTGlobalCfg' input parameter.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]pFFTGlobalCfgHandle to input FFTC Global configuration parameters.
Returns:
int32_t
  • -1 - Invalid configuration handle provided.
  • 0 - Successfully configured the register.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input configuration structure handle passed, 'pFFTGlobalCfg' must be a valid pointer and must contain valid values as specified in the FFTC User Guide.
Postcondition:

FFTC Configuration Register configured.
        Fftc_LldObj      fftcLldObj;
        Fftc_GlobalCfg   globalCfg;

        // setup the global configuration params
        globalCfg.starvationPeriod      =   0x10;
        globalCfg.queue3Priority        =   0x03;
        globalCfg.queue2Priority        =   0x03;
        globalCfg.queue1Priority        =   0x03;
        globalCfg.queue0Priority        =   0x00;
        globalCfg.bDisableFFT           =   0x00;

        if (Fftc_writeGlobalConfigReg (&fftcLldObj, &globalCfg) != 0)
        {
            // Error configuring Global Cfg register.
            ...
        }
        else
        {
            // Successfully configured the register
            ...
        }

============================================================================

int32_t Fftc_writeHaltOnErrorReg ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_ErrorParams pErrorCfg 
)

============================================================================
Fftc_writeHaltOnErrorReg

brief
This API sets up the Halt bit for the various FFTC errors corresponding to the bit fields enabled in the input error configuration structure. The Halt bit indicates if the FFTC engine should halt when the corresponding error in FFTC Error Interrupt Enables Status register is encountered.

Note: The 'bIsDebugHalt' bit value of the input error params structure is ignored and is always set to 1 in the FFTC Halt on error register, since a Debug Halt always generates a halt whether or not enabled here.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumFFTC Queue Number (0-3) for which the interrupt halt bit needs to be set.
[in]pErrorCfgInput error params structure that specifies the error status bits for which the fftc halt needs to be enabled.
Returns:
int32_t
  • -1 - Invalid input error params/instance handle passed.
  • 0 - Successfully setup the interrupt halt bits.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. Input param handle pErrorCfg must be a valid pointer with all fields configured to either 0/1 to indicate which of the error bits need to be setup for fftc halts in the register.
Postcondition:

FFTC Halt on Error Register configured.
      Fftc_LldObj                     fftcLldObj;
        Fftc_ErrorParams                errorParams;
        
        errorParams.bIsIntOnEOP        =   0;
        errorParams.bIsConfigWordError =   1;
        errorParams.bIsDescBufferError =   1;
        errorParams.bIsEopError        =   0;
        errorParams.bIsConfigInvalError=   0;

        if (Fftc_writeHaltOnErrorReg (&fftcLldObj, 0, &errorParams) != 0)
        {
            // Error setting up FFTC halt on error register.
            // Check the input handle we passed.
            ...
        }
        else
        {  
            // halt on error setup successful.
            ...
        }

        ...

============================================================================

int32_t Fftc_writeQueueConfigRegs ( Fftc_LldObj *  pFFTCLldObj,
Fftc_QueueId  qNum,
Fftc_QLocalCfg pFFTLocalCfg 
)

============================================================================
Fftc_writeQueueConfigRegs

brief
This API configures the FFTC Queue Specific Registers :- Queue x Destination queue Register, Queue x Scaling and Shifting Register, Queue x Cyclic Prefix Register, Queue x Control Register and Queue x LTE Frequency Shift Register for any given queue id 'qNum' using the input specified by 'pFFTLocalCfg'.

Parameters:
[in]pFFTCLldObjFFTC LLD instance object.
[in]qNumSpecifies which of the 4 FFTC queues (0-3) MMRs to configure
[in]pFFTLocalCfgInput parameter handle that holds the local configuration settings for the specific queue processing.
Returns:
int32_t
  • -1 - Invalid input handle.
  • 0 - Successfully configured the registers.
Precondition:

Fftc_lldOpen () must be called to obtain the register overlay handle for FFTC instance before calling this API. The input queue local configuration param handle passed must be a valid pointer and should contain valid values as defined by the FFTC User Guide.
Postcondition:

Queue x Destination queue Register, Queue x Scaling and Shifting Register, Queue x Cyclic Prefix Register, Queue x Control Register and Queue x LTE Frequency Shift Register configured.
        Fftc_LldObj                 fftcLldObj;
        Fftc_QLocalCfg              fftLocalCfg;

        ...

        // Setup the queue configuration parameters
        fftLocalCfg.destQRegConfig.cppiDestQNum     =   3;
        fftLocalCfg.destQRegConfig.bOutputFFTShift  =   0;
        ...
        fftLocalCfg.controlRegConfig.dftSize        =   512;
        fftLocalCfg.controlRegConfig.dftMode        =   Fftc_DFTMode_DFT;
        ...

        // Configure the queue 0 MMRs.
        if(Fftc_writeQueueConfigRegs (&fftcLldObj, 0, &fftLocalCfg) != 0)
        {
            // FFT queue 0 configuration failed.
            // do error recovery.
            ...
        }
        else
        {
            // Continue Processing
            ...
        }

============================================================================


Copyright 2014, Texas Instruments Incorporated