RTC HALY

group nrfy_rtc

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

Functions

NRFY_STATIC_INLINE void nrfy_rtc_periph_configure(NRF_RTC_Type *p_reg, nrfy_rtc_config_t const *p_config)

Function for configuring the RTC.

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_rtc_int_init(NRF_RTC_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable)

Function for initializing the specified RTC 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 interrupts are to be enabled, false otherwise.

NRFY_STATIC_INLINE void nrfy_rtc_int_uninit(NRF_RTC_Type *p_reg)

Function for uninitializing the RTC interrupts.

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

NRFY_STATIC_INLINE uint32_t nrfy_rtc_events_process(NRF_RTC_Type *p_reg, uint32_t mask)

Function for processing the specified RTC 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 void nrfy_rtc_stop(NRF_RTC_Type *p_reg, uint32_t mask)

Function for stopping the RTC.

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

  • mask[in] Mask of events to be disabled.

NRFY_STATIC_INLINE void nrfy_rtc_event_int_clear_enable(NRF_RTC_Type *p_reg, nrf_rtc_event_t event, bool enable)

Function for enabling the RTC event and optionally associated interrupt.

Note

Event is implicitly cleared before enabling the associated interrupt.

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

  • event[in] Event to be enabled.

  • enable[in] True if associated interrupt is to be enabled, false otherwise.

NRFY_STATIC_INLINE void nrfy_rtc_event_int_disable(NRF_RTC_Type *p_reg, uint32_t mask)

Function for disabling the RTC events and corresponding interrupts.

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

  • mask[in] Mask of events to be disabled.

NRFY_STATIC_INLINE void nrfy_rtc_cc_set(NRF_RTC_Type *p_reg, uint32_t ch, uint32_t cc_val)

See also

nrf_rtc_cc_set Function for setting a compare value for a channel.

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

  • ch[in] Channel.

  • cc_val[in] Compare value to be set.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_cc_get(NRF_RTC_Type const *p_reg, uint32_t ch)

See also

nrf_rtc_cc_get Function for returning the compare value for a channel.

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

  • ch[in] Channel.

Returns:

COMPARE[ch] value.

NRFY_STATIC_INLINE void nrfy_rtc_int_enable(NRF_RTC_Type *p_reg, uint32_t mask)

See also

nrf_rtc_int_enable Function for enabling interrupts.

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

  • mask[in] Mask of interrupts to be enabled. Use nrf_rtc_int_t values for bit masking.

NRFY_STATIC_INLINE void nrfy_rtc_int_disable(NRF_RTC_Type *p_reg, uint32_t mask)

See also

nrf_rtc_int_disable Function for disabling interrupts.

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

  • mask[in] Mask of interrupts to be disabled. Use nrf_rtc_int_t values for bit masking.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_int_enable_check(NRF_RTC_Type *p_reg, uint32_t mask)

See also

nrf_rtc_int_enable_check Function for checking if the specified interrupts are enabled.

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

  • mask[in] Mask of interrupts to be checked. Use nrf_rtc_int_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRFY_STATIC_INLINE void nrfy_rtc_subscribe_set(NRF_RTC_Type *p_reg, nrf_rtc_task_t task, uint8_t channel)

See also

nrf_rtc_subscribe_set Function for setting the subscribe configuration for a given RTC task.

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

  • task[in] Task for which to set the configuration.

  • channel[in] Channel through which to subscribe events.

NRFY_STATIC_INLINE void nrfy_rtc_subscribe_clear(NRF_RTC_Type *p_reg, nrf_rtc_task_t task)

See also

nrf_rtc_subscribe_clear Function for clearing the subscribe configuration for a given RTC task.

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

  • task[in] Task for which to clear the configuration.

NRFY_STATIC_INLINE void nrfy_rtc_publish_set(NRF_RTC_Type *p_reg, nrf_rtc_event_t event, uint8_t channel)

See also

nrf_rtc_publish_set Function for setting the publish configuration for a given RTC event.

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

  • event[in] Event for which to set the configuration.

  • channel[in] Channel through which to publish the event.

NRFY_STATIC_INLINE void nrfy_rtc_publish_clear(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

See also

nrf_rtc_publish_clear Function for clearing the publish configuration for a given RTC event.

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

  • event[in] Event for which to clear the configuration.

NRFY_STATIC_INLINE bool nrfy_rtc_event_check(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

See also

nrf_rtc_event_check Function for retrieving the state of the RTC event.

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

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRFY_STATIC_INLINE void nrfy_rtc_event_clear(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

See also

nrf_rtc_event_clear Function for clearing an event.

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

  • event[in] Event to be cleared.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_counter_get(NRF_RTC_Type const *p_reg)

See also

nrf_rtc_counter_get Function for returning a counter value.

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

Returns:

Counter value.

NRFY_STATIC_INLINE void nrfy_rtc_prescaler_set(NRF_RTC_Type *p_reg, uint32_t val)

See also

nrf_rtc_prescaler_set Function for setting a prescaler value.

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

  • val[in] Value to set the prescaler to.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_prescaler_get(NRF_RTC_Type const *p_reg)

See also

nrf_rtc_prescaler_get Function for getting a prescaler value.

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

Returns:

Prescaler value.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_event_address_get(NRF_RTC_Type const *p_reg, nrf_rtc_event_t event)

See also

nrf_rtc_event_address_get Function for returning the address of an event.

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

  • event[in] Requested event.

Returns:

Address of the requested event register.

NRFY_STATIC_INLINE uint32_t nrfy_rtc_task_address_get(NRF_RTC_Type const *p_reg, nrf_rtc_task_t task)

See also

nrf_rtc_task_address_get Function for returning the address of a task.

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

  • task[in] Requested task.

Returns:

Address of the requested task register.

NRFY_STATIC_INLINE void nrfy_rtc_task_trigger(NRF_RTC_Type *p_reg, nrf_rtc_task_t task)

See also

nrf_rtc_task_trigger Function for starting a task.

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

  • task[in] Requested task.

NRFY_STATIC_INLINE nrf_rtc_task_t nrfy_rtc_capture_task_get(uint8_t index)

See also

nrf_rtc_capture_task_get Function for getting the CAPTURE task associated with the specified capture channel.

Parameters:
  • index[in] Capture channel index.

Returns:

Requested CAPTURE task.

NRFY_STATIC_INLINE void nrfy_rtc_event_enable(NRF_RTC_Type *p_reg, uint32_t mask)

See also

nrf_rtc_event_enable Function for enabling events.

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

  • mask[in] Mask of event flags to be enabled.

NRFY_STATIC_INLINE void nrfy_rtc_event_disable(NRF_RTC_Type *p_reg, uint32_t mask)

See also

nrf_rtc_event_disable Function for disabling an event.

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

  • mask[in] Mask of event flags to be disabled.

NRFY_STATIC_INLINE nrf_rtc_event_t nrfy_rtc_compare_event_get(uint8_t index)

See also

nrf_rtc_compare_event_get Function for getting the COMPARE event associated with the specified compare channel.

Parameters:
  • index[in] Compare channel index.

Returns:

Requested COMPARE event.

struct nrfy_rtc_config_t
#include <nrfy_rtc.h>

Structure for RTC configuration.

Public Members

uint32_t prescaler

Prescaler.