|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
47 #if dg_configUSE_HW_PDM
63 #define HW_PDM_CRG_REG_FIELD_MASK(reg, field) REG_MSK(CRG_AUD, PDM_##reg##_REG, field)
75 #define HW_PDM_CRG_REG_FIELD_POS(reg, field) REG_POS(CRG_AUD, PDM_##reg##_REG, field)
86 #define HW_PDM_CRG_REG_GETF(reg, field) REG_GETF(CRG_AUD, PDM_##reg##_REG, field)
96 #define HW_PDM_CRG_REG_SETF(reg, field, val) REG_SETF(CRG_AUD, PDM_##reg##_REG, field, val)
104 #define HW_PDM_CRG_REG_SET_BIT(reg, field) REG_SET_BIT(CRG_AUD, PDM_##reg##_REG, field)
112 #define HW_PDM_CRG_REG_CLR_BIT(reg, field) REG_CLR_BIT(CRG_AUD, PDM_##reg##_REG, field)
124 #define HW_PDM_SRC_REG_GETF(id, reg, field) HW_SRC_REG_GETF(id, SRC1, reg##_REG, field)
135 #define HW_PDM_SRC_REG_SETF(id, reg, field, val) HW_SRC_REG_SETF(id, SRC1, reg##_REG, field, val)
144 #define HW_PDM_SRC_REG_SET_BIT(id, reg, field) HW_SRC_REG_SET_BIT(id, SRC1, reg##_REG, field)
153 #define HW_PDM_SRC_REG_CLR_BIT(id, reg, field) HW_SRC_REG_CLR_BIT(id, SRC1, reg##_REG, field)
312 uint32_t pdm_div_reg = CRG_AUD->PDM_DIV_REG;
314 if (pdm_div_reg &
REG_MSK(CRG_AUD, PDM_DIV_REG, PDM_MASTER_MODE)) {
318 return(!!(pdm_div_reg &
REG_MSK(CRG_AUD, PDM_DIV_REG, CLK_PDM_EN)));
487 REG_SETF(SRC2, SRC2_MUX_REG, PDM_MUX_OUT, output);
500 return(
REG_GETF(SRC2, SRC2_MUX_REG, PDM_MUX_OUT));
__STATIC_INLINE HW_PDM_MODE hw_pdm_get_mode(void)
Get PDM Master/Slave mode.
Definition: hw_pdm.h:298
#define REG_SETF(base, reg, field, new_val)
Set the value of a register field.
Definition: sdk_defs.h:738
HW_PDM_MODE
PDM Master/Slave mode.
Definition: hw_pdm.h:168
__STATIC_INLINE uint8_t hw_pdm_get_clk_div(void)
Get PDM clock divider.
Definition: hw_pdm.h:327
__STATIC_INLINE void hw_pdm_set_in_channel_swap(HW_SRC_ID id, bool swap)
Swap left and right channel on the PDM input source.
Definition: hw_pdm.h:452
HW_PDM_CHANNEL_CONFIG
PDM output channel configuration.
Definition: hw_pdm.h:199
__STATIC_INLINE void hw_pdm_set_output_delay(HW_SRC_ID id, HW_PDM_DO_DELAY delay)
Set output delay in PDM interface.
Definition: hw_pdm.h:404
HW_PDM_MUX_OUT
PDM output multiplexer.
Definition: hw_pdm.h:210
PDM interface mode configuration.
Definition: hw_pdm.h:218
__STATIC_INLINE void hw_pdm_set_output_channel_config(HW_SRC_ID id, HW_PDM_CHANNEL_CONFIG channel_conf)
Set PDM output channel configuration applicable only for SRC1, APU.
Definition: hw_pdm.h:429
__STATIC_INLINE void hw_pdm_set_out_channel_swap(HW_SRC_ID id, bool swap)
Swap left and right channel on the PDM output source.
Definition: hw_pdm.h:468
Central include header file with platform definitions.
HW_PDM_DO_DELAY
PDM output delay.
Definition: hw_pdm.h:188
__STATIC_INLINE void hw_pdm_set_input_delay(HW_SRC_ID id, HW_PDM_DI_DELAY delay)
Set input delay in PDM interface.
Definition: hw_pdm.h:388
#define HW_PDM_SRC_REG_GETF(id, reg, field)
Get the value of a field of a PDM register.
Definition: hw_pdm.h:124
void hw_pdm_init(HW_SRC_ID id, hw_pdm_config_t *config)
Initialize PDM interface.
#define HW_SRC_REG_GETF(id, base, reg, field)
Get the value of a field of a SRC register.
Definition: hw_src.h:77
__STATIC_INLINE void hw_pdm_set_pdm_output_mux(HW_PDM_MUX_OUT output)
Set output for the PDM_MUX_OUT multiplexer.
Definition: hw_pdm.h:484
#define HW_PDM_CRG_REG_SETF(reg, field, val)
Set the value of a field of a PDM register.
Definition: hw_pdm.h:96
__STATIC_INLINE HW_PDM_MUX_OUT hw_pdm_get_pdm_output_mux(void)
Get output for the PDM_MUX_OUT multiplexer.
Definition: hw_pdm.h:497
__STATIC_INLINE void hw_pdm_enable(void)
Enable PDM block system clock source used only for Master mode.
Definition: hw_pdm.h:362
#define HW_PDM_CRG_REG_SET_BIT(reg, field)
Set a bit of a PDM register.
Definition: hw_pdm.h:104
Definition of the API for the Audio Unit SRC Low Level Driver.
__STATIC_INLINE void hw_pdm_disable(void)
Disable PDM block system clock source.
Definition: hw_pdm.h:372
__STATIC_INLINE bool hw_pdm_get_in_channel_swap(HW_SRC_ID id)
Get the status of swap of the channels on the PDM input source.
Definition: hw_pdm.h:340
__STATIC_INLINE bool hw_pdm_get_status(void)
Get PDM status. Supported only for Master mode.
Definition: hw_pdm.h:310
#define REG_MSK(base, reg, field)
Access register field mask.
Definition: sdk_defs.h:583
HW_GPIO_MODE mode
Definition: hw_gpio.h:211
HW_PDM_CHANNEL_CONFIG output_channel
Definition: hw_pdm.h:223
bool swap_channel
Definition: hw_pdm.h:224
HW_PDM_DI_DELAY
PDM input delay.
Definition: hw_pdm.h:177
#define HW_PDM_SRC_REG_SET_BIT(id, reg, field)
Set a bit of a PDM register.
Definition: hw_pdm.h:144
__STATIC_INLINE bool hw_pdm_get_out_channel_swap(HW_SRC_ID id)
Get the status of swap of the channels on the PDM output source.
Definition: hw_pdm.h:351
__STATIC_INLINE HW_PDM_DI_DELAY hw_pdm_get_input_delay(HW_SRC_ID id)
Get input delay in PDM interface.
Definition: hw_pdm.h:246
__STATIC_INLINE HW_PDM_DO_DELAY hw_pdm_get_output_delay(HW_SRC_ID id)
Get output delay in PDM interface.
Definition: hw_pdm.h:261
uint32_t clk_frequency
Definition: hw_pdm.h:226
#define HW_PDM_SRC_REG_CLR_BIT(id, reg, field)
Clear a bit of a PDM register.
Definition: hw_pdm.h:153
#define REG_GETF(base, reg, field)
Return the value of a register field.
Definition: sdk_defs.h:711
HW_PDM_DO_DELAY out_delay
Definition: hw_pdm.h:222
HW_PDM_DATA_DIRECTION data_direction
Definition: hw_pdm.h:231
#define HW_PDM_CRG_REG_CLR_BIT(reg, field)
Clear a bit of a PDM register.
Definition: hw_pdm.h:112
#define HW_PDM_SRC_REG_SETF(id, reg, field, val)
Set the value of a field of a PDM register.
Definition: hw_pdm.h:135
#define HW_PDM_CRG_REG_GETF(reg, field)
Get the value of a field of a PDM register.
Definition: hw_pdm.h:86
HW_PDM_DI_DELAY in_delay
Definition: hw_pdm.h:221
HW_PDM_MODE config_mode
Definition: hw_pdm.h:220
__STATIC_INLINE HW_PDM_CHANNEL_CONFIG hw_pdm_get_output_channel_config(HW_SRC_ID id)
Get PDM output channel configuration.
Definition: hw_pdm.h:287
__STATIC_INLINE void hw_pdm_set_mode(HW_PDM_MODE mode)
Set PDM Master/Slave mode.
Definition: hw_pdm.h:440
HW_PDM_DATA_DIRECTION
PDM data direction.
Definition: hw_pdm.h:159
uint32_t hw_pdm_clk_init(uint32_t frequency)
Initialize PDM clock.