Hardware access layer with cache and barrier support for managing the TIMER peripheral. More...
Data Structures | |
struct | nrfy_timer_config_t |
TIMER configuration structure. More... | |
Macros | |
#define | NRFY_TIMER_HAS_ONE_SHOT 1 |
Functions | |
NRFY_STATIC_INLINE void | nrfy_timer_periph_configure (NRF_TIMER_Type *p_reg, nrfy_timer_config_t const *p_config) |
Function for configuring the TIMER. | |
NRFY_STATIC_INLINE void | nrfy_timer_int_init (NRF_TIMER_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable) |
Function for initializing the specified TIMER interrupts. | |
NRFY_STATIC_INLINE void | nrfy_timer_int_uninit (NRF_TIMER_Type *p_reg) |
Function for uninitializing the TIMER interrupts. | |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_events_process (NRF_TIMER_Type *p_reg, uint32_t mask) |
Function for processing the specified TIMER events. | |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_capture_get (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t channel) |
Function for capturing the TIMER value. | |
NRFY_STATIC_INLINE void | nrfy_timer_task_trigger (NRF_TIMER_Type *p_reg, nrf_timer_task_t task) |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_task_address_get (NRF_TIMER_Type const *p_reg, nrf_timer_task_t task) |
NRFY_STATIC_INLINE void | nrfy_timer_event_clear (NRF_TIMER_Type *p_reg, nrf_timer_event_t event) |
NRFY_STATIC_INLINE bool | nrfy_timer_event_check (NRF_TIMER_Type const *p_reg, nrf_timer_event_t event) |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_event_address_get (NRF_TIMER_Type const *p_reg, nrf_timer_event_t event) |
NRFY_STATIC_INLINE void | nrfy_timer_shorts_enable (NRF_TIMER_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_timer_shorts_disable (NRF_TIMER_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_timer_shorts_set (NRF_TIMER_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_timer_int_enable (NRF_TIMER_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_timer_int_disable (NRF_TIMER_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_int_enable_check (NRF_TIMER_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_timer_subscribe_set (NRF_TIMER_Type *p_reg, nrf_timer_task_t task, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_timer_subscribe_clear (NRF_TIMER_Type *p_reg, nrf_timer_task_t task) |
NRFY_STATIC_INLINE void | nrfy_timer_publish_set (NRF_TIMER_Type *p_reg, nrf_timer_event_t event, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_timer_publish_clear (NRF_TIMER_Type *p_reg, nrf_timer_event_t event) |
NRFY_STATIC_INLINE void | nrfy_timer_mode_set (NRF_TIMER_Type *p_reg, nrf_timer_mode_t mode) |
NRFY_STATIC_INLINE nrf_timer_mode_t | nrfy_timer_mode_get (NRF_TIMER_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_timer_bit_width_set (NRF_TIMER_Type *p_reg, nrf_timer_bit_width_t bit_width) |
NRFY_STATIC_INLINE nrf_timer_bit_width_t | nrfy_timer_bit_width_get (NRF_TIMER_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_timer_prescaler_set (NRF_TIMER_Type *p_reg, uint32_t prescaler_factor) |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_prescaler_get (NRF_TIMER_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_timer_cc_set (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel, uint32_t cc_value) |
NRFY_STATIC_INLINE uint32_t | nrfy_timer_cc_get (NRF_TIMER_Type const *p_reg, nrf_timer_cc_channel_t cc_channel) |
NRFY_STATIC_INLINE nrf_timer_task_t | nrfy_timer_capture_task_get (uint8_t channel) |
NRFY_STATIC_INLINE nrf_timer_event_t | nrfy_timer_compare_event_get (uint8_t channel) |
NRFY_STATIC_INLINE nrf_timer_int_mask_t | nrfy_timer_compare_int_get (uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_timer_one_shot_enable (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel) |
NRFY_STATIC_INLINE void | nrfy_timer_one_shot_disable (NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel) |
Hardware access layer with cache and barrier support for managing the TIMER peripheral.
#define NRFY_TIMER_HAS_ONE_SHOT 1 |
NRFY_STATIC_INLINE nrf_timer_bit_width_t nrfy_timer_bit_width_get | ( | NRF_TIMER_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_timer_bit_width_set | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_bit_width_t | bit_width | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | bit_width | Timer bit width. |
NRFY_STATIC_INLINE uint32_t nrfy_timer_capture_get | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_cc_channel_t | channel | ||
) |
Function for capturing the TIMER value.
channel
and returns latched timer value.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | channel | Capture channel number. |
NRFY_STATIC_INLINE nrf_timer_task_t nrfy_timer_capture_task_get | ( | uint8_t | channel | ) |
[in] | channel | Capture channel. |
NRFY_STATIC_INLINE uint32_t nrfy_timer_cc_get | ( | NRF_TIMER_Type const * | p_reg, |
nrf_timer_cc_channel_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | The specified capture/compare channel. |
NRFY_STATIC_INLINE void nrfy_timer_cc_set | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_cc_channel_t | cc_channel, | ||
uint32_t | cc_value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | The specified capture/compare channel. |
[in] | cc_value | Value to write to the capture/compare register. |
NRFY_STATIC_INLINE nrf_timer_event_t nrfy_timer_compare_event_get | ( | uint8_t | channel | ) |
[in] | channel | Compare channel. |
NRFY_STATIC_INLINE nrf_timer_int_mask_t nrfy_timer_compare_int_get | ( | uint8_t | channel | ) |
[in] | channel | Compare channel. |
NRFY_STATIC_INLINE uint32_t nrfy_timer_event_address_get | ( | NRF_TIMER_Type const * | p_reg, |
nrf_timer_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | The specified event. |
NRFY_STATIC_INLINE bool nrfy_timer_event_check | ( | NRF_TIMER_Type const * | p_reg, |
nrf_timer_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_timer_event_clear | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_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_timer_events_process | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for processing the specified TIMER 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_timer_int_disable | ( | NRF_TIMER_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_timer_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_timer_int_enable | ( | NRF_TIMER_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_timer_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE uint32_t nrfy_timer_int_enable_check | ( | NRF_TIMER_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_timer_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_timer_int_init | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | mask, | ||
uint8_t | irq_priority, | ||
bool | enable | ||
) |
Function for initializing the specified TIMER 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_timer_int_uninit | ( | NRF_TIMER_Type * | p_reg | ) |
Function for uninitializing the TIMER interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE nrf_timer_mode_t nrfy_timer_mode_get | ( | NRF_TIMER_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_timer_mode_set | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_mode_t | mode | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mode | Timer mode. |
NRFY_STATIC_INLINE void nrfy_timer_one_shot_disable | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_cc_channel_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Capture/compare channel. |
NRFY_STATIC_INLINE void nrfy_timer_one_shot_enable | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_cc_channel_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Capture/compare channel. |
NRFY_STATIC_INLINE void nrfy_timer_periph_configure | ( | NRF_TIMER_Type * | p_reg, |
nrfy_timer_config_t const * | p_config | ||
) |
Function for configuring the TIMER.
[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_timer_prescaler_get | ( | NRF_TIMER_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_timer_prescaler_set | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | prescaler_factor | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | prescaler_factor | Prescaler factor. |
NRFY_STATIC_INLINE void nrfy_timer_publish_clear | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_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_timer_publish_set | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_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_timer_shorts_disable | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Shortcuts to be disabled. |
NRFY_STATIC_INLINE void nrfy_timer_shorts_enable | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Shortcuts to be enabled. |
NRFY_STATIC_INLINE void nrfy_timer_shorts_set | ( | NRF_TIMER_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Shortcuts to be set. |
NRFY_STATIC_INLINE void nrfy_timer_subscribe_clear | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_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_timer_subscribe_set | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_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_timer_task_address_get | ( | NRF_TIMER_Type const * | p_reg, |
nrf_timer_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | The specified task. |
NRFY_STATIC_INLINE void nrfy_timer_task_trigger | ( | NRF_TIMER_Type * | p_reg, |
nrf_timer_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task to be activated. |