nrfx 3.3
Data Structures | Macros | Functions
TIMER HALY

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)
 

Detailed Description

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

Macro Definition Documentation

◆ NRFY_TIMER_HAS_ONE_SHOT

#define NRFY_TIMER_HAS_ONE_SHOT   1
See also
NRF_TIMER_HAS_ONE_SHOT Symbol indicating whether timer supports one-shot operation.

Function Documentation

◆ nrfy_timer_bit_width_get()

NRFY_STATIC_INLINE nrf_timer_bit_width_t nrfy_timer_bit_width_get ( NRF_TIMER_Type const *  p_reg)
See also
nrf_timer_bit_width_get Function for retrieving the timer bit width.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Timer bit width.

◆ nrfy_timer_bit_width_set()

NRFY_STATIC_INLINE void nrfy_timer_bit_width_set ( NRF_TIMER_Type *  p_reg,
nrf_timer_bit_width_t  bit_width 
)
See also
nrf_timer_bit_width_set Function for setting the timer bit width.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]bit_widthTimer bit width.

◆ nrfy_timer_capture_get()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]channelCapture channel number.
Returns
Captured value.

◆ nrfy_timer_capture_task_get()

NRFY_STATIC_INLINE nrf_timer_task_t nrfy_timer_capture_task_get ( uint8_t  channel)
See also
nrf_timer_capture_task_get Function for getting the specified timer capture task.
Parameters
[in]channelCapture channel.
Returns
Capture task.

◆ nrfy_timer_cc_get()

NRFY_STATIC_INLINE uint32_t nrfy_timer_cc_get ( NRF_TIMER_Type const *  p_reg,
nrf_timer_cc_channel_t  cc_channel 
)
See also
nrf_timer_cc_get Function for retrieving the capture/compare value for a specified channel.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelThe specified capture/compare channel.
Returns
Value from the specified capture/compare register.

◆ nrfy_timer_cc_set()

NRFY_STATIC_INLINE void nrfy_timer_cc_set ( NRF_TIMER_Type *  p_reg,
nrf_timer_cc_channel_t  cc_channel,
uint32_t  cc_value 
)
See also
nrf_timer_cc_set Function for setting the capture/compare register for the specified channel.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelThe specified capture/compare channel.
[in]cc_valueValue to write to the capture/compare register.

◆ nrfy_timer_compare_event_get()

NRFY_STATIC_INLINE nrf_timer_event_t nrfy_timer_compare_event_get ( uint8_t  channel)
See also
nrf_timer_compare_event_get Function for getting the specified timer compare event.
Parameters
[in]channelCompare channel.
Returns
Compare event.

◆ nrfy_timer_compare_int_get()

NRFY_STATIC_INLINE nrf_timer_int_mask_t nrfy_timer_compare_int_get ( uint8_t  channel)
See also
nrf_timer_compare_int_get Function for getting the specified timer compare interrupt.
Parameters
[in]channelCompare channel.
Returns
Compare interrupt.

◆ nrfy_timer_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_timer_event_address_get ( NRF_TIMER_Type const *  p_reg,
nrf_timer_event_t  event 
)
See also
nrf_timer_event_address_get Function for getting the address of the specified timer event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventThe specified event.
Returns
Address of the specified event register.

◆ nrfy_timer_event_check()

NRFY_STATIC_INLINE bool nrfy_timer_event_check ( NRF_TIMER_Type const *  p_reg,
nrf_timer_event_t  event 
)
See also
nrf_timer_event_check Function for retrieving the state of the TIMER 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_timer_event_clear()

NRFY_STATIC_INLINE void nrfy_timer_event_clear ( NRF_TIMER_Type *  p_reg,
nrf_timer_event_t  event 
)
See also
nrf_timer_event_clear Function for clearing the specified timer event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to clear.

◆ nrfy_timer_events_process()

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
[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_timer_int_disable()

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

◆ nrfy_timer_int_enable()

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

◆ nrfy_timer_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_timer_int_enable_check ( NRF_TIMER_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_timer_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_timer_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_timer_int_init()

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
[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 the interrupts are to be enabled, false otherwise.

◆ nrfy_timer_int_uninit()

NRFY_STATIC_INLINE void nrfy_timer_int_uninit ( NRF_TIMER_Type *  p_reg)

Function for uninitializing the TIMER interrupts.

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

◆ nrfy_timer_mode_get()

NRFY_STATIC_INLINE nrf_timer_mode_t nrfy_timer_mode_get ( NRF_TIMER_Type const *  p_reg)
See also
nrf_timer_mode_get Function for retrieving the timer mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Timer mode.

◆ nrfy_timer_mode_set()

NRFY_STATIC_INLINE void nrfy_timer_mode_set ( NRF_TIMER_Type *  p_reg,
nrf_timer_mode_t  mode 
)
See also
nrf_timer_mode_set Function for setting the timer mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]modeTimer mode.

◆ nrfy_timer_one_shot_disable()

NRFY_STATIC_INLINE void nrfy_timer_one_shot_disable ( NRF_TIMER_Type *  p_reg,
nrf_timer_cc_channel_t  cc_channel 
)
See also
nrf_timer_one_shot_disable Function for disabling one-shot operation for the specified capture/compare channel.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelCapture/compare channel.

◆ nrfy_timer_one_shot_enable()

NRFY_STATIC_INLINE void nrfy_timer_one_shot_enable ( NRF_TIMER_Type *  p_reg,
nrf_timer_cc_channel_t  cc_channel 
)
See also
nrf_timer_one_shot_enable Function for enabling one-shot operation for the specified capture/compare channel.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelCapture/compare channel.

◆ nrfy_timer_periph_configure()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the peripheral configuration structure.

◆ nrfy_timer_prescaler_get()

NRFY_STATIC_INLINE uint32_t nrfy_timer_prescaler_get ( NRF_TIMER_Type const *  p_reg)
See also
nrf_timer_prescaler_get Function for retrieving the prescaler factor.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Prescaler factor.

◆ nrfy_timer_prescaler_set()

NRFY_STATIC_INLINE void nrfy_timer_prescaler_set ( NRF_TIMER_Type *  p_reg,
uint32_t  prescaler_factor 
)
See also
nrf_timer_prescaler_set Function for setting the prescaler factor.
Note
Prescaler value is expressed as \( 2^{prescaler\_factor} \).
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]prescaler_factorPrescaler factor.

◆ nrfy_timer_publish_clear()

NRFY_STATIC_INLINE void nrfy_timer_publish_clear ( NRF_TIMER_Type *  p_reg,
nrf_timer_event_t  event 
)
See also
nrf_timer_publish_clear Function for clearing the publish configuration for a given TIMER event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrfy_timer_publish_set()

NRFY_STATIC_INLINE void nrfy_timer_publish_set ( NRF_TIMER_Type *  p_reg,
nrf_timer_event_t  event,
uint8_t  channel 
)
See also
nrf_timer_publish_set Function for setting the publish configuration for a given TIMER 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_timer_shorts_disable()

NRFY_STATIC_INLINE void nrfy_timer_shorts_disable ( NRF_TIMER_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_timer_shorts_disable Function for disabling the specified shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskShortcuts to be disabled.

◆ nrfy_timer_shorts_enable()

NRFY_STATIC_INLINE void nrfy_timer_shorts_enable ( NRF_TIMER_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_timer_shorts_enable Function for enabling the specified shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskShortcuts to be enabled.

◆ nrfy_timer_shorts_set()

NRFY_STATIC_INLINE void nrfy_timer_shorts_set ( NRF_TIMER_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_timer_shorts_set Function for setting the specified shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskShortcuts to be set.

◆ nrfy_timer_subscribe_clear()

NRFY_STATIC_INLINE void nrfy_timer_subscribe_clear ( NRF_TIMER_Type *  p_reg,
nrf_timer_task_t  task 
)
See also
nrf_timer_subscribe_clear Function for clearing the subscribe configuration for a given TIMER task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrfy_timer_subscribe_set()

NRFY_STATIC_INLINE void nrfy_timer_subscribe_set ( NRF_TIMER_Type *  p_reg,
nrf_timer_task_t  task,
uint8_t  channel 
)
See also
nrf_timer_subscribe_set Function for setting the subscribe configuration for a given TIMER 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_timer_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_timer_task_address_get ( NRF_TIMER_Type const *  p_reg,
nrf_timer_task_t  task 
)
See also
nrf_timer_task_address_get Function for getting the address of the specified timer task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskThe specified task.
Returns
Address of the specified task register.

◆ nrfy_timer_task_trigger()

NRFY_STATIC_INLINE void nrfy_timer_task_trigger ( NRF_TIMER_Type *  p_reg,
nrf_timer_task_t  task 
)
See also
nrf_timer_task_trigger Function for activating the specified timer task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

Documentation feedback | Developer Zone | Subscribe | Updated