Functions | |
cy_en_pdm_pcm_status_t | Cy_PDM_PCM_Channel_Init (PDM_Type *base, cy_stc_pdm_pcm_channel_config_t const *channel_config, uint8_t channel_num) |
Initialize the PDM-PCM Channel. More... | |
cy_en_pdm_pcm_status_t | Cy_PDM_PCM_Init (PDM_Type *base, cy_stc_pdm_pcm_config_v2_t const *config) |
Initializes the PDM-PCM module. More... | |
cy_en_pdm_pcm_status_t | Cy_PDM_PCM_test_Init (PDM_Type *base, cy_stc_pdm_pcm_config_v2_t const *config, cy_stc_test_config_t const *test_config) |
Initializes the PDM-PCM module test mode. More... | |
void | Cy_PDM_PCM_Channel_DeInit (PDM_Type *base, uint8_t channel_num) |
Uninitializes the PDM-PCM channel. More... | |
void | Cy_PDM_PCM_DeInit (PDM_Type *base) |
Uninitializes the PDM-PCM module. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Activate_Channel (PDM_Type *base, uint8_t channel_num) |
Activates the PDM-PCM channel. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_DeActivate_Channel (PDM_Type *base, uint8_t channel_num) |
DeActivates the PDM-PCM channel. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_SetRateSampling (PDM_Type *base, cy_en_pdm_pcm_halve_rate_sel_t rate) |
Sets Halve rate Sampling rate. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Enable (PDM_Type *base, uint8_t channel_num) |
Enables the PDM-PCM data conversion. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Disable (PDM_Type *base, uint8_t channel_num) |
Disables the PDM-PCM data conversion. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Set_Cic_DecimCode (PDM_Type *base, uint8_t channel_num, cy_en_pdm_pcm_ch_cic_decimcode_t decimcode) |
Sets PDM-PCM CIC Filter Decimation code. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Set_Fir0 (PDM_Type *base, uint8_t channel_num, cy_en_pdm_pcm_ch_fir0_decimcode_t decimcode, uint8_t scale) |
Sets PDM-PCM FIR0 Filter Decim code and Scale. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Set_Fir1 (PDM_Type *base, uint8_t channel_num, cy_en_pdm_pcm_ch_fir1_decimcode_t decimcode, uint8_t scale) |
Sets PDM-PCM FIR1 Filter Decimation code and Scale. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_Set_DCblock (PDM_Type *base, uint8_t channel_num, cy_en_pdm_pcm_ch_dcblock_coef_t coef) |
Sets the DC blocker filter with programmable coefficient. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_SetInterruptMask (PDM_Type *base, uint8_t channel_num, 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_Channel_GetInterruptMask (PDM_Type const *base, uint8_t channel_num) |
Returns the PDM-PCM interrupt mask (a content of the INTR_MASK register). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_Channel_GetInterruptStatusMasked (PDM_Type const *base, uint8_t channel_num) |
Reports the status of enabled (masked) PDM-PCM interrupt sources. More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_Channel_GetInterruptStatus (PDM_Type const *base, uint8_t channel_num) |
Reports the status of PDM-PCM interrupt sources (an INTR register). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_ClearInterrupt (PDM_Type *base, uint8_t channel_num, uint32_t interrupt) |
Clears one or more PDM-PCM interrupt statuses (sets an INTR register's bits). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_SetInterrupt (PDM_Type *base, uint8_t channel_num, uint32_t interrupt) |
Sets one or more interrupt source statuses (sets an INTR_SET register). More... | |
__STATIC_INLINE uint8_t | Cy_PDM_PCM_Channel_GetNumInFifo (PDM_Type const *base, uint8_t channel_num) |
Reports the current number of used words in the output data FIFO. More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_Channel_ReadFifo (PDM_Type const *base, uint8_t channel_num) |
Reads ("pops") one word from the output data FIFO. More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_FreezeFifo (PDM_Type *base, uint8_t channel_num) |
Freezes the RX FIFO (Debug purpose). More... | |
__STATIC_INLINE void | Cy_PDM_PCM_Channel_UnfreezeFifo (PDM_Type *base, uint8_t channel_num) |
Unfreezes the RX FIFO (Debug purpose). More... | |
__STATIC_INLINE uint32_t | Cy_PDM_PCM_Channel_ReadFifoSilent (PDM_Type const *base, uint8_t channel_num) |
Reads the RX FIFO silent (without touching the FIFO function). More... | |
__STATIC_INLINE bool | Cy_PDM_PCM_Channel_GetCurrentState (PDM_Type const *base, uint8_t channel_num) |
Returns the current PDM-PCM state (active/stopped). More... | |
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Channel_Init | ( | PDM_Type * | base, |
cy_stc_pdm_pcm_channel_config_t const * | channel_config, | ||
uint8_t | channel_num | ||
) |
Initialize the PDM-PCM Channel.
base | The pointer to the PDM-PCM instance address |
channel_config | The pointer to a configuration structure. |
channel_num | The channel number to be initialized. |
cy_en_pdm_pcm_status_t Cy_PDM_PCM_Init | ( | PDM_Type * | base, |
cy_stc_pdm_pcm_config_v2_t const * | config | ||
) |
Initializes the PDM-PCM module.
base | The pointer to the PDM-PCM instance address |
config | The pointer to a configuration structure. cy_stc_pdm_pcm_config_v2_t |
cy_en_pdm_pcm_status_t Cy_PDM_PCM_test_Init | ( | PDM_Type * | base, |
cy_stc_pdm_pcm_config_v2_t const * | config, | ||
cy_stc_test_config_t const * | test_config | ||
) |
Initializes the PDM-PCM module test mode.
base | The pointer to the PDM-PCM instance address |
config | The pointer to a configuration structure. cy_stc_pdm_pcm_config_v2_t |
test_config | test Mode configuration. cy_stc_test_config_t |
void Cy_PDM_PCM_Channel_DeInit | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Uninitializes the PDM-PCM channel.
base | The pointer to the PDM-PCM instance address. |
channel_num | channel number to be de initialized. |
void Cy_PDM_PCM_DeInit | ( | PDM_Type * | base | ) |
Uninitializes the PDM-PCM module.
base | The pointer to the PDM-PCM instance address. |
__STATIC_INLINE void Cy_PDM_PCM_Activate_Channel | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Activates the PDM-PCM channel.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number to be activated |
__STATIC_INLINE void Cy_PDM_PCM_DeActivate_Channel | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
DeActivates the PDM-PCM channel.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number to be deactivated |
__STATIC_INLINE void Cy_PDM_PCM_SetRateSampling | ( | PDM_Type * | base, |
cy_en_pdm_pcm_halve_rate_sel_t | rate | ||
) |
Sets Halve rate Sampling rate.
base | The pointer to the PDM-PCM instance address. |
rate | Halve rate sampling or Full rate sampling cy_en_pdm_pcm_halve_rate_sel_t. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Enable | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Enables the PDM-PCM data conversion.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number to be enabled |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Disable | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Disables the PDM-PCM data conversion.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number to be disabled |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Set_Cic_DecimCode | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
cy_en_pdm_pcm_ch_cic_decimcode_t | decimcode | ||
) |
Sets PDM-PCM CIC Filter Decimation code.
base | The pointer to the PDM-PCM instance address |
channel_num | Channel number for which the CIC filter Decimation code to be set |
decimcode | decimation code value to be set. cy_en_pdm_pcm_ch_cic_decimcode_t. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Set_Fir0 | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
cy_en_pdm_pcm_ch_fir0_decimcode_t | decimcode, | ||
uint8_t | scale | ||
) |
Sets PDM-PCM FIR0 Filter Decim code and Scale.
The FIR filter coefficients have no default values: the coefficients MUST be programmed BEFORE the filter is enabled. By Default FIR0 is disabled and is only used for 8Khz and 16 Khz sample frequencies. For other frequencies it is a pass through.
base | The pointer to the PDM-PCM instance address |
channel_num | Channel number for which the FIR0 Decimation code and the filter to be set. |
decimcode | Decimation code value to be set. cy_en_pdm_pcm_ch_fir0_decimcode_t. |
scale | Scale value to be set. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Set_Fir1 | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
cy_en_pdm_pcm_ch_fir1_decimcode_t | decimcode, | ||
uint8_t | scale | ||
) |
Sets PDM-PCM FIR1 Filter Decimation code and Scale.
base | The pointer to the PDM-PCM instance address |
channel_num | Channel number for which the FIR1 Decimation code and the filter to be set. |
decimcode | Decimation code value to be set. cy_en_pdm_pcm_ch_fir1_decimcode_t. |
scale | Scale value to be set. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_Set_DCblock | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
cy_en_pdm_pcm_ch_dcblock_coef_t | coef | ||
) |
Sets the DC blocker filter with programmable coefficient.
The filter is used to remove a DC component.
base | The pointer to the PDM-PCM instance address |
channel_num | Channel number for which DC block coef to be set. |
coef | coef value to be set. cy_en_pdm_pcm_ch_dcblock_coef_t. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_SetInterruptMask | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
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 |
channel_num | Channel number |
interrupt | Interrupt bit mask Interrupt Masks. |
__STATIC_INLINE uint32_t Cy_PDM_PCM_Channel_GetInterruptMask | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Returns the PDM-PCM interrupt mask (a content of the INTR_MASK register).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE uint32_t Cy_PDM_PCM_Channel_GetInterruptStatusMasked | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Reports the status of enabled (masked) PDM-PCM interrupt sources.
(an INTR_MASKED register).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE uint32_t Cy_PDM_PCM_Channel_GetInterruptStatus | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Reports the status of PDM-PCM interrupt sources (an INTR register).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE void Cy_PDM_PCM_Channel_ClearInterrupt | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
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 |
channel_num | Channel number |
interrupt | The interrupt bit mask Interrupt Masks. |
__STATIC_INLINE void Cy_PDM_PCM_Channel_SetInterrupt | ( | PDM_Type * | base, |
uint8_t | channel_num, | ||
uint32_t | interrupt | ||
) |
Sets one or more interrupt source statuses (sets an INTR_SET register).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
interrupt | The interrupt bit mask Interrupt Masks. |
__STATIC_INLINE uint8_t Cy_PDM_PCM_Channel_GetNumInFifo | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Reports the current number of used words in the output data FIFO.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE uint32_t Cy_PDM_PCM_Channel_ReadFifo | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Reads ("pops") one word from the output data FIFO.
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE void Cy_PDM_PCM_Channel_FreezeFifo | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Freezes the RX FIFO (Debug purpose).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE void Cy_PDM_PCM_Channel_UnfreezeFifo | ( | PDM_Type * | base, |
uint8_t | channel_num | ||
) |
Unfreezes the RX FIFO (Debug purpose).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE uint32_t Cy_PDM_PCM_Channel_ReadFifoSilent | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Reads the RX FIFO silent (without touching the FIFO function).
base | Pointer to PDM-PCM instance address. |
channel_num | Channel number |
__STATIC_INLINE bool Cy_PDM_PCM_Channel_GetCurrentState | ( | PDM_Type const * | base, |
uint8_t | channel_num | ||
) |
Returns the current PDM-PCM state (active/stopped).
base | The pointer to the PDM-PCM instance address. |
channel_num | Channel number |