PDM driver APIs. More...
Data Structures | |
| struct | pdm_config |
| PDM config. More... | |
Macros | |
| #define | PDM_EVENT_FILT_CRX_ERROR (PDM_ST_FILT_CRX_ERR_MASK) |
| PDM event. More... | |
| #define | PDM_EVENT_OFIFO_OVERFLOW_ERROR (PDM_ST_OFIFO_OVFL_ERR_MASK) |
| #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 void | pdm_config_hpf (PDM_Type *ptr, uint32_t hpf_coef_ma, uint32_t hpf_coef_b) |
| config high pass filter More... | |
| static void | pdm_enable_hpf (PDM_Type *ptr) |
| enable high pass filter More... | |
| static void | pdm_disable_hpf (PDM_Type *ptr) |
| disable high pass filter More... | |
| static bool | pdm_is_running (PDM_Type *ptr) |
| check whether PDM is running More... | |
| static void | pdm_stop (PDM_Type *ptr) |
| stop pdm More... | |
| static void | pdm_start (PDM_Type *ptr) |
| start pdm More... | |
| static void | pdm_disable_channel (PDM_Type *ptr, uint16_t channel_disable_mask) |
| disable channel More... | |
| static void | pdm_enable_channel (PDM_Type *ptr, uint16_t capture_high_level_mask, uint16_t channel_enable_mask) |
| enable channel More... | |
| static void | pdm_disable_pdm_clock_out (PDM_Type *ptr) |
| disable pdm clock out More... | |
| static void | pdm_enable_pdm_clock_out (PDM_Type *ptr) |
| enable pdm clock out More... | |
| static void | pdm_config_cic (PDM_Type *ptr, uint8_t sigma_delta_order, uint8_t div, uint8_t post_scale) |
| pdm config cic More... | |
| static void | pdm_software_reset (PDM_Type *ptr) |
| pdm software reset More... | |
| static void | pdm_enable_irq (PDM_Type *ptr, uint8_t mask) |
| pdm enable irq More... | |
| static void | pdm_disable_irq (PDM_Type *ptr, uint8_t mask) |
| pdm disable irq More... | |
| hpm_stat_t | pdm_init (PDM_Type *ptr, pdm_config_t *config) |
| pdm initialization More... | |
| void | pdm_get_default_config (PDM_Type *ptr, pdm_config_t *config) |
| pdm get default config More... | |
| hpm_stat_t | pdm_config_sample_rate (PDM_Type *ptr, uint32_t mclk_in_hz, uint32_t sample_rate_hz) |
| pdm config sample rate More... | |
| static void | pdm_config_divider (PDM_Type *ptr, uint8_t div, bool bypass) |
| pdm config clock divider More... | |
PDM driver APIs.
| #define PDM_CIC_SIGMA_DELTA_ORDER_5 (2U) |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
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_FILT_CRX_ERROR (PDM_ST_FILT_CRX_ERR_MASK) |
| #define PDM_EVENT_OFIFO_OVERFLOW_ERROR (PDM_ST_OFIFO_OVFL_ERR_MASK) |
| typedef struct pdm_config pdm_config_t |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm config cic
| [in] | ptr | PDM base address |
| [in] | sigma_delta_order | sidma-delta filter order |
| [in] | div | Rate of down sampling |
| [in] | post_scale | output value post scale |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm config clock divider
| [in] | ptr | PDM base address |
| [in] | div | divider value |
| [in] | bypass | true: bypass divider |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
config high pass filter
| [in] | ptr | PDM base address |
| [in] | hpf_coef_ma | high pass filter a coefficient's complement |
| [in] | hpf_coef_b | high pass filter b coefficient |
| hpm_stat_t pdm_config_sample_rate | ( | PDM_Type * | ptr, |
| uint32_t | mclk_in_hz, | ||
| uint32_t | sample_rate_hz | ||
| ) |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
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 |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
disable channel
| [in] | ptr | PDM base address |
| [in] | channel_disable_mask | channel mask |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
disable high pass filter
| [in] | ptr | PDM base address |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm disable irq
| [in] | ptr | PDM base address |
| [in] | mask | pdm irq mask in ST register |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
disable pdm clock out
| [in] | ptr | PDM base address |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
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 |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
enable high pass filter
| [in] | ptr | PDM base address |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm enable irq
| [in] | ptr | PDM base address |
| [in] | mask | pdm irq mask in ST register |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
enable pdm clock out
| [in] | ptr | PDM base address |
| void pdm_get_default_config | ( | PDM_Type * | ptr, |
| pdm_config_t * | config | ||
| ) |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm get default config
| [in] | ptr | PDM base address |
| [out] | config | pdm_config_t |
| hpm_stat_t pdm_init | ( | PDM_Type * | ptr, |
| pdm_config_t * | config | ||
| ) |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm initialization
| [in] | ptr | PDM base address |
| [in] | config | pdm_config_t |
| hpm_stat_t | status_invalid_argument or status_success |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
check whether PDM is running
| [in] | ptr | PDM base address |
| true | in PDM is running |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
pdm software reset
| [in] | ptr | PDM base address |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
start pdm
| [in] | ptr | PDM base address |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pdm_drv.h>
stop pdm
| [in] | ptr | PDM base address |