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) |
Hardware access layer with cache and barrier support for managing the PWM peripheral.
NRFY_STATIC_INLINE void nrfy_pwm_abort | ( | NRF_PWM_Type * | p_reg, |
bool | wait | ||
) |
Function for aborting the ongoing PWM sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | wait | True if the abort is to be blocking, false otherwise. |
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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | base_clock | Base clock frequency. |
[in] | mode | Operating mode of the pulse generator counter. |
[in] | top_value | Value up to which the pulse generator counter counts. |
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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | dec_load | Mode of loading sequence data from RAM. |
[in] | dec_step | Mode of advancing the active sequence. |
NRFY_STATIC_INLINE void nrfy_pwm_disable | ( | NRF_PWM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pwm_enable | ( | NRF_PWM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE bool nrfy_pwm_enable_check | ( | NRF_PWM_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | The PWM is enabled. |
false | The PWM is not enabled. |
NRFY_STATIC_INLINE uint32_t nrfy_pwm_event_address_get | ( | NRF_PWM_Type const * | p_reg, |
nrf_pwm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | PWM event. |
NRFY_STATIC_INLINE bool nrfy_pwm_event_check | ( | NRF_PWM_Type const * | p_reg, |
nrf_pwm_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_pwm_event_clear | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to clear. |
NRFY_STATIC_INLINE uint32_t nrfy_pwm_events_process | ( | NRF_PWM_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for processing the specified PWM 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. |
NRFY_STATIC_INLINE void nrfy_pwm_int_disable | ( | NRF_PWM_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_pwm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_pwm_int_enable | ( | NRF_PWM_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_pwm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE uint32_t nrfy_pwm_int_enable_check | ( | NRF_PWM_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_pwm_int_mask_t values for bit masking. |
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.
[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 interrupts are to be enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_pwm_int_set | ( | NRF_PWM_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 set. Use nrf_pwm_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_pwm_int_uninit | ( | NRF_PWM_Type * | p_reg | ) |
Function for uninitializing the PWM interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_pwm_loop_set | ( | NRF_PWM_Type * | p_reg, |
uint16_t | loop_count | ||
) |
This function applies to two-sequence playback (concatenated sequence 0 and 1). A single sequence can be played back only once.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | loop_count | Number of times to perform the sequence playback. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Pointer to the peripheral configuration structure. |
NRFY_STATIC_INLINE uint32_t nrfy_pwm_pin_get | ( | NRF_PWM_Type const * | p_reg, |
uint8_t | channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | channel | PWM output channel. |
NRFY_STATIC_INLINE void nrfy_pwm_pins_set | ( | NRF_PWM_Type * | p_reg, |
uint32_t | out_pins[NRF_PWM_CHANNEL_COUNT] | ||
) |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | out_pins | Array with pin numbers for individual PWM output channels. |
NRFY_STATIC_INLINE void nrfy_pwm_publish_clear | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_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_pwm_publish_set | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_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 nrf_pwm_event_t nrfy_pwm_seqend_event_get | ( | uint8_t | seq_id | ) |
[in] | seq_id | Sequence index. |
NRFY_STATIC_INLINE nrf_pwm_task_t nrfy_pwm_seqstart_task_get | ( | uint8_t | seq_id | ) |
[in] | seq_id | Sequence index. |
NRFY_STATIC_INLINE void nrfy_pwm_sequence_set | ( | NRF_PWM_Type * | p_reg, |
uint8_t | seq_id, | ||
nrf_pwm_sequence_t const * | p_seq | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | seq_id | Identifier of the sequence (0 or 1). |
[in] | p_seq | Pointer to the sequence definition. |
NRFY_STATIC_INLINE void nrfy_pwm_shorts_disable | ( | NRF_PWM_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of shortcuts to be disabled. |
NRFY_STATIC_INLINE void nrfy_pwm_shorts_enable | ( | NRF_PWM_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of shortcuts to be enabled. |
NRFY_STATIC_INLINE void nrfy_pwm_shorts_set | ( | NRF_PWM_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Shortcuts configuration to be set. |
NRFY_STATIC_INLINE void nrfy_pwm_start | ( | NRF_PWM_Type * | p_reg, |
uint8_t | seq_id, | ||
bool | wait | ||
) |
Function for starting the PWM sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | seq_id | Sequence index. |
[in] | wait | True if the sequence is to be blocking, false otherwise. |
NRFY_STATIC_INLINE void nrfy_pwm_subscribe_clear | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_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_pwm_subscribe_set | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_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_pwm_task_address_get | ( | NRF_PWM_Type const * | p_reg, |
nrf_pwm_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | PWM task. |
NRFY_STATIC_INLINE void nrfy_pwm_task_trigger | ( | NRF_PWM_Type * | p_reg, |
nrf_pwm_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task to be activated. |