RTEMS 6.1-rc4
|
Data Structures | |
struct | _pdm_channel_config |
PDM channel configurations. More... | |
struct | _pdm_config |
PDM user configuration structure. More... | |
struct | _pdm_hwvad_config |
PDM voice activity detector user configuration structure. More... | |
struct | _pdm_hwvad_noise_filter |
PDM voice activity detector noise filter user configuration structure. More... | |
struct | _pdm_hwvad_zero_cross_detector |
PDM voice activity detector zero cross detector configuration structure. More... | |
struct | _pdm_transfer |
PDM SDMA transfer structure. More... | |
struct | _pdm_hwvad_notification |
PDM HWVAD notification structure. More... | |
struct | _pdm_handle |
PDM handle structure. More... | |
Driver version | |
enum | { kStatus_PDM_Busy = MAKE_STATUS(kStatusGroup_PDM, 0) , kStatus_PDM_FIFO_ERROR = MAKE_STATUS(kStatusGroup_PDM, 2) , kStatus_PDM_QueueFull = MAKE_STATUS(kStatusGroup_PDM, 3) , kStatus_PDM_Idle = MAKE_STATUS(kStatusGroup_PDM, 4) , kStatus_PDM_Output_ERROR = MAKE_STATUS(kStatusGroup_PDM, 5) , kStatus_PDM_ChannelConfig_Failed = MAKE_STATUS(kStatusGroup_PDM, 6) , kStatus_PDM_HWVAD_VoiceDetected = MAKE_STATUS(kStatusGroup_PDM, 7) , kStatus_PDM_HWVAD_Error = MAKE_STATUS(kStatusGroup_PDM, 8) } |
PDM return status. More... | |
enum | _pdm_interrupt_enable { kPDM_ErrorInterruptEnable = PDM_CTRL_1_ERREN_MASK , kPDM_FIFOInterruptEnable = PDM_CTRL_1_DISEL(2U) } |
The PDM interrupt enable flag. More... | |
enum | _pdm_internal_status { kPDM_StatusDfBusyFlag = (int)PDM_STAT_BSY_FIL_MASK , kPDM_StatusFIRFilterReady = PDM_STAT_FIR_RDY_MASK , kPDM_StatusCh0FifoDataAvaliable = PDM_STAT_CH0F_MASK , kPDM_StatusCh1FifoDataAvaliable = PDM_STAT_CH1F_MASK , kPDM_StatusCh2FifoDataAvaliable = PDM_STAT_CH2F_MASK , kPDM_StatusCh3FifoDataAvaliable = PDM_STAT_CH3F_MASK , kPDM_StatusCh4FifoDataAvaliable = PDM_STAT_CH4F_MASK , kPDM_StatusCh5FifoDataAvaliable = PDM_STAT_CH5F_MASK , kPDM_StatusCh6FifoDataAvaliable = PDM_STAT_CH6F_MASK , kPDM_StatusCh7FifoDataAvaliable = PDM_STAT_CH7F_MASK } |
The PDM status. More... | |
enum | _pdm_channel_enable_mask { kPDM_EnableChannel0 = PDM_STAT_CH0F_MASK , kPDM_EnableChannel1 = PDM_STAT_CH1F_MASK , kPDM_EnableChannel2 = PDM_STAT_CH2F_MASK , kPDM_EnableChannel3 = PDM_STAT_CH3F_MASK , kPDM_EnableChannel4 = PDM_STAT_CH4F_MASK , kPDM_EnableChannel5 = PDM_STAT_CH5F_MASK , kPDM_EnableChannel6 = PDM_STAT_CH6F_MASK , kPDM_EnableChannel7 = PDM_STAT_CH7F_MASK , kPDM_EnableChannelAll } |
PDM channel enable mask. More... | |
enum | _pdm_fifo_status { kPDM_FifoStatusUnderflowCh0 = PDM_FIFO_STAT_FIFOUND0_MASK , kPDM_FifoStatusUnderflowCh1 = PDM_FIFO_STAT_FIFOUND1_MASK , kPDM_FifoStatusUnderflowCh2 = PDM_FIFO_STAT_FIFOUND2_MASK , kPDM_FifoStatusUnderflowCh3 = PDM_FIFO_STAT_FIFOUND3_MASK , kPDM_FifoStatusUnderflowCh4 = PDM_FIFO_STAT_FIFOUND4_MASK , kPDM_FifoStatusUnderflowCh5 = PDM_FIFO_STAT_FIFOUND5_MASK , kPDM_FifoStatusUnderflowCh6 = PDM_FIFO_STAT_FIFOUND6_MASK , kPDM_FifoStatusUnderflowCh7 = PDM_FIFO_STAT_FIFOUND6_MASK , kPDM_FifoStatusOverflowCh0 = PDM_FIFO_STAT_FIFOOVF0_MASK , kPDM_FifoStatusOverflowCh1 = PDM_FIFO_STAT_FIFOOVF1_MASK , kPDM_FifoStatusOverflowCh2 = PDM_FIFO_STAT_FIFOOVF2_MASK , kPDM_FifoStatusOverflowCh3 = PDM_FIFO_STAT_FIFOOVF3_MASK , kPDM_FifoStatusOverflowCh4 = PDM_FIFO_STAT_FIFOOVF4_MASK , kPDM_FifoStatusOverflowCh5 = PDM_FIFO_STAT_FIFOOVF5_MASK , kPDM_FifoStatusOverflowCh6 = PDM_FIFO_STAT_FIFOOVF6_MASK , kPDM_FifoStatusOverflowCh7 = PDM_FIFO_STAT_FIFOOVF7_MASK } |
The PDM fifo status. More... | |
enum | _pdm_output_status { kPDM_OutputStatusUnderFlowCh0 = PDM_OUT_STAT_OUTUNF0_MASK , kPDM_OutputStatusUnderFlowCh1 = PDM_OUT_STAT_OUTUNF1_MASK , kPDM_OutputStatusUnderFlowCh2 = PDM_OUT_STAT_OUTUNF2_MASK , kPDM_OutputStatusUnderFlowCh3 = PDM_OUT_STAT_OUTUNF3_MASK , kPDM_OutputStatusUnderFlowCh4 = PDM_OUT_STAT_OUTUNF4_MASK , kPDM_OutputStatusUnderFlowCh5 = PDM_OUT_STAT_OUTUNF5_MASK , kPDM_OutputStatusUnderFlowCh6 = PDM_OUT_STAT_OUTUNF6_MASK , kPDM_OutputStatusUnderFlowCh7 = PDM_OUT_STAT_OUTUNF7_MASK , kPDM_OutputStatusOverFlowCh0 = PDM_OUT_STAT_OUTOVF0_MASK , kPDM_OutputStatusOverFlowCh1 = PDM_OUT_STAT_OUTOVF1_MASK , kPDM_OutputStatusOverFlowCh2 = PDM_OUT_STAT_OUTOVF2_MASK , kPDM_OutputStatusOverFlowCh3 = PDM_OUT_STAT_OUTOVF3_MASK , kPDM_OutputStatusOverFlowCh4 = PDM_OUT_STAT_OUTOVF4_MASK , kPDM_OutputStatusOverFlowCh5 = PDM_OUT_STAT_OUTOVF5_MASK , kPDM_OutputStatusOverFlowCh6 = PDM_OUT_STAT_OUTOVF6_MASK , kPDM_OutputStatusOverFlowCh7 = PDM_OUT_STAT_OUTOVF7_MASK } |
The PDM output status. More... | |
enum | _pdm_dc_remover { kPDM_DcRemoverCutOff21Hz = 0U , kPDM_DcRemoverCutOff83Hz = 1U , kPDM_DcRemoverCutOff152Hz = 2U , kPDM_DcRemoverBypass = 3U } |
PDM DC remover configurations. More... | |
enum | _pdm_df_quality_mode { kPDM_QualityModeMedium = 0U , kPDM_QualityModeHigh = 1U , kPDM_QualityModeLow = 7U , kPDM_QualityModeVeryLow0 = 6U , kPDM_QualityModeVeryLow1 = 5U , kPDM_QualityModeVeryLow2 = 4U } |
PDM decimation filter quality mode. More... | |
enum | _pdm_qulaity_mode_k_factor { kPDM_QualityModeHighKFactor = 1U , kPDM_QualityModeMediumKFactor = 2U , kPDM_QualityModeLowKFactor = 4U , kPDM_QualityModeVeryLow2KFactor = 8U } |
PDM quality mode K factor. More... | |
enum | _pdm_df_output_gain { kPDM_DfOutputGain0 = 0U , kPDM_DfOutputGain1 = 1U , kPDM_DfOutputGain2 = 2U , kPDM_DfOutputGain3 = 3U , kPDM_DfOutputGain4 = 4U , kPDM_DfOutputGain5 = 5U , kPDM_DfOutputGain6 = 6U , kPDM_DfOutputGain7 = 7U , kPDM_DfOutputGain8 = 8U , kPDM_DfOutputGain9 = 9U , kPDM_DfOutputGain10 = 0xAU , kPDM_DfOutputGain11 = 0xBU , kPDM_DfOutputGain12 = 0xCU , kPDM_DfOutputGain13 = 0xDU , kPDM_DfOutputGain14 = 0xEU , kPDM_DfOutputGain15 = 0xFU } |
PDM decimation filter output gain. More... | |
enum | _pdm_data_width { kPDM_DataWdith16 = 2U } |
PDM data width. More... | |
enum | _pdm_hwvad_interrupt_enable { kPDM_HwvadErrorInterruptEnable = PDM_VAD0_CTRL_1_VADERIE_MASK , kPDM_HwvadInterruptEnable = PDM_VAD0_CTRL_1_VADIE_MASK } |
PDM voice activity detector interrupt type. More... | |
enum | _pdm_hwvad_int_status { kPDM_HwvadStatusInputSaturation = PDM_VAD0_STAT_VADINSATF_MASK , kPDM_HwvadStatusVoiceDetectFlag = PDM_VAD0_STAT_VADIF_MASK } |
The PDM hwvad interrupt status flag. More... | |
enum | _pdm_hwvad_hpf_config { kPDM_HwvadHpfBypassed = 0x0U , kPDM_HwvadHpfCutOffFreq1750Hz = 0x1U , kPDM_HwvadHpfCutOffFreq215Hz = 0x2U , kPDM_HwvadHpfCutOffFreq102Hz = 0x3U } |
High pass filter configure cut-off frequency. More... | |
enum | _pdm_hwvad_filter_status { kPDM_HwvadInternalFilterNormalOperation = 0U , kPDM_HwvadInternalFilterInitial = PDM_VAD0_CTRL_1_VADST10_MASK } |
HWVAD internal filter status. More... | |
enum | _pdm_hwvad_zcd_result { kPDM_HwvadResultOREnergyBasedDetection , kPDM_HwvadResultANDEnergyBasedDetection } |
PDM voice activity detector zero cross detector result. More... | |
typedef enum _pdm_dc_remover | pdm_dc_remover_t |
PDM DC remover configurations. | |
typedef enum _pdm_df_quality_mode | pdm_df_quality_mode_t |
PDM decimation filter quality mode. | |
typedef enum _pdm_df_output_gain | pdm_df_output_gain_t |
PDM decimation filter output gain. | |
typedef struct _pdm_channel_config | pdm_channel_config_t |
PDM channel configurations. | |
typedef struct _pdm_config | pdm_config_t |
PDM user configuration structure. | |
typedef enum _pdm_hwvad_hpf_config | pdm_hwvad_hpf_config_t |
High pass filter configure cut-off frequency. | |
typedef enum _pdm_hwvad_filter_status | pdm_hwvad_filter_status_t |
HWVAD internal filter status. | |
typedef struct _pdm_hwvad_config | pdm_hwvad_config_t |
PDM voice activity detector user configuration structure. | |
typedef struct _pdm_hwvad_noise_filter | pdm_hwvad_noise_filter_t |
PDM voice activity detector noise filter user configuration structure. | |
typedef enum _pdm_hwvad_zcd_result | pdm_hwvad_zcd_result_t |
PDM voice activity detector zero cross detector result. | |
typedef struct _pdm_hwvad_zero_cross_detector | pdm_hwvad_zero_cross_detector_t |
PDM voice activity detector zero cross detector configuration structure. | |
typedef struct _pdm_transfer | pdm_transfer_t |
PDM SDMA transfer structure. | |
typedef struct _pdm_handle | pdm_handle_t |
PDM handle. | |
typedef void(* | pdm_transfer_callback_t) (PDM_Type *base, pdm_handle_t *handle, status_t status, void *userData) |
PDM transfer callback prototype. | |
typedef void(* | pdm_hwvad_callback_t) (status_t status, void *userData) |
PDM HWVAD callback prototype. | |
typedef struct _pdm_hwvad_notification | pdm_hwvad_notification_t |
PDM HWVAD notification structure. | |
#define | FSL_PDM_DRIVER_VERSION (MAKE_VERSION(2, 8, 0)) |
#define | PDM_XFER_QUEUE_SIZE (4U) |
PDM XFER QUEUE SIZE. | |
Initialization and deinitialization | |
void | PDM_Init (PDM_Type *base, const pdm_config_t *config) |
Initializes the PDM peripheral. | |
void | PDM_Deinit (PDM_Type *base) |
De-initializes the PDM peripheral. | |
void | PDM_SetChannelConfig (PDM_Type *base, uint32_t channel, const pdm_channel_config_t *config) |
PDM one channel configurations. | |
status_t | PDM_SetSampleRateConfig (PDM_Type *base, uint32_t sourceClock_HZ, uint32_t sampleRate_HZ) |
PDM set sample rate. | |
status_t | PDM_SetSampleRate (PDM_Type *base, uint32_t enableChannelMask, pdm_df_quality_mode_t qualityMode, uint8_t osr, uint32_t clkDiv) |
PDM set sample rate. | |
uint32_t | PDM_GetInstance (PDM_Type *base) |
Get the instance number for PDM. | |
Interrupts | |
void | PDM_EnableInterrupts (PDM_Type *base, uint32_t mask) |
Enables the PDM interrupt requests. | |
Bus Operations | |
void | PDM_ReadFifo (PDM_Type *base, uint32_t startChannel, uint32_t channelNums, void *buffer, size_t size, uint32_t dataWidth) |
PDM read fifo. | |
void | PDM_SetChannelGain (PDM_Type *base, uint32_t channel, pdm_df_output_gain_t gain) |
Set the PDM channel gain. | |
Voice Activity Detector | |
void | PDM_SetHwvadConfig (PDM_Type *base, const pdm_hwvad_config_t *config) |
Configure voice activity detector. | |
void | PDM_SetHwvadSignalFilterConfig (PDM_Type *base, bool enableMaxBlock, uint32_t signalGain) |
Configure voice activity detector signal filter. | |
void | PDM_SetHwvadNoiseFilterConfig (PDM_Type *base, const pdm_hwvad_noise_filter_t *config) |
Configure voice activity detector noise filter. | |
void | PDM_SetHwvadZeroCrossDetectorConfig (PDM_Type *base, const pdm_hwvad_zero_cross_detector_t *config) |
Configure voice activity detector zero cross detector. | |
void | PDM_SetHwvadInEnvelopeBasedMode (PDM_Type *base, const pdm_hwvad_config_t *hwvadConfig, const pdm_hwvad_noise_filter_t *noiseConfig, const pdm_hwvad_zero_cross_detector_t *zcdConfig, uint32_t signalGain) |
set HWVAD in envelope based mode . Recommand configurations, | |
void | PDM_SetHwvadInEnergyBasedMode (PDM_Type *base, const pdm_hwvad_config_t *hwvadConfig, const pdm_hwvad_noise_filter_t *noiseConfig, const pdm_hwvad_zero_cross_detector_t *zcdConfig, uint32_t signalGain) |
void | PDM_EnableHwvadInterruptCallback (PDM_Type *base, pdm_hwvad_callback_t vadCallback, void *userData, bool enable) |
Enable/Disable hwvad callback. | |
Transactional | |
void | PDM_TransferCreateHandle (PDM_Type *base, pdm_handle_t *handle, pdm_transfer_callback_t callback, void *userData) |
Initializes the PDM handle. | |
status_t | PDM_TransferSetChannelConfig (PDM_Type *base, pdm_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config, uint32_t format) |
PDM set channel transfer config. | |
status_t | PDM_TransferReceiveNonBlocking (PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer) |
Performs an interrupt non-blocking receive transfer on PDM. | |
void | PDM_TransferAbortReceive (PDM_Type *base, pdm_handle_t *handle) |
Aborts the current IRQ receive. | |
void | PDM_TransferHandleIRQ (PDM_Type *base, pdm_handle_t *handle) |
Tx interrupt handler. | |
#define FSL_PDM_DRIVER_VERSION (MAKE_VERSION(2, 8, 0)) |
Version 2.8.0
anonymous enum |
PDM return status.
PDM channel enable mask.
enum _pdm_data_width |
enum _pdm_dc_remover |
enum _pdm_df_output_gain |
PDM decimation filter output gain.
enum _pdm_df_quality_mode |
PDM decimation filter quality mode.
enum _pdm_fifo_status |
The PDM fifo status.
High pass filter configure cut-off frequency.
enum _pdm_internal_status |
The PDM status.
enum _pdm_output_status |
The PDM output status.
PDM quality mode K factor.
void PDM_Deinit | ( | PDM_Type * | base | ) |
De-initializes the PDM peripheral.
This API gates the PDM clock. The PDM module can't operate unless PDM_Init is called to enable the clock.
base | PDM base pointer |
brief De-initializes the PDM peripheral.
This API gates the PDM clock. The PDM module can't operate unless PDM_Init is called to enable the clock.
param base PDM base pointer
void PDM_EnableHwvadInterruptCallback | ( | PDM_Type * | base, |
pdm_hwvad_callback_t | vadCallback, | ||
void * | userData, | ||
bool | enable | ||
) |
Enable/Disable hwvad callback.
This function enable/disable the hwvad interrupt for the selected PDM peripheral.
base | Base address of the PDM peripheral. |
vadCallback | callback Pointer to store callback function, should be NULL when disable. |
userData | user data. |
enable | true is enable, false is disable. |
None. |
brief Enable/Disable hwvad callback.
This function enable/disable the hwvad interrupt for the selected PDM peripheral.
param base Base address of the PDM peripheral. param vadCallback callback Pointer to store callback function, should be NULL when disable. param userData user data. param enable true is enable, false is disable. retval None.
void PDM_EnableInterrupts | ( | PDM_Type * | base, |
uint32_t | mask | ||
) |
Enables the PDM interrupt requests.
base | PDM base pointer |
mask | interrupt source The parameter can be a combination of the following sources if defined.
|
param base PDM base pointer param mask interrupt source The parameter can be a combination of the following sources if defined. arg kPDM_ErrorInterruptEnable arg kPDM_FIFOInterruptEnable
uint32_t PDM_GetInstance | ( | PDM_Type * | base | ) |
Get the instance number for PDM.
base | PDM base pointer. |
void PDM_Init | ( | PDM_Type * | base, |
const pdm_config_t * | config | ||
) |
Initializes the PDM peripheral.
Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. The configuration structure can be custom filled or set with default values by PDM_GetDefaultConfig().
base | PDM base pointer |
config | PDM configuration structure. |
brief Initializes the PDM peripheral.
Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. The configuration structure can be custom filled or set with default values by PDM_GetDefaultConfig().
note This API should be called at the beginning of the application to use the PDM driver. Otherwise, accessing the PDM module can cause a hard fault because the clock is not enabled.
param base PDM base pointer param config PDM configuration structure.
void PDM_ReadFifo | ( | PDM_Type * | base, |
uint32_t | startChannel, | ||
uint32_t | channelNums, | ||
void * | buffer, | ||
size_t | size, | ||
uint32_t | dataWidth | ||
) |
PDM read fifo.
base | PDM base pointer. |
startChannel | start channel number. |
channelNums | total enabled channelnums. |
buffer | received buffer address. |
size | number of samples to read. |
dataWidth | sample width. |
brief PDM read fifo. Note: This function support 16 bit only for IP version that only supports 16bit.
param base PDM base pointer. param startChannel start channel number. param channelNums total enabled channelnums. param buffer received buffer address. param size number of samples to read. param dataWidth sample width.
void PDM_SetChannelConfig | ( | PDM_Type * | base, |
uint32_t | channel, | ||
const pdm_channel_config_t * | config | ||
) |
PDM one channel configurations.
base | PDM base pointer |
config | PDM channel configurations. |
channel | channel number. after completing the current frame in debug mode. |
brief PDM one channel configurations.
param base PDM base pointer param config PDM channel configurations. param channel channel number. after completing the current frame in debug mode.
void PDM_SetChannelGain | ( | PDM_Type * | base, |
uint32_t | channel, | ||
pdm_df_output_gain_t | gain | ||
) |
Set the PDM channel gain.
Please note for different quality mode, the valid gain value is different, reference RM for detail.
base | PDM base pointer. |
channel | PDM channel index. |
gain | channel gain, the register gain value range is 0 - 15. |
brief Set the PDM channel gain.
Please note for different quality mode, the valid gain value is different, reference RM for detail. param base PDM base pointer. param channel PDM channel index. param gain channel gain, the register gain value range is 0 - 15.
void PDM_SetHwvadConfig | ( | PDM_Type * | base, |
const pdm_hwvad_config_t * | config | ||
) |
Configure voice activity detector.
base | PDM base pointer |
config | Voice activity detector configure structure pointer . |
brief Configure voice activity detector.
param base PDM base pointer param config Voice activity detector configure structure pointer .
void PDM_SetHwvadInEnergyBasedMode | ( | PDM_Type * | base, |
const pdm_hwvad_config_t * | hwvadConfig, | ||
const pdm_hwvad_noise_filter_t * | noiseConfig, | ||
const pdm_hwvad_zero_cross_detector_t * | zcdConfig, | ||
uint32_t | signalGain | ||
) |
brief set HWVAD in energy based mode . Recommand configurations, code static const pdm_hwvad_config_t hwvadConfig = { .channel = 0, .initializeTime = 10U, .cicOverSampleRate = 0U, .inputGain = 0U, .frameTime = 10U, .cutOffFreq = kPDM_HwvadHpfBypassed, .enableFrameEnergy = true, .enablePreFilter = true, };
static const pdm_hwvad_noise_filter_t noiseFilterConfig = { .enableAutoNoiseFilter = true, .enableNoiseMin = false, .enableNoiseDecimation = false, .noiseFilterAdjustment = 0U, .noiseGain = 7U, .enableNoiseDetectOR = false, }; code param base PDM base pointer. param hwvadConfig internal filter status. param noiseConfig Voice activity detector noise filter configure structure pointer. param zcdConfig Voice activity detector zero cross detector configure structure pointer . param signalGain signal gain value, signal gain value should be properly according to application.
void PDM_SetHwvadInEnvelopeBasedMode | ( | PDM_Type * | base, |
const pdm_hwvad_config_t * | hwvadConfig, | ||
const pdm_hwvad_noise_filter_t * | noiseConfig, | ||
const pdm_hwvad_zero_cross_detector_t * | zcdConfig, | ||
uint32_t | signalGain | ||
) |
set HWVAD in envelope based mode . Recommand configurations,
base | PDM base pointer. |
hwvadConfig | internal filter status. |
noiseConfig | Voice activity detector noise filter configure structure pointer. |
zcdConfig | Voice activity detector zero cross detector configure structure pointer . |
signalGain | signal gain value. |
brief set HWVAD in envelope based mode . Recommand configurations, code static const pdm_hwvad_config_t hwvadConfig = { .channel = 0, .initializeTime = 10U, .cicOverSampleRate = 0U, .inputGain = 0U, .frameTime = 10U, .cutOffFreq = kPDM_HwvadHpfBypassed, .enableFrameEnergy = false, .enablePreFilter = true, };
static const pdm_hwvad_noise_filter_t noiseFilterConfig = { .enableAutoNoiseFilter = false, .enableNoiseMin = true, .enableNoiseDecimation = true, .noiseFilterAdjustment = 0U, .noiseGain = 7U, .enableNoiseDetectOR = true, }; code param base PDM base pointer. param hwvadConfig internal filter status. param noiseConfig Voice activity detector noise filter configure structure pointer. param zcdConfig Voice activity detector zero cross detector configure structure pointer . param signalGain signal gain value.
void PDM_SetHwvadNoiseFilterConfig | ( | PDM_Type * | base, |
const pdm_hwvad_noise_filter_t * | config | ||
) |
Configure voice activity detector noise filter.
base | PDM base pointer |
config | Voice activity detector noise filter configure structure pointer . |
brief Configure voice activity detector noise filter.
param base PDM base pointer param config Voice activity detector noise filter configure structure pointer .
void PDM_SetHwvadSignalFilterConfig | ( | PDM_Type * | base, |
bool | enableMaxBlock, | ||
uint32_t | signalGain | ||
) |
Configure voice activity detector signal filter.
base | PDM base pointer |
enableMaxBlock | If signal maximum block enabled. |
signalGain | Gain value for the signal energy. |
brief Configure voice activity detector signal filter.
param base PDM base pointer param enableMaxBlock If signal maximum block enabled. param signalGain Gain value for the signal energy.
void PDM_SetHwvadZeroCrossDetectorConfig | ( | PDM_Type * | base, |
const pdm_hwvad_zero_cross_detector_t * | config | ||
) |
Configure voice activity detector zero cross detector.
base | PDM base pointer |
config | Voice activity detector zero cross detector configure structure pointer . |
brief Configure voice activity detector zero cross detector.
param base PDM base pointer param config Voice activity detector zero cross detector configure structure pointer .
status_t PDM_SetSampleRate | ( | PDM_Type * | base, |
uint32_t | enableChannelMask, | ||
pdm_df_quality_mode_t | qualityMode, | ||
uint8_t | osr, | ||
uint32_t | clkDiv | ||
) |
PDM set sample rate.
base | PDM base pointer |
enableChannelMask | PDM channel enable mask. |
qualityMode | quality mode. |
osr | cic oversample rate |
clkDiv | clock divider |
brief PDM set sample rate.
deprecated Do not use this function. It has been superceded by PDM_SetSampleRateConfig param base PDM base pointer param enableChannelMask PDM channel enable mask. param qualityMode quality mode. param osr cic oversample rate param clkDiv clock divider
status_t PDM_SetSampleRateConfig | ( | PDM_Type * | base, |
uint32_t | sourceClock_HZ, | ||
uint32_t | sampleRate_HZ | ||
) |
PDM set sample rate.
base | PDM base pointer |
sourceClock_HZ | PDM source clock frequency. |
sampleRate_HZ | PDM sample rate. |
brief PDM set sample rate.
note This function is depend on the configuration of the PDM and PDM channel, so the correct call sequence is code PDM_Init(base, pdmConfig) PDM_SetChannelConfig(base, channel, &channelConfig) PDM_SetSampleRateConfig(base, source, sampleRate) endcode param base PDM base pointer param sourceClock_HZ PDM source clock frequency. param sampleRate_HZ PDM sample rate.
void PDM_TransferAbortReceive | ( | PDM_Type * | base, |
pdm_handle_t * | handle | ||
) |
Aborts the current IRQ receive.
base | PDM base pointer |
handle | Pointer to the pdm_handle_t structure which stores the transfer state. |
brief Aborts the current IRQ receive.
note This API can be called when an interrupt non-blocking transfer initiates to abort the transfer early.
param base PDM base pointer param handle Pointer to the pdm_handle_t structure which stores the transfer state.
void PDM_TransferCreateHandle | ( | PDM_Type * | base, |
pdm_handle_t * | handle, | ||
pdm_transfer_callback_t | callback, | ||
void * | userData | ||
) |
Initializes the PDM handle.
This function initializes the handle for the PDM transactional APIs. Call this function once to get the handle initialized.
base | PDM base pointer. |
handle | PDM handle pointer. |
callback | Pointer to the user callback function. |
userData | User parameter passed to the callback function. |
brief Initializes the PDM handle.
This function initializes the handle for the PDM transactional APIs. Call this function once to get the handle initialized.
param base PDM base pointer. param handle PDM handle pointer. param callback Pointer to the user callback function. param userData User parameter passed to the callback function.
void PDM_TransferHandleIRQ | ( | PDM_Type * | base, |
pdm_handle_t * | handle | ||
) |
Tx interrupt handler.
base | PDM base pointer. |
handle | Pointer to the pdm_handle_t structure. |
brief Tx interrupt handler.
param base PDM base pointer. param handle Pointer to the pdm_handle_t structure.
status_t PDM_TransferReceiveNonBlocking | ( | PDM_Type * | base, |
pdm_handle_t * | handle, | ||
pdm_transfer_t * | xfer | ||
) |
Performs an interrupt non-blocking receive transfer on PDM.
base | PDM base pointer |
handle | Pointer to the pdm_handle_t structure which stores the transfer state. |
xfer | Pointer to the pdm_transfer_t structure. |
kStatus_Success | Successfully started the data receive. |
kStatus_PDM_Busy | Previous receive still not finished. |
brief Performs an interrupt non-blocking receive transfer on PDM.
note This API returns immediately after the transfer initiates. Call the PDM_RxGetTransferStatusIRQ to poll the transfer status and check whether the transfer is finished. If the return status is not kStatus_PDM_Busy, the transfer is finished.
param base PDM base pointer param handle Pointer to the pdm_handle_t structure which stores the transfer state. param xfer Pointer to the pdm_transfer_t structure. retval kStatus_Success Successfully started the data receive. retval kStatus_PDM_Busy Previous receive still not finished.
status_t PDM_TransferSetChannelConfig | ( | PDM_Type * | base, |
pdm_handle_t * | handle, | ||
uint32_t | channel, | ||
const pdm_channel_config_t * | config, | ||
uint32_t | format | ||
) |
PDM set channel transfer config.
base | PDM base pointer. |
handle | PDM handle pointer. |
channel | PDM channel. |
config | channel config. |
format | data format, support data width configurations,_pdm_data_width. |
kStatus_PDM_ChannelConfig_Failed | or kStatus_Success. |
brief PDM set channel transfer config.
param base PDM base pointer. param handle PDM handle pointer. param channel PDM channel. param config channel config. param format data format.