nrfx 3.3
Data Structures | Functions
PWM HALY

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

Data Structures

struct  nrfy_pwm_config_t
 PWM configuration structure. More...
 

Functions

NRFY_STATIC_INLINE void nrfy_pwm_periph_configure (NRF_PWM_Type *p_reg, nrfy_pwm_config_t const *p_config)
 Function for configuring the PWM.
 
NRFY_STATIC_INLINE void nrfy_pwm_int_init (NRF_PWM_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable)
 Function for initializing the specified PWM interrupts.
 
NRFY_STATIC_INLINE void nrfy_pwm_int_uninit (NRF_PWM_Type *p_reg)
 Function for uninitializing the PWM interrupts.
 
NRFY_STATIC_INLINE uint32_t nrfy_pwm_events_process (NRF_PWM_Type *p_reg, uint32_t mask)
 Function for processing the specified PWM events.
 
NRFY_STATIC_INLINE void nrfy_pwm_start (NRF_PWM_Type *p_reg, uint8_t seq_id, bool wait)
 Function for starting the PWM sequence.
 
NRFY_STATIC_INLINE void nrfy_pwm_abort (NRF_PWM_Type *p_reg, bool wait)
 Function for aborting the ongoing PWM sequence.
 
NRFY_STATIC_INLINE void nrfy_pwm_task_trigger (NRF_PWM_Type *p_reg, nrf_pwm_task_t task)
 
NRFY_STATIC_INLINE uint32_t nrfy_pwm_task_address_get (NRF_PWM_Type const *p_reg, nrf_pwm_task_t task)
 
NRFY_STATIC_INLINE void nrfy_pwm_event_clear (NRF_PWM_Type *p_reg, nrf_pwm_event_t event)
 
NRFY_STATIC_INLINE bool nrfy_pwm_event_check (NRF_PWM_Type const *p_reg, nrf_pwm_event_t event)
 
NRFY_STATIC_INLINE uint32_t nrfy_pwm_event_address_get (NRF_PWM_Type const *p_reg, nrf_pwm_event_t event)
 
NRFY_STATIC_INLINE void nrfy_pwm_shorts_enable (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_shorts_disable (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_shorts_set (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_int_enable (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_int_disable (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_int_set (NRF_PWM_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE uint32_t nrfy_pwm_int_enable_check (NRF_PWM_Type const *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_pwm_subscribe_set (NRF_PWM_Type *p_reg, nrf_pwm_task_t task, uint8_t channel)
 
NRFY_STATIC_INLINE void nrfy_pwm_subscribe_clear (NRF_PWM_Type *p_reg, nrf_pwm_task_t task)
 
NRFY_STATIC_INLINE void nrfy_pwm_publish_set (NRF_PWM_Type *p_reg, nrf_pwm_event_t event, uint8_t channel)
 
NRFY_STATIC_INLINE void nrfy_pwm_publish_clear (NRF_PWM_Type *p_reg, nrf_pwm_event_t event)
 
NRFY_STATIC_INLINE void nrfy_pwm_enable (NRF_PWM_Type *p_reg)
 
NRFY_STATIC_INLINE void nrfy_pwm_disable (NRF_PWM_Type *p_reg)
 
NRFY_STATIC_INLINE bool nrfy_pwm_enable_check (NRF_PWM_Type *p_reg)
 
NRFY_STATIC_INLINE void nrfy_pwm_pins_set (NRF_PWM_Type *p_reg, uint32_t out_pins[NRF_PWM_CHANNEL_COUNT])
 
NRFY_STATIC_INLINE uint32_t nrfy_pwm_pin_get (NRF_PWM_Type const *p_reg, uint8_t channel)
 
NRFY_STATIC_INLINE void nrfy_pwm_configure (NRF_PWM_Type *p_reg, nrf_pwm_clk_t base_clock, nrf_pwm_mode_t mode, uint16_t top_value)
 
NRFY_STATIC_INLINE void nrfy_pwm_sequence_set (NRF_PWM_Type *p_reg, uint8_t seq_id, nrf_pwm_sequence_t const *p_seq)
 
NRFY_STATIC_INLINE void nrfy_pwm_decoder_set (NRF_PWM_Type *p_reg, nrf_pwm_dec_load_t dec_load, nrf_pwm_dec_step_t dec_step)
 
NRFY_STATIC_INLINE void nrfy_pwm_loop_set (NRF_PWM_Type *p_reg, uint16_t loop_count)
 
NRFY_STATIC_INLINE nrf_pwm_task_t nrfy_pwm_seqstart_task_get (uint8_t seq_id)
 
NRFY_STATIC_INLINE nrf_pwm_event_t nrfy_pwm_seqend_event_get (uint8_t seq_id)
 

Detailed Description

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

Function Documentation

◆ nrfy_pwm_abort()

NRFY_STATIC_INLINE void nrfy_pwm_abort ( NRF_PWM_Type *  p_reg,
bool  wait 
)

Function for aborting the ongoing PWM sequence.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]waitTrue if the abort is to be blocking, false otherwise.

◆ nrfy_pwm_configure()

NRFY_STATIC_INLINE void nrfy_pwm_configure ( NRF_PWM_Type *  p_reg,
nrf_pwm_clk_t  base_clock,
nrf_pwm_mode_t  mode,
uint16_t  top_value 
)
See also
nrf_pwm_configure Function for configuring the PWM peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]base_clockBase clock frequency.
[in]modeOperating mode of the pulse generator counter.
[in]top_valueValue up to which the pulse generator counter counts.

◆ nrfy_pwm_decoder_set()

NRFY_STATIC_INLINE void nrfy_pwm_decoder_set ( NRF_PWM_Type *  p_reg,
nrf_pwm_dec_load_t  dec_load,
nrf_pwm_dec_step_t  dec_step 
)
See also
nrf_pwm_decoder_set Function for setting the mode of loading sequence data from RAM and advancing the sequence.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]dec_loadMode of loading sequence data from RAM.
[in]dec_stepMode of advancing the active sequence.

◆ nrfy_pwm_disable()

NRFY_STATIC_INLINE void nrfy_pwm_disable ( NRF_PWM_Type *  p_reg)
See also
nrf_pwm_disable Function for disabling the PWM peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_pwm_enable()

NRFY_STATIC_INLINE void nrfy_pwm_enable ( NRF_PWM_Type *  p_reg)
See also
nrf_pwm_enable Function for enabling the PWM peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_pwm_enable_check()

NRFY_STATIC_INLINE bool nrfy_pwm_enable_check ( NRF_PWM_Type *  p_reg)
See also
nrf_pwm_enable_check Function for checking if the PWM peripheral is enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe PWM is enabled.
falseThe PWM is not enabled.

◆ nrfy_pwm_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_pwm_event_address_get ( NRF_PWM_Type const *  p_reg,
nrf_pwm_event_t  event 
)
See also
nrf_pwm_event_address_get Function for getting the address of the specified PWM event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventPWM event.
Returns
Address of the specified event register.

◆ nrfy_pwm_event_check()

NRFY_STATIC_INLINE bool nrfy_pwm_event_check ( NRF_PWM_Type const *  p_reg,
nrf_pwm_event_t  event 
)
See also
nrf_pwm_event_check Function for retrieving the state of the PWM 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_pwm_event_clear()

NRFY_STATIC_INLINE void nrfy_pwm_event_clear ( NRF_PWM_Type *  p_reg,
nrf_pwm_event_t  event 
)
See also
nrf_pwm_event_clear Function for clearing the specified PWM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to clear.

◆ nrfy_pwm_events_process()

NRFY_STATIC_INLINE uint32_t nrfy_pwm_events_process ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)

Function for processing the specified PWM 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.
Returns
Mask of events that were generated and processed. To be checked against the result of NRFY_EVENT_TO_INT_BITMASK().

◆ nrfy_pwm_int_disable()

NRFY_STATIC_INLINE void nrfy_pwm_int_disable ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_int_disable Function for disabling specified interrupts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_pwm_int_mask_t values for bit masking.

◆ nrfy_pwm_int_enable()

NRFY_STATIC_INLINE void nrfy_pwm_int_enable ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_int_enable Function for enabling specified interrupts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_pwm_int_mask_t values for bit masking.

◆ nrfy_pwm_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_pwm_int_enable_check ( NRF_PWM_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_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_pwm_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_pwm_int_init()

NRFY_STATIC_INLINE void nrfy_pwm_int_init ( NRF_PWM_Type *  p_reg,
uint32_t  mask,
uint8_t  irq_priority,
bool  enable 
)

Function for initializing the specified PWM 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 interrupts are to be enabled, false otherwise.

◆ nrfy_pwm_int_set()

NRFY_STATIC_INLINE void nrfy_pwm_int_set ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_int_set Function for setting the configuration of PWM interrupts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be set. Use nrf_pwm_int_mask_t values for bit masking.

◆ nrfy_pwm_int_uninit()

NRFY_STATIC_INLINE void nrfy_pwm_int_uninit ( NRF_PWM_Type *  p_reg)

Function for uninitializing the PWM interrupts.

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

◆ nrfy_pwm_loop_set()

NRFY_STATIC_INLINE void nrfy_pwm_loop_set ( NRF_PWM_Type *  p_reg,
uint16_t  loop_count 
)
See also
nrf_pwm_loop_set Function for setting the number of times the sequence playback should be performed.

This function applies to two-sequence playback (concatenated sequence 0 and 1). A single sequence can be played back only once.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]loop_countNumber of times to perform the sequence playback.

◆ nrfy_pwm_periph_configure()

NRFY_STATIC_INLINE void nrfy_pwm_periph_configure ( NRF_PWM_Type *  p_reg,
nrfy_pwm_config_t const *  p_config 
)

Function for configuring the PWM.

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

◆ nrfy_pwm_pin_get()

NRFY_STATIC_INLINE uint32_t nrfy_pwm_pin_get ( NRF_PWM_Type const *  p_reg,
uint8_t  channel 
)
See also
nrf_pwm_pin_get Function for getting pin selection associated with specified PWM output channel.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]channelPWM output channel.
Returns
Pin selection associated with specified PWM output channel.

◆ nrfy_pwm_pins_set()

NRFY_STATIC_INLINE void nrfy_pwm_pins_set ( NRF_PWM_Type *  p_reg,
uint32_t  out_pins[NRF_PWM_CHANNEL_COUNT] 
)
See also
nrf_pwm_pins_set Function for assigning pins to PWM output channels.

Usage of all PWM output channels is optional. If a given channel is not needed, pass the NRF_PWM_PIN_NOT_CONNECTED value instead of its pin number.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]out_pinsArray with pin numbers for individual PWM output channels.

◆ nrfy_pwm_publish_clear()

NRFY_STATIC_INLINE void nrfy_pwm_publish_clear ( NRF_PWM_Type *  p_reg,
nrf_pwm_event_t  event 
)
See also
nrf_pwm_publish_clear Function for clearing the publish configuration for a given PWM event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrfy_pwm_publish_set()

NRFY_STATIC_INLINE void nrfy_pwm_publish_set ( NRF_PWM_Type *  p_reg,
nrf_pwm_event_t  event,
uint8_t  channel 
)
See also
nrf_pwm_publish_set Function for setting the publish configuration for a given PWM 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_pwm_seqend_event_get()

NRFY_STATIC_INLINE nrf_pwm_event_t nrfy_pwm_seqend_event_get ( uint8_t  seq_id)
See also
nrf_pwm_seqend_event_get Function for getting the specified PWM SEQEND event.
Parameters
[in]seq_idSequence index.
Returns
The specified PWM SEQEND event.

◆ nrfy_pwm_seqstart_task_get()

NRFY_STATIC_INLINE nrf_pwm_task_t nrfy_pwm_seqstart_task_get ( uint8_t  seq_id)
See also
nrf_pwm_seqstart_task_get Function for getting the specified PWM SEQSTART task.
Parameters
[in]seq_idSequence index.
Returns
The specified PWM SEQSTART task.

◆ nrfy_pwm_sequence_set()

NRFY_STATIC_INLINE void nrfy_pwm_sequence_set ( NRF_PWM_Type *  p_reg,
uint8_t  seq_id,
nrf_pwm_sequence_t const *  p_seq 
)
See also
nrf_pwm_sequence_set Function for defining a sequence of PWM duty cycles.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]seq_idIdentifier of the sequence (0 or 1).
[in]p_seqPointer to the sequence definition.

◆ nrfy_pwm_shorts_disable()

NRFY_STATIC_INLINE void nrfy_pwm_shorts_disable ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_shorts_disable Function for disabling the specified shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts to be disabled.

◆ nrfy_pwm_shorts_enable()

NRFY_STATIC_INLINE void nrfy_pwm_shorts_enable ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_shorts_enable Function for enabling the specified shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts to be enabled.

◆ nrfy_pwm_shorts_set()

NRFY_STATIC_INLINE void nrfy_pwm_shorts_set ( NRF_PWM_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_pwm_shorts_set Function for setting the configuration of PWM shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskShortcuts configuration to be set.

◆ nrfy_pwm_start()

NRFY_STATIC_INLINE void nrfy_pwm_start ( NRF_PWM_Type *  p_reg,
uint8_t  seq_id,
bool  wait 
)

Function for starting the PWM sequence.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]seq_idSequence index.
[in]waitTrue if the sequence is to be blocking, false otherwise.

◆ nrfy_pwm_subscribe_clear()

NRFY_STATIC_INLINE void nrfy_pwm_subscribe_clear ( NRF_PWM_Type *  p_reg,
nrf_pwm_task_t  task 
)
See also
nrf_pwm_subscribe_clear Function for clearing the subscribe configuration for a given PWM task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrfy_pwm_subscribe_set()

NRFY_STATIC_INLINE void nrfy_pwm_subscribe_set ( NRF_PWM_Type *  p_reg,
nrf_pwm_task_t  task,
uint8_t  channel 
)
See also
nrf_pwm_subscribe_set Function for setting the subscribe configuration for a given PWM 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_pwm_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_pwm_task_address_get ( NRF_PWM_Type const *  p_reg,
nrf_pwm_task_t  task 
)
See also
nrf_pwm_task_address_get Function for getting the address of the specified PWM task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskPWM task.
Returns
Address of the specified task register.

◆ nrfy_pwm_task_trigger()

NRFY_STATIC_INLINE void nrfy_pwm_task_trigger ( NRF_PWM_Type *  p_reg,
nrf_pwm_task_t  task 
)
See also
nrf_pwm_task_trigger Function for activating the specified PWM task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

Documentation feedback | Developer Zone | Subscribe | Updated