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)

@refhal{nrf_rtc_cc_set}

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

@refhal{nrf_rtc_cc_get}

NRFY_STATIC_INLINE void nrfy_rtc_int_enable(NRF_RTC_Type *p_reg, uint32_t mask)

@refhal{nrf_rtc_int_enable}

NRFY_STATIC_INLINE void nrfy_rtc_int_disable(NRF_RTC_Type *p_reg, uint32_t mask)

@refhal{nrf_rtc_int_disable}

NRFY_STATIC_INLINE uint32_t nrfy_rtc_int_enable_check(NRF_RTC_Type *p_reg, uint32_t mask)

@refhal{nrf_rtc_int_enable_check}

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

@refhal{nrf_rtc_subscribe_set}

NRFY_STATIC_INLINE void nrfy_rtc_subscribe_clear(NRF_RTC_Type *p_reg, nrf_rtc_task_t task)

@refhal{nrf_rtc_subscribe_clear}

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

@refhal{nrf_rtc_publish_set}

NRFY_STATIC_INLINE void nrfy_rtc_publish_clear(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

@refhal{nrf_rtc_publish_clear}

NRFY_STATIC_INLINE bool nrfy_rtc_event_check(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

@refhal{nrf_rtc_event_check}

NRFY_STATIC_INLINE void nrfy_rtc_event_clear(NRF_RTC_Type *p_reg, nrf_rtc_event_t event)

@refhal{nrf_rtc_event_clear}

NRFY_STATIC_INLINE uint32_t nrfy_rtc_counter_get(NRF_RTC_Type const *p_reg)

@refhal{nrf_rtc_counter_get}

NRFY_STATIC_INLINE void nrfy_rtc_prescaler_set(NRF_RTC_Type *p_reg, uint32_t val)

@refhal{nrf_rtc_prescaler_set}

NRFY_STATIC_INLINE uint32_t nrfy_rtc_prescaler_get(NRF_RTC_Type const *p_reg)

@refhal{nrf_rtc_prescaler_get}

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

@refhal{nrf_rtc_event_address_get}

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

@refhal{nrf_rtc_task_address_get}

NRFY_STATIC_INLINE void nrfy_rtc_task_trigger(NRF_RTC_Type *p_reg, nrf_rtc_task_t task)

@refhal{nrf_rtc_task_trigger}

NRFY_STATIC_INLINE nrf_rtc_task_t nrfy_rtc_capture_task_get(uint8_t index)

@refhal{nrf_rtc_capture_task_get}

NRFY_STATIC_INLINE void nrfy_rtc_event_enable(NRF_RTC_Type *p_reg, uint32_t mask)

@refhal{nrf_rtc_event_enable}

NRFY_STATIC_INLINE void nrfy_rtc_event_disable(NRF_RTC_Type *p_reg, uint32_t mask)

@refhal{nrf_rtc_event_disable}

NRFY_STATIC_INLINE nrf_rtc_event_t nrfy_rtc_compare_event_get(uint8_t index)

@refhal{nrf_rtc_compare_event_get}

struct nrfy_rtc_config_t
#include <nrfy_rtc.h>

Structure for RTC configuration.

Public Members

uint32_t prescaler

Prescaler.