TIMER HALY

group nrfy_timer

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

Defines

NRFY_TIMER_HAS_ONE_SHOT

@refhal{NRF_TIMER_HAS_ONE_SHOT}

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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[in] Pointer to the peripheral configuration structure.

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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be initialized.

  • irq_priority[in] Interrupt priority.

  • enable[in] 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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

NRFY_STATIC_INLINE uint32_t nrfy_timer_events_process(NRF_TIMER_Type *p_reg, uint32_t mask)

Function for processing the specified TIMER events.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask 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_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.

Note

This function triggers the capture task for given channel and returns latched timer value.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • channel[in] Capture channel number.

Returns:

Captured value.

NRFY_STATIC_INLINE void nrfy_timer_task_trigger(NRF_TIMER_Type *p_reg, nrf_timer_task_t task)

@refhal{nrf_timer_task_trigger}

NRFY_STATIC_INLINE uint32_t nrfy_timer_task_address_get(NRF_TIMER_Type const *p_reg, nrf_timer_task_t task)

@refhal{nrf_timer_task_address_get}

NRFY_STATIC_INLINE void nrfy_timer_event_clear(NRF_TIMER_Type *p_reg, nrf_timer_event_t event)

@refhal{nrf_timer_event_clear}

NRFY_STATIC_INLINE bool nrfy_timer_event_check(NRF_TIMER_Type const *p_reg, nrf_timer_event_t event)

@refhal{nrf_timer_event_check}

NRFY_STATIC_INLINE uint32_t nrfy_timer_event_address_get(NRF_TIMER_Type const *p_reg, nrf_timer_event_t event)

@refhal{nrf_timer_event_address_get}

NRFY_STATIC_INLINE void nrfy_timer_shorts_enable(NRF_TIMER_Type *p_reg, uint32_t mask)

@refhal{nrf_timer_shorts_enable}

NRFY_STATIC_INLINE void nrfy_timer_shorts_disable(NRF_TIMER_Type *p_reg, uint32_t mask)

@refhal{nrf_timer_shorts_disable}

NRFY_STATIC_INLINE void nrfy_timer_shorts_set(NRF_TIMER_Type *p_reg, uint32_t mask)

@refhal{nrf_timer_shorts_set}

NRFY_STATIC_INLINE void nrfy_timer_int_enable(NRF_TIMER_Type *p_reg, uint32_t mask)

@refhal{nrf_timer_int_enable}

NRFY_STATIC_INLINE void nrfy_timer_int_disable(NRF_TIMER_Type *p_reg, uint32_t mask)

@refhal{nrf_timer_int_disable}

NRFY_STATIC_INLINE uint32_t nrfy_timer_int_enable_check(NRF_TIMER_Type const *p_reg, uint32_t mask)

@refhal{nrf_timer_int_enable_check}

NRFY_STATIC_INLINE void nrfy_timer_subscribe_set(NRF_TIMER_Type *p_reg, nrf_timer_task_t task, uint8_t channel)

@refhal{nrf_timer_subscribe_set}

NRFY_STATIC_INLINE void nrfy_timer_subscribe_clear(NRF_TIMER_Type *p_reg, nrf_timer_task_t task)

@refhal{nrf_timer_subscribe_clear}

NRFY_STATIC_INLINE void nrfy_timer_publish_set(NRF_TIMER_Type *p_reg, nrf_timer_event_t event, uint8_t channel)

@refhal{nrf_timer_publish_set}

NRFY_STATIC_INLINE void nrfy_timer_publish_clear(NRF_TIMER_Type *p_reg, nrf_timer_event_t event)

@refhal{nrf_timer_publish_clear}

NRFY_STATIC_INLINE void nrfy_timer_mode_set(NRF_TIMER_Type *p_reg, nrf_timer_mode_t mode)

@refhal{nrf_timer_mode_set}

NRFY_STATIC_INLINE nrf_timer_mode_t nrfy_timer_mode_get(NRF_TIMER_Type const *p_reg)

@refhal{nrf_timer_mode_get}

NRFY_STATIC_INLINE void nrfy_timer_bit_width_set(NRF_TIMER_Type *p_reg, nrf_timer_bit_width_t bit_width)

@refhal{nrf_timer_bit_width_set}

NRFY_STATIC_INLINE nrf_timer_bit_width_t nrfy_timer_bit_width_get(NRF_TIMER_Type const *p_reg)

@refhal{nrf_timer_bit_width_get}

NRF_STATIC_INLINE void nrfy_timer_prescaler_set(NRF_TIMER_Type *p_reg, uint32_t prescaler_factor)

@refhal{nrf_timer_prescaler_set}

NRF_STATIC_INLINE uint32_t nrfy_timer_prescaler_get(NRF_TIMER_Type const *p_reg)

@refhal{nrf_timer_prescaler_get}

NRFY_STATIC_INLINE void nrfy_timer_cc_set(NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel, uint32_t cc_value)

@refhal{nrf_timer_cc_set}

NRFY_STATIC_INLINE uint32_t nrfy_timer_cc_get(NRF_TIMER_Type const *p_reg, nrf_timer_cc_channel_t cc_channel)

@refhal{nrf_timer_cc_get}

NRFY_STATIC_INLINE nrf_timer_task_t nrfy_timer_capture_task_get(uint8_t channel)

@refhal{nrf_timer_capture_task_get}

NRFY_STATIC_INLINE nrf_timer_event_t nrfy_timer_compare_event_get(uint8_t channel)

@refhal{nrf_timer_compare_event_get}

NRFY_STATIC_INLINE nrf_timer_int_mask_t nrfy_timer_compare_int_get(uint8_t channel)

@refhal{nrf_timer_compare_int_get}

NRFY_STATIC_INLINE void nrfy_timer_one_shot_enable(NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel)

@refhal{nrf_timer_one_shot_enable}

NRFY_STATIC_INLINE void nrfy_timer_one_shot_disable(NRF_TIMER_Type *p_reg, nrf_timer_cc_channel_t cc_channel)

@refhal{nrf_timer_one_shot_disable}

struct nrfy_timer_config_t
#include <nrfy_timer.h>

TIMER configuration structure.

Public Members

uint32_t prescaler

Prescaler value.

nrf_timer_mode_t mode

Mode of operation.

nrf_timer_bit_width_t bit_width

Bit width.