MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Group_pdm_pcm_functions

General Description

Typedefs

typedef void(* CY_PDM_PCM_IRQ_THREAD_CB_t )(uint8_t *pFifoCntx)
 PDMPCM - FIFO Interrupt Callback from IRQ Thread.
 

Functions

cy_en_pdm_pcm_status_t Cy_PDM_PCM_Init (CyPdmPcm_Type *base, cy_stc_pdm_pcm_config_t const *config)
 Configures PDM PCM block as per PDM and PCM sampling rate. More...
 
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Enable (CyPdmPcm_Type *base)
 Enables the PDM-PCM data conversion. More...
 
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Disable (CyPdmPcm_Type *base)
 Disables the PDM-PCM data conversion. More...
 
cy_en_pdm_pcm_status_t Cy_PDM_PCM_SetFifoLevel (uint8_t wmLevel)
 Sets FIFO water mark level.Registered callback get called once FIFO reached to water mark level. More...
 
uint8_t Cy_PDM_PCM_GetFifoLevel (void)
 Returns depth of FIFO. More...
 
void Cy_PDM_PCM_FreezeFifo (void)
 Freezes the RX FIFO. More...
 
void Cy_PDM_PCM_UnfreezeFifo (void)
 Unfreezes the RX FIFO. More...
 
void Cy_PDM_PCM_ClearFifo (void)
 Resets the output data FIFO, removing all data words from the FIFO. More...
 
cy_en_pdm_pcm_status_t Cy_PDM_PCM_ReadFifoAll (uint32_t *pData, uint8_t *pDatalen, uint8_t *pFifoCntx)
 Reads whole the FIFO payload into the data array. More...
 
void Cy_PDM_PCM_DeInit (CyPdmPcm_Type *base)
 De initializes PDMPCM block. More...
 
cy_en_pdm_pcm_status_t Cy_PDM_PCM_RegisterCallback (CY_PDM_PCM_IRQ_THREAD_CB_t pCb)
 

Function Documentation

cy_en_pdm_pcm_status_t Cy_PDM_PCM_Init ( CyPdmPcm_Type *  base,
cy_stc_pdm_pcm_config_t const *  config 
)

Configures PDM PCM block as per PDM and PCM sampling rate.

Programms filter coeffients, if NULL default values programmed. controls latching of PDM data based on interface selection. if NULL, default configuration used.

Parameters
baseThe pointer to the hardware PDMPCM IP block.
pCfgThe pointer to the configuration structure cy_stc_pdm_pcm_config_t.
Returns
The status cy_en_pdm_pcm_status_t.
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Enable ( CyPdmPcm_Type *  base)

Enables the PDM-PCM data conversion.

Parameters
baseThe pointer to the hardware PDMPCM IP block.
Returns
The status cy_en_pdm_pcm_status_t.
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Disable ( CyPdmPcm_Type *  base)

Disables the PDM-PCM data conversion.

Parameters
baseThe pointer to the hardware PDMPCM IP block.
Returns
The status cy_en_pdm_pcm_status_t.
cy_en_pdm_pcm_status_t Cy_PDM_PCM_SetFifoLevel ( uint8_t  wmLevel)

Sets FIFO water mark level.Registered callback get called once FIFO reached to water mark level.

Max wmLevel = 127

Returns
The status cy_en_pdm_pcm_status_t.
uint8_t Cy_PDM_PCM_GetFifoLevel ( void  )

Returns depth of FIFO.

Returns
Depth of FIFO. Max value = 127
void Cy_PDM_PCM_FreezeFifo ( void  )

Freezes the RX FIFO.

Note:- Cy_PDM_PCM_Disable must be called before invoke this API.

void Cy_PDM_PCM_UnfreezeFifo ( void  )

Unfreezes the RX FIFO.

void Cy_PDM_PCM_ClearFifo ( void  )

Resets the output data FIFO, removing all data words from the FIFO.

Note:- Cy_PDM_PCM_FreezeFifo must be called before invoke this API.

cy_en_pdm_pcm_status_t Cy_PDM_PCM_ReadFifoAll ( uint32_t *  pData,
uint8_t *  pDatalen,
uint8_t *  pFifoCntx 
)

Reads whole the FIFO payload into the data array.

Parameters
pDataThe pointer to the 32 bit array for the FIFO payload.
pDatalennumber of 32 bit data entries. Max value allowed is 128.
pFifoCntxFIFO context. This is the value returned in registered callback's argument
Returns
The status cy_en_pdm_pcm_status_t.
void Cy_PDM_PCM_DeInit ( CyPdmPcm_Type *  base)

De initializes PDMPCM block.

Parameters
baseThe pointer to the hardware PDMPCM IP block.