PDM Lite driver APIs. More...
Data Structures | |
| struct | pdm_config |
| PDM config. More... | |
Macros | |
| #define | PDM_EVENT_OFIFO_OVERFLOW_ERROR (PDM_ST_OFIFO_OVFL_ERR_MASK) |
| PDM event. More... | |
| #define | PDM_EVENT_CIC_OVERLOAD_ERROR (PDM_ST_CIC_OVLD_ERR_MASK) |
| #define | PDM_EVENT_CIC_SAT_ERROR (PDM_ST_CIC_SAT_ERR_MASK) |
| #define | PDM_CIC_SIGMA_DELTA_ORDER_5 (2U) |
| PDM CIC sidma-delta filter order. More... | |
| #define | PDM_CIC_SIGMA_DELTA_ORDER_6 (1U) |
| #define | PDM_CIC_SIGMA_DELTA_ORDER_7 (0U) |
Typedefs | |
| typedef struct pdm_config | pdm_config_t |
| PDM config. More... | |
Functions | |
| static bool | pdm_is_running (PDMLITE_Type *ptr) |
| check whether PDM is running More... | |
| static void | pdm_stop (PDMLITE_Type *ptr) |
| stop pdm More... | |
| static void | pdm_start (PDMLITE_Type *ptr) |
| start pdm More... | |
| static void | pdm_disable_channel (PDMLITE_Type *ptr, uint16_t channel_disable_mask) |
| disable channel More... | |
| static void | pdm_enable_channel (PDMLITE_Type *ptr, uint16_t capture_high_level_mask, uint16_t channel_enable_mask) |
| enable channel More... | |
| static void | pdm_disable_pdm_clock_out (PDMLITE_Type *ptr) |
| disable pdm clock out More... | |
| static void | pdm_enable_pdm_clock_out (PDMLITE_Type *ptr) |
| enable pdm clock out More... | |
| static void | pdm_config_cic (PDMLITE_Type *ptr, uint8_t sigma_delta_order, uint8_t dec_ratio, uint8_t post_scale) |
| pdm config cic More... | |
| static void | pdm_software_reset (PDMLITE_Type *ptr) |
| pdm software reset More... | |
| static void | pdm_enable_irq (PDMLITE_Type *ptr, uint8_t mask) |
| pdm enable irq More... | |
| static void | pdm_disable_irq (PDMLITE_Type *ptr, uint8_t mask) |
| pdm disable irq More... | |
| hpm_stat_t | pdm_init (PDMLITE_Type *ptr, pdm_config_t *config) |
| pdm initialization More... | |
| void | pdm_get_default_config (PDMLITE_Type *ptr, pdm_config_t *config) |
| pdm get default config More... | |
| hpm_stat_t | pdm_config_sample_rate (PDMLITE_Type *ptr, uint32_t mclk_in_hz, uint32_t sample_rate_hz) |
| pdm config sample rate More... | |
| static void | pdm_config_divider (PDMLITE_Type *ptr, uint8_t div, bool bypass) |
| pdm config clock divider More... | |
PDM Lite driver APIs.
| #define PDM_CIC_SIGMA_DELTA_ORDER_5 (2U) |
PDM CIC sidma-delta filter order.
| #define PDM_CIC_SIGMA_DELTA_ORDER_6 (1U) |
| #define PDM_CIC_SIGMA_DELTA_ORDER_7 (0U) |
| #define PDM_EVENT_CIC_OVERLOAD_ERROR (PDM_ST_CIC_OVLD_ERR_MASK) |
| #define PDM_EVENT_CIC_SAT_ERROR (PDM_ST_CIC_SAT_ERR_MASK) |
| #define PDM_EVENT_OFIFO_OVERFLOW_ERROR (PDM_ST_OFIFO_OVFL_ERR_MASK) |
| typedef struct pdm_config pdm_config_t |
|
inlinestatic |
pdm config cic
| [in] | ptr | PDM base address |
| [in] | sigma_delta_order | sidma-delta filter order |
| [in] | dec_ratio | Rate of down sampling |
| [in] | post_scale | output value post scale |
|
inlinestatic |
pdm config clock divider
| [in] | ptr | PDM base address |
| [in] | div | divider value |
| [in] | bypass | true: bypass divider |
| hpm_stat_t pdm_config_sample_rate | ( | PDMLITE_Type * | ptr, |
| uint32_t | mclk_in_hz, | ||
| uint32_t | sample_rate_hz | ||
| ) |
pdm config sample rate
| [in] | ptr | PDM base address |
| [in] | mclk_in_hz | PDM source clock |
| [in] | sample_rate_hz | target sample rate |
| hpm_stat_t | status_invalid_argument or status_success |
|
inlinestatic |
disable channel
| [in] | ptr | PDM base address |
| [in] | channel_disable_mask | channel mask |
|
inlinestatic |
pdm disable irq
| [in] | ptr | PDM base address |
| [in] | mask | pdm irq mask in ST register |
|
inlinestatic |
disable pdm clock out
| [in] | ptr | PDM base address |
|
inlinestatic |
enable channel
| [in] | ptr | PDM base address |
| [in] | capture_high_level_mask | capture when PDM_CLK is high |
| [in] | channel_enable_mask | channel mask |
|
inlinestatic |
pdm enable irq
| [in] | ptr | PDM base address |
| [in] | mask | pdm irq mask in ST register |
|
inlinestatic |
enable pdm clock out
| [in] | ptr | PDM base address |
| void pdm_get_default_config | ( | PDMLITE_Type * | ptr, |
| pdm_config_t * | config | ||
| ) |
pdm get default config
| [in] | ptr | PDM base address |
| [out] | config | pdm_config_t |
| hpm_stat_t pdm_init | ( | PDMLITE_Type * | ptr, |
| pdm_config_t * | config | ||
| ) |
pdm initialization
| [in] | ptr | PDM base address |
| [in] | config | pdm_config_t |
| hpm_stat_t | status_invalid_argument or status_success |
|
inlinestatic |
check whether PDM is running
| [in] | ptr | PDM base address |
| true | in PDM is running |
|
inlinestatic |
pdm software reset
| [in] | ptr | PDM base address |
|
inlinestatic |
start pdm
| [in] | ptr | PDM base address |
|
inlinestatic |
stop pdm
| [in] | ptr | PDM base address |