nrfx 3.3
Data Structures | Functions
PDM HALY

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)
 

Detailed Description

Hardware access layer with cache and barrier support for managing the PDM peripheral.

Function Documentation

◆ nrfy_pdm_abort()

NRFY_STATIC_INLINE void nrfy_pdm_abort ( NRF_PDM_Type *  p_reg,
nrfy_pdm_buffer_t const *  p_buffer 
)

Function for aborting PDM transaction.

Parameters
[in]p_regPointer to thr structure of registers of the peripheral.
[in]p_bufferPointer to the structure containing reception buffer if the reception is to be blocking. NULL for non-blocking receptions.

◆ nrfy_pdm_buffer_get()

NRFY_STATIC_INLINE uint32_t * nrfy_pdm_buffer_get ( NRF_PDM_Type const *  p_reg)
See also
nrf_pdm_buffer_get Function for getting the current PDM sample buffer address.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the current sample buffer.

◆ nrfy_pdm_buffer_set()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufferPointer to the structure containing reception buffer.

◆ nrfy_pdm_clock_get()

NRFY_STATIC_INLINE nrf_pdm_freq_t nrfy_pdm_clock_get ( NRF_PDM_Type const *  p_reg)
See also
nrf_pdm_clock_get Function for getting the PDM clock frequency.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
PDM clock frequency.

◆ nrfy_pdm_clock_set()

NRFY_STATIC_INLINE void nrfy_pdm_clock_set ( NRF_PDM_Type *  p_reg,
nrf_pdm_freq_t  pdm_freq 
)
See also
nrf_pdm_clock_set Function for setting the PDM clock frequency.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]pdm_freqPDM clock frequency.

◆ nrfy_pdm_disable()

NRFY_STATIC_INLINE void nrfy_pdm_disable ( NRF_PDM_Type *  p_reg)
See also
nrf_pdm_disable Function for disabling the PDM peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_pdm_enable()

NRFY_STATIC_INLINE void nrfy_pdm_enable ( NRF_PDM_Type *  p_reg)
See also
nrf_pdm_enable Function for enabling the PDM peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

The PDM peripheral must be enabled before use.

◆ nrfy_pdm_enable_check()

NRFY_STATIC_INLINE bool nrfy_pdm_enable_check ( NRF_PDM_Type const *  p_reg)
See also
nrf_pdm_enable_check Function for checking if the PDM peripheral is enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe PDM peripheral is enabled.
falseThe PDM peripheral is not enabled.

◆ nrfy_pdm_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_pdm_event_address_get ( NRF_PDM_Type const *  p_reg,
nrf_pdm_event_t  event 
)
See also
nrf_pdm_event_address_get Function for getting the address of a PDM event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventPDM event.
Returns
Address of the specified PDM event.

◆ nrfy_pdm_event_check()

NRFY_STATIC_INLINE bool nrfy_pdm_event_check ( NRF_PDM_Type const *  p_reg,
nrf_pdm_event_t  event 
)
See also
nrf_pdm_event_check Function for retrieving the state of the PDM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrfy_pdm_event_clear()

NRFY_STATIC_INLINE void nrfy_pdm_event_clear ( NRF_PDM_Type *  p_reg,
nrf_pdm_event_t  event 
)
See also
nrf_pdm_event_clear Function for clearing a PDM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventPDM event.

◆ nrfy_pdm_events_process()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK().
[in]p_bufferPointer to the structure containing buffer associated with the last reception. Can be NULL.
Returns
Mask of events that were generated and processed. To be checked against the result of NRFY_EVENT_TO_INT_BITMASK().

◆ nrfy_pdm_gain_get()

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 
)
See also
nrf_pdm_gain_get Function for getting the PDM gain.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_gain_lLeft channel gain.
[out]p_gain_rRight channel gain.

◆ nrfy_pdm_gain_set()

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 
)
See also
nrf_pdm_gain_set Function for setting the PDM gain.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]gain_lLeft channel gain.
[in]gain_rRight channel gain.

◆ nrfy_pdm_int_disable()

NRFY_STATIC_INLINE void nrfy_pdm_int_disable ( NRF_PDM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pdm_int_disable Function for disabling interrupts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_pdm_int_mask_t values for bit masking.

◆ nrfy_pdm_int_enable()

NRFY_STATIC_INLINE void nrfy_pdm_int_enable ( NRF_PDM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pdm_int_enable Function for enabling PDM interrupts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_pdm_int_mask_t values for bit masking.

◆ nrfy_pdm_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_pdm_int_enable_check ( NRF_PDM_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_pdm_int_enable_check Function for checking if the specified interrupts are enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked. Use nrf_pdm_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_pdm_int_init()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be initialized.
[in]irq_priorityInterrupt priority.
[in]enableTrue if the interrupts are to be enabled, false otherwise.

◆ nrfy_pdm_int_uninit()

NRFY_STATIC_INLINE void nrfy_pdm_int_uninit ( NRF_PDM_Type *  p_reg)

Function for uninitializing the PDM interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_pdm_mode_get()

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 
)
See also
nrf_pdm_mode_get Function for getting the PDM operation mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_pdm_modePDM operation mode.
[out]p_pdm_edgePDM sampling mode.

◆ nrfy_pdm_mode_set()

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 
)
See also
nrf_pdm_mode_set Function for setting the PDM operation mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]pdm_modePDM operation mode.
[in]pdm_edgePDM sampling mode.

◆ nrfy_pdm_periph_configure()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the peripheral configuration structure.

◆ nrfy_pdm_pin_disconnect()

NRFY_STATIC_INLINE void nrfy_pdm_pin_disconnect ( NRF_PDM_Type *  p_reg)
See also
nrf_pdm_psel_disconnect Function for disconnecting the PDM pins.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_pdm_pins_get()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_pinsPointer to the structure to be filled with PDM pins configuration.

◆ nrfy_pdm_pins_set()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_pinsPointer to the PDM pin configurartion structure.

◆ nrfy_pdm_publish_clear()

NRFY_STATIC_INLINE void nrfy_pdm_publish_clear ( NRF_PDM_Type *  p_reg,
nrf_pdm_event_t  event 
)
See also
nrf_pdm_publish_clear Function for clearing the publish configuration for a given PDM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrfy_pdm_publish_set()

NRFY_STATIC_INLINE void nrfy_pdm_publish_set ( NRF_PDM_Type *  p_reg,
nrf_pdm_event_t  event,
uint8_t  channel 
)
See also
nrf_pdm_publish_set Function for setting the publish configuration for a given PDM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.

◆ nrfy_pdm_start()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufferPointer to the structure containing reception buffer if the reception is to be blocking. NULL for non-blocking receptions.

◆ nrfy_pdm_subscribe_clear()

NRFY_STATIC_INLINE void nrfy_pdm_subscribe_clear ( NRF_PDM_Type *  p_reg,
nrf_pdm_task_t  task 
)
See also
nrf_pdm_subscribe_clear Function for clearing the subscribe configuration for a given PDM task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrfy_pdm_subscribe_set()

NRFY_STATIC_INLINE void nrfy_pdm_subscribe_set ( NRF_PDM_Type *  p_reg,
nrf_pdm_task_t  task,
uint8_t  channel 
)
See also
nrf_pdm_subscribe_set Function for setting the subscribe configuration for a given PDM task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.

◆ nrfy_pdm_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_pdm_task_address_get ( NRF_PDM_Type const *  p_reg,
nrf_pdm_task_t  task 
)
See also
nrf_pdm_task_address_get Function for getting the address of a PDM task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskPDM task.
Returns
Address of the specified PDM task.

◆ nrfy_pdm_task_trigger()

NRFY_STATIC_INLINE void nrfy_pdm_task_trigger ( NRF_PDM_Type *  p_reg,
nrf_pdm_task_t  task 
)
See also
nrf_pdm_task_trigger Function for triggering a PDM task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskPDM task.

Documentation feedback | Developer Zone | Subscribe | Updated