Hardware access layer with cache and barrier support for managing the PDM peripheral. More...
Data Structures | |
struct | nrfy_pdm_buffer_t |
Structure describing reception buffer. More... | |
struct | nrfy_pdm_pins_t |
PDM pins configuration structure. More... | |
struct | nrfy_pdm_config_t |
PDM configuration structure. More... | |
Functions | |
NRFY_STATIC_INLINE void | nrfy_pdm_periph_configure (NRF_PDM_Type *p_reg, nrfy_pdm_config_t const *p_config) |
Function for configuring the PDM. | |
NRFY_STATIC_INLINE void | nrfy_pdm_int_init (NRF_PDM_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable) |
Function for initializing the specified PDM interrupts. | |
NRFY_STATIC_INLINE void | nrfy_pdm_int_uninit (NRF_PDM_Type *p_reg) |
Function for uninitializing the PDM interrupts. | |
NRFY_STATIC_INLINE uint32_t | nrfy_pdm_events_process (NRF_PDM_Type *p_reg, uint32_t mask, nrfy_pdm_buffer_t *p_buffer) |
Function for processing the specified PDM events. | |
NRFY_STATIC_INLINE void | nrfy_pdm_buffer_set (NRF_PDM_Type *p_reg, nrfy_pdm_buffer_t const *p_buffer) |
Function for setting the PDM sampling buffer. | |
NRFY_STATIC_INLINE void | nrfy_pdm_start (NRF_PDM_Type *p_reg, nrfy_pdm_buffer_t const *p_buffer) |
Function for starting the PDM sampling. | |
NRFY_STATIC_INLINE void | nrfy_pdm_abort (NRF_PDM_Type *p_reg, nrfy_pdm_buffer_t const *p_buffer) |
Function for aborting PDM transaction. | |
NRFY_STATIC_INLINE void | nrfy_pdm_pins_set (NRF_PDM_Type *p_reg, nrfy_pdm_pins_t *p_pins) |
Function for setting the PDM pins configuration. | |
NRFY_STATIC_INLINE void | nrfy_pdm_pins_get (NRF_PDM_Type const *p_reg, nrfy_pdm_pins_t *p_pins) |
Function for getting the PDM pins configuration. | |
NRFY_STATIC_INLINE void | nrfy_pdm_task_trigger (NRF_PDM_Type *p_reg, nrf_pdm_task_t task) |
NRFY_STATIC_INLINE uint32_t | nrfy_pdm_task_address_get (NRF_PDM_Type const *p_reg, nrf_pdm_task_t task) |
NRFY_STATIC_INLINE bool | nrfy_pdm_event_check (NRF_PDM_Type const *p_reg, nrf_pdm_event_t event) |
NRFY_STATIC_INLINE void | nrfy_pdm_event_clear (NRF_PDM_Type *p_reg, nrf_pdm_event_t event) |
NRFY_STATIC_INLINE uint32_t | nrfy_pdm_event_address_get (NRF_PDM_Type const *p_reg, nrf_pdm_event_t event) |
NRFY_STATIC_INLINE void | nrfy_pdm_int_enable (NRF_PDM_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_pdm_int_enable_check (NRF_PDM_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_pdm_int_disable (NRF_PDM_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_pdm_subscribe_set (NRF_PDM_Type *p_reg, nrf_pdm_task_t task, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_pdm_subscribe_clear (NRF_PDM_Type *p_reg, nrf_pdm_task_t task) |
NRFY_STATIC_INLINE void | nrfy_pdm_publish_set (NRF_PDM_Type *p_reg, nrf_pdm_event_t event, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_pdm_publish_clear (NRF_PDM_Type *p_reg, nrf_pdm_event_t event) |
NRFY_STATIC_INLINE void | nrfy_pdm_enable (NRF_PDM_Type *p_reg) |
NRFY_STATIC_INLINE void | nrfy_pdm_disable (NRF_PDM_Type *p_reg) |
NRFY_STATIC_INLINE bool | nrfy_pdm_enable_check (NRF_PDM_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_pdm_mode_set (NRF_PDM_Type *p_reg, nrf_pdm_mode_t pdm_mode, nrf_pdm_edge_t pdm_edge) |
NRFY_STATIC_INLINE void | nrfy_pdm_mode_get (NRF_PDM_Type const *p_reg, nrf_pdm_mode_t *p_pdm_mode, nrf_pdm_edge_t *p_pdm_edge) |
NRFY_STATIC_INLINE void | nrfy_pdm_clock_set (NRF_PDM_Type *p_reg, nrf_pdm_freq_t pdm_freq) |
NRFY_STATIC_INLINE nrf_pdm_freq_t | nrfy_pdm_clock_get (NRF_PDM_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_pdm_pin_disconnect (NRF_PDM_Type *p_reg) |
NRFY_STATIC_INLINE void | nrfy_pdm_gain_set (NRF_PDM_Type *p_reg, nrf_pdm_gain_t gain_l, nrf_pdm_gain_t gain_r) |
NRFY_STATIC_INLINE void | nrfy_pdm_gain_get (NRF_PDM_Type const *p_reg, nrf_pdm_gain_t *p_gain_l, nrf_pdm_gain_t *p_gain_r) |
NRFY_STATIC_INLINE uint32_t * | nrfy_pdm_buffer_get (NRF_PDM_Type const *p_reg) |
Hardware access layer with cache and barrier support for managing the PDM peripheral.
NRFY_STATIC_INLINE void nrfy_pdm_abort | ( | NRF_PDM_Type * | p_reg, |
nrfy_pdm_buffer_t const * | p_buffer | ||
) |
Function for aborting PDM transaction.
[in] | p_reg | Pointer to thr structure of registers of the peripheral. |
[in] | p_buffer | Pointer to the structure containing reception buffer if the reception is to be blocking. NULL for non-blocking receptions. |
NRFY_STATIC_INLINE uint32_t * nrfy_pdm_buffer_get | ( | NRF_PDM_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pdm_buffer_set | ( | NRF_PDM_Type * | p_reg, |
nrfy_pdm_buffer_t const * | p_buffer | ||
) |
Function for setting the PDM sampling buffer.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_buffer | Pointer to the structure containing reception buffer. |
NRFY_STATIC_INLINE nrf_pdm_freq_t nrfy_pdm_clock_get | ( | NRF_PDM_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pdm_clock_set | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_freq_t | pdm_freq | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pdm_freq | PDM clock frequency. |
NRFY_STATIC_INLINE void nrfy_pdm_disable | ( | NRF_PDM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pdm_enable | ( | NRF_PDM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
The PDM peripheral must be enabled before use.
NRFY_STATIC_INLINE bool nrfy_pdm_enable_check | ( | NRF_PDM_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | The PDM peripheral is enabled. |
false | The PDM peripheral is not enabled. |
NRFY_STATIC_INLINE uint32_t nrfy_pdm_event_address_get | ( | NRF_PDM_Type const * | p_reg, |
nrf_pdm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | PDM event. |
NRFY_STATIC_INLINE bool nrfy_pdm_event_check | ( | NRF_PDM_Type const * | p_reg, |
nrf_pdm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
true | The event has been generated. |
false | The event has not been generated. |
NRFY_STATIC_INLINE void nrfy_pdm_event_clear | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | PDM event. |
NRFY_STATIC_INLINE uint32_t nrfy_pdm_events_process | ( | NRF_PDM_Type * | p_reg, |
uint32_t | mask, | ||
nrfy_pdm_buffer_t * | p_buffer | ||
) |
Function for processing the specified PDM events.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK(). |
[in] | p_buffer | Pointer to the structure containing buffer associated with the last reception. Can be NULL. |
NRFY_STATIC_INLINE void nrfy_pdm_gain_get | ( | NRF_PDM_Type const * | p_reg, |
nrf_pdm_gain_t * | p_gain_l, | ||
nrf_pdm_gain_t * | p_gain_r | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_gain_l | Left channel gain. |
[out] | p_gain_r | Right channel gain. |
NRFY_STATIC_INLINE void nrfy_pdm_gain_set | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_gain_t | gain_l, | ||
nrf_pdm_gain_t | gain_r | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | gain_l | Left channel gain. |
[in] | gain_r | Right channel gain. |
NRFY_STATIC_INLINE void nrfy_pdm_int_disable | ( | NRF_PDM_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_pdm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_pdm_int_enable | ( | NRF_PDM_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_pdm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE uint32_t nrfy_pdm_int_enable_check | ( | NRF_PDM_Type const * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_pdm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_pdm_int_init | ( | NRF_PDM_Type * | p_reg, |
uint32_t | mask, | ||
uint8_t | irq_priority, | ||
bool | enable | ||
) |
Function for initializing the specified PDM interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be initialized. |
[in] | irq_priority | Interrupt priority. |
[in] | enable | True if the interrupts are to be enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_pdm_int_uninit | ( | NRF_PDM_Type * | p_reg | ) |
Function for uninitializing the PDM interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pdm_mode_get | ( | NRF_PDM_Type const * | p_reg, |
nrf_pdm_mode_t * | p_pdm_mode, | ||
nrf_pdm_edge_t * | p_pdm_edge | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_pdm_mode | PDM operation mode. |
[out] | p_pdm_edge | PDM sampling mode. |
NRFY_STATIC_INLINE void nrfy_pdm_mode_set | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_mode_t | pdm_mode, | ||
nrf_pdm_edge_t | pdm_edge | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pdm_mode | PDM operation mode. |
[in] | pdm_edge | PDM sampling mode. |
NRFY_STATIC_INLINE void nrfy_pdm_periph_configure | ( | NRF_PDM_Type * | p_reg, |
nrfy_pdm_config_t const * | p_config | ||
) |
Function for configuring the PDM.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Pointer to the peripheral configuration structure. |
NRFY_STATIC_INLINE void nrfy_pdm_pin_disconnect | ( | NRF_PDM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pdm_pins_get | ( | NRF_PDM_Type const * | p_reg, |
nrfy_pdm_pins_t * | p_pins | ||
) |
Function for getting the PDM pins configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_pins | Pointer to the structure to be filled with PDM pins configuration. |
NRFY_STATIC_INLINE void nrfy_pdm_pins_set | ( | NRF_PDM_Type * | p_reg, |
nrfy_pdm_pins_t * | p_pins | ||
) |
Function for setting the PDM pins configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_pins | Pointer to the PDM pin configurartion structure. |
NRFY_STATIC_INLINE void nrfy_pdm_publish_clear | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to clear the configuration. |
NRFY_STATIC_INLINE void nrfy_pdm_publish_set | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_event_t | event, | ||
uint8_t | channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to set the configuration. |
[in] | channel | Channel through which to publish the event. |
NRFY_STATIC_INLINE void nrfy_pdm_start | ( | NRF_PDM_Type * | p_reg, |
nrfy_pdm_buffer_t const * | p_buffer | ||
) |
Function for starting the PDM sampling.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_buffer | Pointer to the structure containing reception buffer if the reception is to be blocking. NULL for non-blocking receptions. |
NRFY_STATIC_INLINE void nrfy_pdm_subscribe_clear | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to clear the configuration. |
NRFY_STATIC_INLINE void nrfy_pdm_subscribe_set | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_task_t | task, | ||
uint8_t | channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to set the configuration. |
[in] | channel | Channel through which to subscribe events. |
NRFY_STATIC_INLINE uint32_t nrfy_pdm_task_address_get | ( | NRF_PDM_Type const * | p_reg, |
nrf_pdm_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | PDM task. |
NRFY_STATIC_INLINE void nrfy_pdm_task_trigger | ( | NRF_PDM_Type * | p_reg, |
nrf_pdm_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | PDM task. |