![]() |
nrfx 4.5.0
|
Hardware access layer for managing the Pulse Width Modulation (PWM) peripheral. More...
Data Structures | |
| struct | nrf_pwm_values_grouped_t |
| Structure for defining duty cycle values for a sequence loaded in NRF_PWM_LOAD_GROUPED mode. More... | |
| struct | nrf_pwm_values_individual_t |
| Structure for defining duty cycle values for a sequence loaded in NRF_PWM_LOAD_INDIVIDUAL mode. More... | |
| struct | nrf_pwm_values_wave_form_t |
| Structure for defining duty cycle values for a sequence loaded in NRF_PWM_LOAD_WAVE_FORM mode. More... | |
| union | nrf_pwm_values_t |
| Union grouping pointers to arrays of duty cycle values applicable to various loading modes. More... | |
| struct | nrf_pwm_sequence_t |
| Structure for defining a sequence of PWM duty cycles. More... | |
Macros | |
| #define | NRF_PWM_HAS_DMA_REG 1 |
| Symbol indicating whether dedicated DMA register is present. | |
| #define | NRF_PWM_HAS_SHORT_LOOPSDONE_SEQSTART 1 |
| Symbol indicating whether shorting SEQSTART task with LOOPSDONE event is available. | |
| #define | NRF_PWM_HAS_DMA_TASKS_EVENTS 1 |
| Symbol indicating whether PWM DMA tasks and events are present. | |
| #define | NRF_PWM_HAS_SEQ_CNT 1 |
| Symbol indicating whether setting the number of duty cycle values for a sequence is available. | |
| #define | NRF_PWM_HAS_IDLEOUT 1 |
| Symbol indicating whether PWM has IDLEOUT register. | |
| #define | NRF_PWM_HAS_COMPAREMATCH 1 |
| Symbol indicating whether PWM has COMPAREMATCH events. | |
| #define | NRF_PWM_INST_GET(idx) |
| Macro getting pointer to the structure of registers of the PWM peripheral. | |
| #define | NRF_PWM_PIN_NOT_CONNECTED 0xFFFFFFFF |
| This value can be provided as a parameter for the nrf_pwm_pins_set function call to specify that a given output channel shall not be connected to a physical pin. | |
| #define | NRF_PWM_CHANNEL_COUNT 4 |
| Number of channels in each PWM instance. | |
| #define | NRF_PWM_VALUES_LENGTH(array) |
| Helper macro for calculating the number of 16-bit values in the specified array of duty cycle values. | |
Typedefs | |
| typedef uint16_t | nrf_pwm_values_common_t |
| Type used for defining duty cycle values for a sequence loaded in NRF_PWM_LOAD_COMMON mode. | |
Enumerations | |
| enum | nrf_pwm_task_t { NRF_PWM_TASK_STOP = offsetof(NRF_PWM_Type, TASKS_STOP) , NRF_PWM_TASK_SEQSTART0 = offsetof(NRF_PWM_Type, TASKS_DMA.SEQ[0].START) , NRF_PWM_TASK_SEQSTART1 = offsetof(NRF_PWM_Type, TASKS_DMA.SEQ[1].START) , NRF_PWM_TASK_NEXTSTEP = offsetof(NRF_PWM_Type, TASKS_NEXTSTEP) } |
| PWM tasks. More... | |
| enum | nrf_pwm_event_t { NRF_PWM_EVENT_STOPPED = offsetof(NRF_PWM_Type, EVENTS_STOPPED) , NRF_PWM_EVENT_SEQSTARTED0 = offsetof(NRF_PWM_Type, EVENTS_SEQSTARTED[0]) , NRF_PWM_EVENT_SEQSTARTED1 = offsetof(NRF_PWM_Type, EVENTS_SEQSTARTED[1]) , NRF_PWM_EVENT_SEQEND0 = offsetof(NRF_PWM_Type, EVENTS_SEQEND[0]) , NRF_PWM_EVENT_SEQEND1 = offsetof(NRF_PWM_Type, EVENTS_SEQEND[1]) , NRF_PWM_EVENT_PWMPERIODEND = offsetof(NRF_PWM_Type, EVENTS_PWMPERIODEND) , NRF_PWM_EVENT_LOOPSDONE = offsetof(NRF_PWM_Type, EVENTS_LOOPSDONE) , NRF_PWM_EVENT_COMPAREMATCH0 = offsetof(NRF_PWM_Type, EVENTS_COMPAREMATCH[0]) , NRF_PWM_EVENT_COMPAREMATCH1 = offsetof(NRF_PWM_Type, EVENTS_COMPAREMATCH[1]) , NRF_PWM_EVENT_COMPAREMATCH2 = offsetof(NRF_PWM_Type, EVENTS_COMPAREMATCH[2]) , NRF_PWM_EVENT_COMPAREMATCH3 = offsetof(NRF_PWM_Type, EVENTS_COMPAREMATCH[3]) } |
| PWM events. More... | |
| enum | nrf_pwm_int_mask_t { NRF_PWM_INT_STOPPED_MASK = PWM_INTENSET_STOPPED_Msk , NRF_PWM_INT_SEQSTARTED0_MASK = PWM_INTENSET_SEQSTARTED0_Msk , NRF_PWM_INT_SEQSTARTED1_MASK = PWM_INTENSET_SEQSTARTED1_Msk , NRF_PWM_INT_SEQEND0_MASK = PWM_INTENSET_SEQEND0_Msk , NRF_PWM_INT_SEQEND1_MASK = PWM_INTENSET_SEQEND1_Msk , NRF_PWM_INT_PWMPERIODEND_MASK = PWM_INTENSET_PWMPERIODEND_Msk , NRF_PWM_INT_LOOPSDONE_MASK = PWM_INTENSET_LOOPSDONE_Msk , NRF_PWM_INT_COMPAREMATCH0_MASK = PWM_INTENSET_COMPAREMATCH0_Msk , NRF_PWM_INT_COMPAREMATCH1_MASK = PWM_INTENSET_COMPAREMATCH1_Msk , NRF_PWM_INT_COMPAREMATCH2_MASK = PWM_INTENSET_COMPAREMATCH2_Msk , NRF_PWM_INT_COMPAREMATCH3_MASK = PWM_INTENSET_COMPAREMATCH3_Msk } |
| PWM interrupts. More... | |
| enum | nrf_pwm_short_mask_t { NRF_PWM_SHORT_SEQEND0_STOP_MASK = PWM_SHORTS_SEQEND0_STOP_Msk , NRF_PWM_SHORT_SEQEND1_STOP_MASK = PWM_SHORTS_SEQEND1_STOP_Msk , NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK = PWM_SHORTS_LOOPSDONE_SEQSTART0_Msk , NRF_PWM_SHORT_LOOPSDONE_SEQSTART1_MASK = PWM_SHORTS_LOOPSDONE_SEQSTART1_Msk , NRF_PWM_SHORT_LOOPSDONE_STOP_MASK = PWM_SHORTS_LOOPSDONE_STOP_Msk } |
| PWM shortcuts. More... | |
| enum | nrf_pwm_mode_t { NRF_PWM_MODE_UP = PWM_MODE_UPDOWN_Up , NRF_PWM_MODE_UP_AND_DOWN = PWM_MODE_UPDOWN_UpAndDown } |
| PWM modes of operation. More... | |
| enum | nrf_pwm_clk_t { NRF_PWM_CLK_16MHz = PWM_PRESCALER_PRESCALER_DIV_1 , NRF_PWM_CLK_8MHz = PWM_PRESCALER_PRESCALER_DIV_2 , NRF_PWM_CLK_4MHz = PWM_PRESCALER_PRESCALER_DIV_4 , NRF_PWM_CLK_2MHz = PWM_PRESCALER_PRESCALER_DIV_8 , NRF_PWM_CLK_1MHz = PWM_PRESCALER_PRESCALER_DIV_16 , NRF_PWM_CLK_500kHz = PWM_PRESCALER_PRESCALER_DIV_32 , NRF_PWM_CLK_250kHz = PWM_PRESCALER_PRESCALER_DIV_64 , NRF_PWM_CLK_125kHz = PWM_PRESCALER_PRESCALER_DIV_128 } |
| PWM base clock frequencies. More... | |
| enum | nrf_pwm_dec_load_t { NRF_PWM_LOAD_COMMON = PWM_DECODER_LOAD_Common , NRF_PWM_LOAD_GROUPED = PWM_DECODER_LOAD_Grouped , NRF_PWM_LOAD_INDIVIDUAL = PWM_DECODER_LOAD_Individual , NRF_PWM_LOAD_WAVE_FORM = PWM_DECODER_LOAD_WaveForm } |
| PWM decoder load modes. More... | |
| enum | nrf_pwm_dec_step_t { NRF_PWM_STEP_AUTO = PWM_DECODER_MODE_RefreshCount , NRF_PWM_STEP_TRIGGERED = PWM_DECODER_MODE_NextStep } |
| PWM decoder next step modes. More... | |
Functions | |
| NRF_STATIC_INLINE void | nrf_pwm_task_trigger (NRF_PWM_Type *p_reg, nrf_pwm_task_t task) |
| Function for activating the specified PWM task. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_task_address_get (NRF_PWM_Type const *p_reg, nrf_pwm_task_t task) |
| Function for getting the address of the specified PWM task register. | |
| NRF_STATIC_INLINE void | nrf_pwm_event_clear (NRF_PWM_Type *p_reg, nrf_pwm_event_t event) |
| Function for clearing the specified PWM event. | |
| NRF_STATIC_INLINE bool | nrf_pwm_event_check (NRF_PWM_Type const *p_reg, nrf_pwm_event_t event) |
| Function for retrieving the state of the PWM event. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_event_address_get (NRF_PWM_Type const *p_reg, nrf_pwm_event_t event) |
| Function for getting the address of the specified PWM event register. | |
| NRF_STATIC_INLINE void | nrf_pwm_shorts_enable (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for enabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_pwm_shorts_disable (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for disabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_pwm_shorts_set (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for setting the configuration of PWM shortcuts. | |
| NRF_STATIC_INLINE void | nrf_pwm_int_enable (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for enabling specified interrupts. | |
| NRF_STATIC_INLINE void | nrf_pwm_int_disable (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for disabling specified interrupts. | |
| NRF_STATIC_INLINE void | nrf_pwm_int_set (NRF_PWM_Type *p_reg, uint32_t mask) |
| Function for setting the configuration of PWM interrupts. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_int_enable_check (NRF_PWM_Type const *p_reg, uint32_t mask) |
| Function for checking if the specified interrupts are enabled. | |
| NRF_STATIC_INLINE void | nrf_pwm_subscribe_set (NRF_PWM_Type *p_reg, nrf_pwm_task_t task, uint8_t channel) |
| Function for setting the subscribe configuration for a given PWM task. | |
| NRF_STATIC_INLINE void | nrf_pwm_subscribe_clear (NRF_PWM_Type *p_reg, nrf_pwm_task_t task) |
| Function for clearing the subscribe configuration for a given PWM task. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_subscribe_get (NRF_PWM_Type const *p_reg, nrf_pwm_task_t task) |
| Function for getting the subscribe configuration for a given PWM task. | |
| NRF_STATIC_INLINE void | nrf_pwm_publish_set (NRF_PWM_Type *p_reg, nrf_pwm_event_t event, uint8_t channel) |
| Function for setting the publish configuration for a given PWM event. | |
| NRF_STATIC_INLINE void | nrf_pwm_publish_clear (NRF_PWM_Type *p_reg, nrf_pwm_event_t event) |
| Function for clearing the publish configuration for a given PWM event. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_publish_get (NRF_PWM_Type const *p_reg, nrf_pwm_event_t event) |
| Function for getting the publish configuration for a given PWM event. | |
| NRF_STATIC_INLINE void | nrf_pwm_enable (NRF_PWM_Type *p_reg) |
| Function for enabling the PWM peripheral. | |
| NRF_STATIC_INLINE void | nrf_pwm_disable (NRF_PWM_Type *p_reg) |
| Function for disabling the PWM peripheral. | |
| NRF_STATIC_INLINE bool | nrf_pwm_enable_check (NRF_PWM_Type const *p_reg) |
| Function for checking if the PWM peripheral is enabled. | |
| NRF_STATIC_INLINE void | nrf_pwm_pins_set (NRF_PWM_Type *p_reg, uint32_t const out_pins[4]) |
| Function for assigning pins to PWM output channels. | |
| NRF_STATIC_INLINE void | nrf_pwm_pin_set (NRF_PWM_Type *p_reg, uint8_t channel, uint32_t pin) |
| Function for setting pin associated with specified PWM output channel. | |
| NRF_STATIC_INLINE uint32_t | nrf_pwm_pin_get (NRF_PWM_Type const *p_reg, uint8_t channel) |
| Function for getting pin selection associated with specified PWM output channel. | |
| NRF_STATIC_INLINE void | nrf_pwm_configure (NRF_PWM_Type *p_reg, nrf_pwm_clk_t base_clock, nrf_pwm_mode_t mode, uint16_t top_value) |
| Function for configuring the PWM peripheral. | |
| NRF_STATIC_INLINE void | nrf_pwm_sequence_set (NRF_PWM_Type *p_reg, uint8_t seq_id, nrf_pwm_sequence_t const *p_seq) |
| Function for defining a sequence of PWM duty cycles. | |
| NRF_STATIC_INLINE void | nrf_pwm_seq_ptr_set (NRF_PWM_Type *p_reg, uint8_t seq_id, uint16_t const *p_values) |
| Function for modifying the pointer to the duty cycle values in the specified sequence. | |
| NRF_STATIC_INLINE void | nrf_pwm_seq_cnt_set (NRF_PWM_Type *p_reg, uint8_t seq_id, uint16_t length) |
| Function for modifying the total number of duty cycle values in the specified sequence. | |
| NRF_STATIC_INLINE void | nrf_pwm_seq_refresh_set (NRF_PWM_Type *p_reg, uint8_t seq_id, uint32_t refresh) |
| Function for modifying the additional number of PWM periods spent on each duty cycle value in the specified sequence. | |
| NRF_STATIC_INLINE void | nrf_pwm_seq_end_delay_set (NRF_PWM_Type *p_reg, uint8_t seq_id, uint32_t end_delay) |
| Function for modifying the additional time added after the sequence is played. | |
| NRF_STATIC_INLINE void | nrf_pwm_decoder_set (NRF_PWM_Type *p_reg, nrf_pwm_dec_load_t dec_load, nrf_pwm_dec_step_t dec_step) |
| Function for setting the mode of loading sequence data from RAM and advancing the sequence. | |
| NRF_STATIC_INLINE void | nrf_pwm_loop_set (NRF_PWM_Type *p_reg, uint16_t loop_count) |
| Function for setting the number of times the sequence playback should be performed. | |
| NRF_STATIC_INLINE nrf_pwm_task_t | nrf_pwm_seqstart_task_get (uint8_t seq_id) |
| Function for getting the specified PWM SEQSTART task. | |
| NRF_STATIC_INLINE nrf_pwm_event_t | nrf_pwm_seqend_event_get (uint8_t seq_id) |
| Function for getting the specified PWM SEQEND event. | |
| NRF_STATIC_INLINE void | nrf_pwm_channel_idle_set (NRF_PWM_Type *p_reg, uint8_t channel, bool value) |
| Function for setting the output value of specified channel while PDM is idle. | |
| NRF_STATIC_INLINE bool | nrf_pwm_channel_idle_get (NRF_PWM_Type const *p_reg, uint8_t channel) |
| Function for getting the output value of specified channel while PDM is idle. | |
Hardware access layer for managing the Pulse Width Modulation (PWM) peripheral.
| #define NRF_PWM_INST_GET | ( | idx | ) |
Macro getting pointer to the structure of registers of the PWM peripheral.
| [in] | idx | PWM instance index. |
| #define NRF_PWM_VALUES_LENGTH | ( | array | ) |
Helper macro for calculating the number of 16-bit values in the specified array of duty cycle values.
| enum nrf_pwm_clk_t |
PWM base clock frequencies.
| enum nrf_pwm_dec_load_t |
PWM decoder load modes.
The selected mode determines how the sequence data is read from RAM and spread to the compare registers.
| enum nrf_pwm_dec_step_t |
PWM decoder next step modes.
The selected mode determines when the next value from the active sequence is loaded.
| Enumerator | |
|---|---|
| NRF_PWM_STEP_AUTO | Automatically after the current value is played and repeated the requested number of times. |
| NRF_PWM_STEP_TRIGGERED | When the NRF_PWM_TASK_NEXTSTEP task is triggered. |
| enum nrf_pwm_event_t |
PWM events.
| enum nrf_pwm_int_mask_t |
PWM interrupts.
| enum nrf_pwm_mode_t |
| enum nrf_pwm_short_mask_t |
PWM shortcuts.
| enum nrf_pwm_task_t |
PWM tasks.
| Enumerator | |
|---|---|
| NRF_PWM_TASK_STOP | Stops PWM pulse generation on all channels at the end of the current PWM period, and stops the sequence playback. |
| NRF_PWM_TASK_SEQSTART0 | Starts playback of sequence 0. |
| NRF_PWM_TASK_SEQSTART1 | Starts playback of sequence 1. |
| NRF_PWM_TASK_NEXTSTEP | Steps by one value in the current sequence if the decoder is set to NRF_PWM_STEP_TRIGGERED mode. |
| NRF_STATIC_INLINE bool nrf_pwm_channel_idle_get | ( | NRF_PWM_Type const * | p_reg, |
| uint8_t | channel ) |
Function for getting the output value of specified channel while PDM is idle.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | channel | PWM output channel. |
| true | Idle output value is high. |
| false | Idle output value is low. |
| NRF_STATIC_INLINE void nrf_pwm_channel_idle_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | channel, | ||
| bool | value ) |
Function for setting the output value of specified channel while PDM is idle.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | channel | PWM output channel. |
| [in] | value | If true, idle output will be high. If false, it will be low. |
| NRF_STATIC_INLINE void nrf_pwm_configure | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_clk_t | base_clock, | ||
| nrf_pwm_mode_t | mode, | ||
| uint16_t | top_value ) |
Function for configuring the PWM peripheral.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_decoder_set | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_dec_load_t | dec_load, | ||
| nrf_pwm_dec_step_t | dec_step ) |
Function for setting the mode of loading sequence data from RAM and advancing the sequence.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_disable | ( | NRF_PWM_Type * | p_reg | ) |
Function for disabling the PWM peripheral.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_pwm_enable | ( | NRF_PWM_Type * | p_reg | ) |
Function for enabling the PWM peripheral.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE bool nrf_pwm_enable_check | ( | NRF_PWM_Type const * | p_reg | ) |
Function for checking if the PWM peripheral is enabled.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| true | The PWM is enabled. |
| false | The PWM is not enabled. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_event_address_get | ( | NRF_PWM_Type const * | p_reg, |
| nrf_pwm_event_t | event ) |
Function for getting the address of the specified PWM event register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | PWM event. |
| NRF_STATIC_INLINE bool nrf_pwm_event_check | ( | NRF_PWM_Type const * | p_reg, |
| nrf_pwm_event_t | event ) |
Function for retrieving the state of the PWM 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. |
| NRF_STATIC_INLINE void nrf_pwm_event_clear | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_event_t | event ) |
Function for clearing the specified PWM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to clear. |
| NRF_STATIC_INLINE void nrf_pwm_int_disable | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling specified interrupts.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_int_enable | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling specified interrupts.
| [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. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_int_enable_check | ( | NRF_PWM_Type const * | p_reg, |
| uint32_t | mask ) |
Function for checking if the specified interrupts are enabled.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_int_set | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for setting the configuration of PWM interrupts.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_loop_set | ( | NRF_PWM_Type * | p_reg, |
| uint16_t | loop_count ) |
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.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | loop_count | Number of times to perform the sequence playback. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_pin_get | ( | NRF_PWM_Type const * | p_reg, |
| uint8_t | channel ) |
Function for getting pin selection associated with specified PWM output channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | channel | PWM output channel. |
| NRF_STATIC_INLINE void nrf_pwm_pin_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | channel, | ||
| uint32_t | pin ) |
Function for setting pin associated with specified PWM output channel.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | channel | PWM output channel. |
| [in] | pin | PWM output pin associated with specified PWM output channel. |
| NRF_STATIC_INLINE void nrf_pwm_pins_set | ( | NRF_PWM_Type * | p_reg, |
| uint32_t const | out_pins[4] ) |
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.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | out_pins | Array with pin numbers for individual PWM output channels. |
| NRF_STATIC_INLINE void nrf_pwm_publish_clear | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_event_t | event ) |
Function for clearing the publish configuration for a given PWM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_publish_get | ( | NRF_PWM_Type const * | p_reg, |
| nrf_pwm_event_t | event ) |
Function for getting the publish configuration for a given PWM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_pwm_publish_set | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_event_t | event, | ||
| uint8_t | channel ) |
Function for setting the publish configuration for a given PWM event.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_seq_cnt_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | seq_id, | ||
| uint16_t | length ) |
Function for modifying the total number of duty cycle values in the specified sequence.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | seq_id | Identifier of the sequence (0 or 1). |
| [in] | length | Number of duty cycle values (in 16-bit half words). |
| NRF_STATIC_INLINE void nrf_pwm_seq_end_delay_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | seq_id, | ||
| uint32_t | end_delay ) |
Function for modifying the additional time added after the sequence is played.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | seq_id | Identifier of the sequence (0 or 1). |
| [in] | end_delay | Number of PWM periods added at the end of the sequence. |
| NRF_STATIC_INLINE void nrf_pwm_seq_ptr_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | seq_id, | ||
| uint16_t const * | p_values ) |
Function for modifying the pointer to the duty cycle values in the specified sequence.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | seq_id | Identifier of the sequence (0 or 1). |
| [in] | p_values | Pointer to an array with duty cycle values. |
| NRF_STATIC_INLINE void nrf_pwm_seq_refresh_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | seq_id, | ||
| uint32_t | refresh ) |
Function for modifying the additional number of PWM periods spent on each duty cycle value in the specified sequence.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | seq_id | Identifier of the sequence (0 or 1). |
| [in] | refresh | Number of additional PWM periods for each duty cycle value. |
| NRF_STATIC_INLINE nrf_pwm_event_t nrf_pwm_seqend_event_get | ( | uint8_t | seq_id | ) |
Function for getting the specified PWM SEQEND event.
| [in] | seq_id | Sequence index. |
| NRF_STATIC_INLINE nrf_pwm_task_t nrf_pwm_seqstart_task_get | ( | uint8_t | seq_id | ) |
Function for getting the specified PWM SEQSTART task.
| [in] | seq_id | Sequence index. |
| NRF_STATIC_INLINE void nrf_pwm_sequence_set | ( | NRF_PWM_Type * | p_reg, |
| uint8_t | seq_id, | ||
| nrf_pwm_sequence_t const * | p_seq ) |
Function for defining a sequence of PWM duty cycles.
| [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. |
| NRF_STATIC_INLINE void nrf_pwm_shorts_disable | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of shortcuts to be disabled. |
| NRF_STATIC_INLINE void nrf_pwm_shorts_enable | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of shortcuts to be enabled. |
| NRF_STATIC_INLINE void nrf_pwm_shorts_set | ( | NRF_PWM_Type * | p_reg, |
| uint32_t | mask ) |
Function for setting the configuration of PWM shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts configuration to be set. |
| NRF_STATIC_INLINE void nrf_pwm_subscribe_clear | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_task_t | task ) |
Function for clearing the subscribe configuration for a given PWM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_subscribe_get | ( | NRF_PWM_Type const * | p_reg, |
| nrf_pwm_task_t | task ) |
Function for getting the subscribe configuration for a given PWM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_pwm_subscribe_set | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_task_t | task, | ||
| uint8_t | channel ) |
Function for setting the subscribe configuration for a given PWM task.
| [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. |
| NRF_STATIC_INLINE uint32_t nrf_pwm_task_address_get | ( | NRF_PWM_Type const * | p_reg, |
| nrf_pwm_task_t | task ) |
Function for getting the address of the specified PWM task register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | PWM task. |
| NRF_STATIC_INLINE void nrf_pwm_task_trigger | ( | NRF_PWM_Type * | p_reg, |
| nrf_pwm_task_t | task ) |
Function for activating the specified PWM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task to be activated. |