API Reference | |
Low Power Callback | |
The driver supports SysPm callback for Deep Sleep transition. | |
Functions | |
cy_en_pdm_pcm_status_t | Cy_PDM_PCM_Init (PDM_Type *base, cy_stc_pdm_pcm_config_t const *config) |
Initialize the PDM-PCM module. More... | |
void | Cy_PDM_PCM_DeInit (PDM_Type *base) |
Uninitializes the PDM-PCM module. More... | |
void | Cy_PDM_PCM_SetGain (PDM_Type *base, cy_en_pdm_pcm_chan_select_t chan, cy_en_pdm_pcm_gain_t gain) |
Sets the gain factor to the left or right channel. More... | |
cy_en_pdm_pcm_gain_t | Cy_PDM_PCM_GetGain (PDM_Type const *base, cy_en_pdm_pcm_chan_select_t chan) |
Retrieves the current gain factor of the left or right channel. More... | |
cy_en_syspm_status_t | Cy_PDM_PCM_DeepSleepCallback (cy_stc_syspm_callback_params_t const *callbackParams, cy_en_syspm_callback_mode_t mode) |
This is an example callback function that can be used at the application layer to manage the PDM-PCM operation before entering and after exiting Deep Sleep mode. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Enable (PDM_Type *base) |
Enables the PDM-PCM data conversion. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Disable (PDM_Type *base) |
Disables the PDM-PCM data conversion. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_SetInterruptMask (PDM_Type *base, uint32_t interrupt) |
Sets one or more PDM-PCM interrupt factor bits (sets the INTR_MASK register). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_GetInterruptMask (PDM_Type const *base) |
Returns the PDM-PCM interrupt mask (a content of the INTR_MASK register). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_GetInterruptStatusMasked (PDM_Type const *base) |
Reports the status of enabled (masked) PDM-PCM interrupt sources. More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_GetInterruptStatus (PDM_Type const *base) |
Reports the status of PDM-PCM interrupt sources (an INTR register). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_ClearInterrupt (PDM_Type *base, uint32_t interrupt) |
Clears one or more PDM-PCM interrupt statuses (sets an INTR register's bits). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_SetInterrupt (PDM_Type *base, uint32_t interrupt) |
Sets one or more interrupt source statuses (sets an INTR_SET register). More... | |
__STATIC_INLINE uint8_t | Cy_PDM_PCM_GetNumInFifo (PDM_Type const *base) |
Reports the current number of used words in the output data FIFO. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_ClearFifo (PDM_Type *base) |
Resets the output data FIFO, removing all data words from the FIFO. More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_ReadFifo (PDM_Type const *base) |
Reads ("pops") one word from the output data FIFO. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_EnableSoftMute (PDM_Type *base) |
Enables soft mute. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_DisableSoftMute (PDM_Type *base) |
Disables soft mute. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_FreezeFifo (PDM_Type *base) |
Freezes the RX FIFO (Debug purpose). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_UnfreezeFifo (PDM_Type *base) |
Unfreezes the RX FIFO (Debug purpose). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_ReadFifoSilent (PDM_Type const *base) |
Reads the RX FIFO silent (without touching the FIFO function). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_GetCurrentState (PDM_Type const *base) |
Returns the current PDM-PCM state (running/stopped). More... | |
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Init | ( | PDM_Type * | base, |
cy_stc_pdm_pcm_config_t const * | config | ||
) |
Initialize the PDM-PCM module.
base | The pointer to the PDM-PCM instance address |
config | The pointer to a configuration structure. |
An example of a configuration structure:
void Cy_PDM_PCM_DeInit | ( | PDM_Type * | base | ) |
Uninitializes the PDM-PCM module.
base | The pointer to the PDM-PCM instance address. |
void Cy_PDM_PCM_SetGain | ( | PDM_Type * | base, |
cy_en_pdm_pcm_chan_select_t | chan, | ||
cy_en_pdm_pcm_gain_t | gain | ||
) |
Sets the gain factor to the left or right channel.
base | The pointer to the PDM-PCM instance address. |
chan | The channel selector for gain setting cy_en_pdm_pcm_chan_select_t. |
gain | Gain for the selected channel cy_en_pdm_pcm_gain_t. |
cy_en_pdm_pcm_gain_t Cy_PDM_PCM_GetGain | ( | PDM_Type const * | base, |
cy_en_pdm_pcm_chan_select_t | chan | ||
) |
Retrieves the current gain factor of the left or right channel.
base | The pointer to the PDM-PCM instance address. |
chan | The channel selector for gain setting cy_en_pdm_pcm_chan_select_t. |
cy_en_syspm_status_t Cy_PDM_PCM_DeepSleepCallback | ( | cy_stc_syspm_callback_params_t const * | callbackParams, |
cy_en_syspm_callback_mode_t | mode | ||
) |
This is an example callback function that can be used at the application layer to manage the PDM-PCM operation before entering and after exiting Deep Sleep mode.
callbackParams | The structure with the syspm callback parameters, see cy_stc_syspm_callback_params_t. |
mode | Callback mode, see cy_en_syspm_callback_mode_t |
__STATIC_INLINE void Cy_PDM_PCM_Enable | ( | PDM_Type * | base | ) |
Enables the PDM-PCM data conversion.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_Disable | ( | PDM_Type * | base | ) |
Disables the PDM-PCM data conversion.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_SetInterruptMask | ( | PDM_Type * | base, |
uint32_t | interrupt | ||
) |
Sets one or more PDM-PCM interrupt factor bits (sets the INTR_MASK register).
base | The pointer to the PDM-PCM instance address |
interrupt | Interrupt bit mask Interrupt Masks. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_GetInterruptMask | ( | PDM_Type const * | base | ) |
Returns the PDM-PCM interrupt mask (a content of the INTR_MASK register).
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_GetInterruptStatusMasked | ( | PDM_Type const * | base | ) |
Reports the status of enabled (masked) PDM-PCM interrupt sources.
(an INTR_MASKED register).
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_GetInterruptStatus | ( | PDM_Type const * | base | ) |
Reports the status of PDM-PCM interrupt sources (an INTR register).
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_ClearInterrupt | ( | PDM_Type * | base, |
uint32_t | interrupt | ||
) |
Clears one or more PDM-PCM interrupt statuses (sets an INTR register's bits).
base | The pointer to the PDM-PCM instance address |
interrupt | The interrupt bit mask Interrupt Masks. |
__STATIC_INLINE void Cy_PDM_PCM_SetInterrupt | ( | PDM_Type * | base, |
uint32_t | interrupt | ||
) |
Sets one or more interrupt source statuses (sets an INTR_SET register).
base | The pointer to the PDM-PCM instance address. |
interrupt | The interrupt bit mask Interrupt Masks. |
__STATIC_INLINE uint8_t Cy_PDM_PCM_GetNumInFifo | ( | PDM_Type const * | base | ) |
Reports the current number of used words in the output data FIFO.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_ClearFifo | ( | PDM_Type * | base | ) |
Resets the output data FIFO, removing all data words from the FIFO.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_ReadFifo | ( | PDM_Type const * | base | ) |
Reads ("pops") one word from the output data FIFO.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_EnableSoftMute | ( | PDM_Type * | base | ) |
Enables soft mute.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_DisableSoftMute | ( | PDM_Type * | base | ) |
Disables soft mute.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_FreezeFifo | ( | PDM_Type * | base | ) |
Freezes the RX FIFO (Debug purpose).
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_UnfreezeFifo | ( | PDM_Type * | base | ) |
Unfreezes the RX FIFO (Debug purpose).
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_ReadFifoSilent | ( | PDM_Type const * | base | ) |
Reads the RX FIFO silent (without touching the FIFO function).
base | Pointer to PDM-PCM instance address. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_GetCurrentState | ( | PDM_Type const * | base | ) |
Returns the current PDM-PCM state (running/stopped).
base | The pointer to the PDM-PCM instance address. |