nrfx 3.3
Macros | Enumerations | Functions
GRTC HAL

Hardware access layer for managing the Global Real Time Counter (GRTC) peripheral. More...

Macros

#define NRF_GRTC_HAS_PWM   1
 Symbol indicating whether GRTC has PWM registers.
 
#define NRF_GRTC_HAS_CLKOUT   1
 Symbol indicating whether GRTC has clock output registers.
 
#define NRF_GRTC_HAS_CLKSEL   1
 Symbol indicating whether GRTC has clock source selection.
 
#define NRF_GRTC_HAS_SYSCOUNTER_ARRAY   1
 Symbol indicating whether GRTC has multiple SYSCOUNTER registers.
 
#define NRF_GRTC_HAS_RTCOUNTER   1
 Symbol indicating whether GRTC has RTCOUNTER.
 
#define NRF_GRTC_HAS_EXTENDED   1
 Symbol indicating whether GRTC has extended functionality.
 
#define NRF_GRTC_DOMAIN_INDEX   GRTC_IRQ_GROUP
 Symbol indicating actual domain index.
 
#define GRTC_SYSCOUNTER   SYSCOUNTER[NRF_GRTC_DOMAIN_INDEX]
 Symbol indicating actual SYSCOUNTER index.
 
#define GRTC_INTEN   NRFX_CONCAT_2(INTEN, GRTC_IRQ_GROUP)
 Interrupts INTEN register definition.
 
#define GRTC_INTENSET   NRFX_CONCAT_2(INTENSET, GRTC_IRQ_GROUP)
 Interrupts INTENSET register definition.
 
#define GRTC_INTENCLR   NRFX_CONCAT_2(INTENCLR, GRTC_IRQ_GROUP)
 Interrupts INTENCLR register definition.
 
#define GRTC_INTPEND   NRFX_CONCAT_2(INTPEND, GRTC_IRQ_GROUP)
 Interrupts INTPEND register definition.
 
#define NRF_GRTC_SYSCOUNTER_MAIN_FREQUENCY_HZ   1000000UL
 Main SYSCOUNTER frequency in Hz.
 
#define NRF_GRTC_SYSCOUNTER_CC_COUNT   GRTC_CC_MaxCount
 Number of capture/compare channels for SYSCOUNTER.
 
#define NRF_GRTC_SYSCOUNTER_CCH_MASK   GRTC_CC_CCH_CCH_Msk
 Bitmask of the higher 32-bits of capture/compare register for the SYSCOUNTER.
 
#define NRF_GRTC_SYSCOUNTER_CCADD_MASK   GRTC_CC_CCADD_VALUE_Msk
 Bitmask of CCADD register for the SYSCOUNTER.
 
#define NRF_GRTC_RTCOUNTER_CCH_MASK   GRTC_RTCOMPAREH_VALUE_Msk
 Bitmask of the higher 32-bits of capture/compare register for the RTCOUNTER.
 
#define NRF_GRTC_SYSCOUNTERH_OVERFLOW_MASK   GRTC_SYSCOUNTERH_OVERFLOW_Msk
 Bitmask of the OVERFLOW bit.
 
#define NRF_GRTC_TIMEOUT_MAX_VALUE   (GRTC_TIMEOUT_VALUE_Msk >> GRTC_TIMEOUT_VALUE_Pos)
 Maximum value of TIMEOUT register content.
 
#define NRF_GRTC_WAKETIME_MAX_VALUE   (GRTC_WAKETIME_VALUE_Msk >> GRTC_WAKETIME_VALUE_Pos)
 Maximum value of WAKETIME register content.
 
#define NRF_GRTC_CLKCFG_CLKFASTDIV_MAX_VALUE   GRTC_CLKCFG_CLKFASTDIV_Max
 Maximum value of CLKFASTDIV register content.
 
#define NRF_GRTC_CHANNEL_INT_MASK(ch)   ((uint32_t)(NRF_GRTC_INT_COMPARE0_MASK) << (ch))
 Macro for creating the interrupt bitmask for the specified compare channel.
 
#define NRF_GRTC_MAIN_CC_CHANNEL   0
 Main channel that can be used only by the owner of GRTC.
 
#define NRF_GRTC_INTEN_MASK   NRFX_BIT_MASK(GRTC_CC_MaxCount)
 Bitmask of interrupt enable.
 
#define NRF_GRTC_SYSCOUNTER_ALL_CHANNELS_INT_MASK    ((uint32_t)(((1 << NRF_GRTC_SYSCOUNTER_CC_COUNT) - 1) << GRTC_INTEN0_COMPARE0_Pos))
 Mask for all channels represented by CC channels.
 

Enumerations

enum  nrf_grtc_task_t {
  NRF_GRTC_TASK_START = offsetof(NRF_GRTC_Type, TASKS_START) ,
  NRF_GRTC_TASK_STOP = offsetof(NRF_GRTC_Type, TASKS_STOP) ,
  NRF_GRTC_TASK_CLEAR = offsetof(NRF_GRTC_Type, TASKS_CLEAR) ,
  NRF_GRTC_TASK_PWM_START = offsetof(NRF_GRTC_Type, TASKS_PWMSTART) ,
  NRF_GRTC_TASK_PWM_STOP = offsetof(NRF_GRTC_Type, TASKS_PWMSTOP) ,
  NRF_GRTC_TASK_CAPTURE_0 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[0]) ,
  NRF_GRTC_TASK_CAPTURE_1 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[1]) ,
  NRF_GRTC_TASK_CAPTURE_2 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[2]) ,
  NRF_GRTC_TASK_CAPTURE_3 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[3]) ,
  NRF_GRTC_TASK_CAPTURE_4 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[4]) ,
  NRF_GRTC_TASK_CAPTURE_5 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[5]) ,
  NRF_GRTC_TASK_CAPTURE_6 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[6]) ,
  NRF_GRTC_TASK_CAPTURE_7 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[7]) ,
  NRF_GRTC_TASK_CAPTURE_8 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[8]) ,
  NRF_GRTC_TASK_CAPTURE_9 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[9]) ,
  NRF_GRTC_TASK_CAPTURE_10 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[10]) ,
  NRF_GRTC_TASK_CAPTURE_11 = offsetof(NRF_GRTC_Type, TASKS_CAPTURE[11])
}
 GRTC tasks. More...
 
enum  nrf_grtc_event_t {
  NRF_GRTC_EVENT_COMPARE_0 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[0]) ,
  NRF_GRTC_EVENT_COMPARE_1 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[1]) ,
  NRF_GRTC_EVENT_COMPARE_2 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[2]) ,
  NRF_GRTC_EVENT_COMPARE_3 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[3]) ,
  NRF_GRTC_EVENT_COMPARE_4 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[4]) ,
  NRF_GRTC_EVENT_COMPARE_5 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[5]) ,
  NRF_GRTC_EVENT_COMPARE_6 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[6]) ,
  NRF_GRTC_EVENT_COMPARE_7 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[7]) ,
  NRF_GRTC_EVENT_COMPARE_8 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[8]) ,
  NRF_GRTC_EVENT_COMPARE_9 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[9]) ,
  NRF_GRTC_EVENT_COMPARE_10 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[10]) ,
  NRF_GRTC_EVENT_COMPARE_11 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[11]) ,
  NRF_GRTC_EVENT_COMPARE_12 = offsetof(NRF_GRTC_Type, EVENTS_COMPARE[12]) ,
  NRF_GRTC_EVENT_RTCOMPARE = offsetof(NRF_GRTC_Type, EVENTS_RTCOMPARE) ,
  NRF_GRTC_EVENT_RTCOMPARESYNC = offsetof(NRF_GRTC_Type, EVENTS_RTCOMPARESYNC) ,
  NRF_GRTC_EVENT_SYSCOUNTERVALID = offsetof(NRF_GRTC_Type, EVENTS_SYSCOUNTERVALID) ,
  NRF_GRTC_EVENT_PWM_PERIOD_END = offsetof(NRF_GRTC_Type, EVENTS_PWMPERIODEND)
}
 GRTC events. More...
 
enum  nrf_grtc_short_mask_t { NRF_GRTC_SHORT_RTCOMPARE_CLEAR_MASK = GRTC_SHORTS_RTCOMPARE_CLEAR_Msk }
 Types of GRTC shortcuts. More...
 
enum  nrf_grtc_cc_add_reference_t {
  NRF_GRTC_CC_ADD_REFERENCE_SYSCOUNTER = GRTC_CC_CCADD_REFERENCE_SYSCOUNTER ,
  NRF_GRTC_CC_ADD_REFERENCE_CC = GRTC_CC_CCADD_REFERENCE_CC
}
 Types of GRTC CC references. More...
 
enum  nrf_grtc_int_mask_t {
  NRF_GRTC_INT_COMPARE0_MASK = GRTC_INTENSET0_COMPARE0_Msk ,
  NRF_GRTC_INT_COMPARE1_MASK = GRTC_INTENSET0_COMPARE1_Msk ,
  NRF_GRTC_INT_COMPARE2_MASK = GRTC_INTENSET0_COMPARE2_Msk ,
  NRF_GRTC_INT_COMPARE3_MASK = GRTC_INTENSET0_COMPARE3_Msk ,
  NRF_GRTC_INT_COMPARE4_MASK = GRTC_INTENSET0_COMPARE4_Msk ,
  NRF_GRTC_INT_COMPARE5_MASK = GRTC_INTENSET0_COMPARE5_Msk ,
  NRF_GRTC_INT_COMPARE6_MASK = GRTC_INTENSET0_COMPARE6_Msk ,
  NRF_GRTC_INT_COMPARE7_MASK = GRTC_INTENSET0_COMPARE7_Msk ,
  NRF_GRTC_INT_COMPARE8_MASK = GRTC_INTENSET0_COMPARE8_Msk ,
  NRF_GRTC_INT_COMPARE9_MASK = GRTC_INTENSET0_COMPARE9_Msk ,
  NRF_GRTC_INT_COMPARE10_MASK = GRTC_INTENSET0_COMPARE10_Msk ,
  NRF_GRTC_INT_COMPARE11_MASK = GRTC_INTENSET0_COMPARE11_Msk ,
  NRF_GRTC_INT_RTCOMPARE_MASK = GRTC_INTENSET0_RTCOMPARE_Msk ,
  NRF_GRTC_INT_RTCOMPARESYNC_MASK = GRTC_INTENSET0_RTCOMPARESYNC_Msk ,
  NRF_GRTC_INT_SYSCOUNTERVALID_MASK = GRTC_INTENSET0_SYSCOUNTERVALID_Msk
}
 GRTC interrupts. More...
 
enum  nrf_grtc_clkout_t {
  NRF_GRTC_CLKOUT_32K = GRTC_CLKOUT_CLKOUT32K_Msk ,
  NRF_GRTC_CLKOUT_FAST = GRTC_CLKOUT_CLKOUTFAST_Msk
}
 Configuration of clock output. More...
 
enum  nrf_grtc_clksel_t {
  NRF_GRTC_CLKSEL_LFXO = GRTC_CLKCFG_CLKSEL_LFXO ,
  NRF_GRTC_CLKSEL_LFCLK = GRTC_CLKCFG_CLKSEL_SystemLFCLK
}
 Configuration of the GRTC clock source selection. More...
 

Functions

NRF_STATIC_INLINE void nrf_grtc_sys_counter_cc_set (NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint64_t cc_value)
 Function for setting the compare value of channel for the SYSCOUNTER.
 
NRF_STATIC_INLINE uint64_t nrf_grtc_sys_counter_cc_get (NRF_GRTC_Type const *p_reg, uint8_t cc_channel)
 Function for getting the capture/compare value of channel for the SYSCOUNTER.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_cc_add_set (NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint32_t value, nrf_grtc_cc_add_reference_t reference)
 Function for setting the value to be added to capture/compare register for the SYSCOUNTER.
 
NRF_STATIC_INLINE void nrf_grtc_rt_counter_cc_set (NRF_GRTC_Type *p_reg, uint64_t cc_value, bool sync)
 Function for setting a compare value for the RTCOUNTER.
 
NRF_STATIC_INLINE uint64_t nrf_grtc_rt_counter_cc_get (NRF_GRTC_Type const *p_reg)
 Function for returning the compare value for the RTCOUNTER.
 
NRF_STATIC_INLINE void nrf_grtc_int_enable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for enabling specified interrupts.
 
NRF_STATIC_INLINE void nrf_grtc_int_disable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for disabling specified interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_int_enable_check (NRF_GRTC_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_int_pending_get (NRF_GRTC_Type const *p_reg)
 Function for retrieving the state of pending interrupts.
 
NRF_STATIC_INLINE void nrf_grtc_event_enable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for enabling events.
 
NRF_STATIC_INLINE void nrf_grtc_event_disable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for disabling events.
 
NRF_STATIC_INLINE void nrf_grtc_shorts_enable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for enabling the specified shortcuts.
 
NRF_STATIC_INLINE void nrf_grtc_shorts_disable (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for disabling the specified shortcuts.
 
NRF_STATIC_INLINE void nrf_grtc_shorts_set (NRF_GRTC_Type *p_reg, uint32_t mask)
 Function for setting the specified shortcuts.
 
NRF_STATIC_INLINE void nrf_grtc_subscribe_set (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given GRTC task.
 
NRF_STATIC_INLINE void nrf_grtc_subscribe_clear (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task)
 Function for clearing the subscribe configuration for a given GRTC task.
 
NRF_STATIC_INLINE void nrf_grtc_publish_set (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given GRTC event.
 
NRF_STATIC_INLINE void nrf_grtc_publish_clear (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event)
 Function for clearing the publish configuration for a given GRTC event.
 
NRF_STATIC_INLINE bool nrf_grtc_event_check (NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event)
 Function for retrieving the state of the GRTC event.
 
NRF_STATIC_INLINE void nrf_grtc_event_clear (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event)
 Function for clearing an event.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_rt_counter_low_get (NRF_GRTC_Type const *p_reg)
 Function for returning the lower 32-bits of RTCOUNTER value.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_rt_counter_high_get (NRF_GRTC_Type const *p_reg)
 Function for returning the higher 32-bits of RTCOUNTER value.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_low_get (NRF_GRTC_Type const *p_reg)
 Function for returning the lower 32-bits of SYSCOUNTER value.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_high_get (NRF_GRTC_Type const *p_reg)
 Function for returning the higher 32-bits of SYSCOUNTER value.
 
NRF_STATIC_INLINE bool nrf_grtc_sys_counter_overflow_check (NRF_GRTC_Type const *p_reg)
 Function for checking whether the lower 32-bits of SYSCOUNTER overflowed after last execution of nrf_grtc_sys_counter_low_get.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_active_set (NRF_GRTC_Type *p_reg, bool enable)
 Function for setting the request to keep the specified SYSCOUNTER channel active.
 
NRF_STATIC_INLINE bool nrf_grtc_sys_counter_active_check (NRF_GRTC_Type const *p_reg)
 Function for checking whether the specified SYSCOUNTER channel is requested to remain active.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_event_address_get (NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event)
 Function for returning the address of an event.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_task_address_get (NRF_GRTC_Type const *p_reg, nrf_grtc_task_t task)
 Function for returning the address of a task.
 
NRF_STATIC_INLINE void nrf_grtc_task_trigger (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task)
 Function for starting a task.
 
NRF_STATIC_INLINE nrf_grtc_task_t nrf_grtc_sys_counter_capture_task_get (uint8_t cc_channel)
 Function for getting the 1 MHz SYSCOUNTER timer capture task associated with the specified channel.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_compare_event_enable (NRF_GRTC_Type *p_reg, uint8_t cc_channel)
 Function for enabling SYSCOUNTER compare event.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_compare_event_disable (NRF_GRTC_Type *p_reg, uint8_t cc_channel)
 Function for disabling SYSCOUNTER compare event.
 
NRF_STATIC_INLINE nrf_grtc_event_t nrf_grtc_sys_counter_compare_event_get (uint8_t cc_channel)
 Function for getting the SYSCOUNTER compare event associated with the specified compare cc_channel.
 
NRF_STATIC_INLINE bool nrf_grtc_sys_counter_cc_enable_check (NRF_GRTC_Type const *p_reg, uint8_t cc_channel)
 Function for checking whether the specified capture/compare channel is enabled.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_set (NRF_GRTC_Type *p_reg, bool enable)
 Function for setting the SYSCOUNTER.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_auto_mode_set (NRF_GRTC_Type *p_reg, bool enable)
 Function for setting automatic mode for the SYSCOUNTER.
 
NRF_STATIC_INLINE bool nrf_grtc_sys_counter_check (NRF_GRTC_Type const *p_reg)
 Function for checking whether the SYSCOUNTER is in active state.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_active_state_request_set (NRF_GRTC_Type *p_reg, bool enable)
 Function for setting the request to keep the SYSCOUNTER active.
 
NRF_STATIC_INLINE bool nrf_grtc_sys_counter_active_state_request_check (NRF_GRTC_Type const *p_reg)
 Function for checking whether the SYSCOUNTER is requested to remain active.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_active_state_request_get (NRF_GRTC_Type const *p_reg, uint32_t mask)
 Function for getting the domains that requested the SYSCOUNTER to remain active.
 
NRF_STATIC_INLINE void nrf_grtc_sys_counter_interval_set (NRF_GRTC_Type *p_reg, uint32_t value)
 Function for setting the periodic compare event for capture/compare channel 0.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_interval_get (NRF_GRTC_Type const *p_reg)
 Function for getting the value of interval for periodic capture/compare event for channel 0.
 
NRF_STATIC_INLINE void nrf_grtc_timeout_set (NRF_GRTC_Type *p_reg, uint32_t value)
 Function for setting the timeout value for GRTC.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_timeout_get (NRF_GRTC_Type const *p_reg)
 Function for getting the value of the timeout value for GRTC.
 
NRF_STATIC_INLINE void nrf_grtc_waketime_set (NRF_GRTC_Type *p_reg, uint32_t value)
 Function for setting the wake time value for GRTC.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_waketime_get (NRF_GRTC_Type const *p_reg)
 Function for getting the wake time value.
 
NRF_STATIC_INLINE void nrf_grtc_pwm_compare_set (NRF_GRTC_Type *p_reg, uint32_t value)
 Function for setting the PWM compare value.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_pwm_compare_get (NRF_GRTC_Type const *p_reg)
 Function for getting the PWM compare value.
 
NRF_STATIC_INLINE void nrf_grtc_clkout_set (NRF_GRTC_Type *p_reg, nrf_grtc_clkout_t clkout, bool enable)
 Function for setting the specified clock source to be connected to output pin.
 
NRF_STATIC_INLINE bool nrf_grtc_clkout_enable_check (NRF_GRTC_Type const *p_reg, nrf_grtc_clkout_t clkout)
 Function for checking whether clock source is connected to clkout pin.
 
NRF_STATIC_INLINE void nrf_grtc_clkout_divider_set (NRF_GRTC_Type *p_reg, uint32_t value)
 Function for setting the fast clock divisor value of clock output.
 
NRF_STATIC_INLINE uint32_t nrf_grtc_clkout_divider_get (NRF_GRTC_Type const *p_reg)
 Function for getting the fast clock divisor value of clock output.
 
NRF_STATIC_INLINE void nrf_grtc_clksel_set (NRF_GRTC_Type *p_reg, nrf_grtc_clksel_t clksel)
 Function for setting the clock source for the GRTC low-frequency clock.
 
NRF_STATIC_INLINE nrf_grtc_clksel_t nrf_grtc_clksel_get (NRF_GRTC_Type const *p_reg)
 Function for getting the clock source of the GRTC low-frequency clock.
 

Detailed Description

Hardware access layer for managing the Global Real Time Counter (GRTC) peripheral.

Enumeration Type Documentation

◆ nrf_grtc_cc_add_reference_t

Types of GRTC CC references.

Enumerator
NRF_GRTC_CC_ADD_REFERENCE_SYSCOUNTER 

The SYSCOUNTER register's content will be used as the reference.

NRF_GRTC_CC_ADD_REFERENCE_CC 

The CC[n] register's content will be used as the reference.

◆ nrf_grtc_clkout_t

Configuration of clock output.

Enumerator
NRF_GRTC_CLKOUT_32K 

Enable 32K clock output on pin.

NRF_GRTC_CLKOUT_FAST 

Enable fast clock output on pin.

◆ nrf_grtc_clksel_t

Configuration of the GRTC clock source selection.

Enumerator
NRF_GRTC_CLKSEL_LFXO 

LFXO oscillator as the clock source.

NRF_GRTC_CLKSEL_LFCLK 

System LFCLK as the clock source.

◆ nrf_grtc_event_t

GRTC events.

Enumerator
NRF_GRTC_EVENT_COMPARE_0 

Compare 0 event.

NRF_GRTC_EVENT_COMPARE_1 

Compare 1 event.

NRF_GRTC_EVENT_COMPARE_2 

Compare 2 event.

NRF_GRTC_EVENT_COMPARE_3 

Compare 3 event.

NRF_GRTC_EVENT_COMPARE_4 

Compare 4 event.

NRF_GRTC_EVENT_COMPARE_5 

Compare 5 event.

NRF_GRTC_EVENT_COMPARE_6 

Compare 6 event.

NRF_GRTC_EVENT_COMPARE_7 

Compare 7 event.

NRF_GRTC_EVENT_COMPARE_8 

Compare 8 event.

NRF_GRTC_EVENT_COMPARE_9 

Compare 9 event.

NRF_GRTC_EVENT_COMPARE_10 

Compare 10 event.

NRF_GRTC_EVENT_COMPARE_11 

Compare 11 event.

NRF_GRTC_EVENT_COMPARE_12 

Compare 12 event.

NRF_GRTC_EVENT_RTCOMPARE 

RTCOUNTER compare event.

NRF_GRTC_EVENT_RTCOMPARESYNC 

RTCOUNTER synchronized compare event.

NRF_GRTC_EVENT_SYSCOUNTERVALID 

SYSCOUNTER value valid event.

NRF_GRTC_EVENT_PWM_PERIOD_END 

End of PWM period event.

◆ nrf_grtc_int_mask_t

GRTC interrupts.

Enumerator
NRF_GRTC_INT_COMPARE0_MASK 

GRTC interrupt from compare event on channel 0.

NRF_GRTC_INT_COMPARE1_MASK 

GRTC interrupt from compare event on channel 1.

NRF_GRTC_INT_COMPARE2_MASK 

GRTC interrupt from compare event on channel 2.

NRF_GRTC_INT_COMPARE3_MASK 

GRTC interrupt from compare event on channel 3.

NRF_GRTC_INT_COMPARE4_MASK 

GRTC interrupt from compare event on channel 4.

NRF_GRTC_INT_COMPARE5_MASK 

GRTC interrupt from compare event on channel 5.

NRF_GRTC_INT_COMPARE6_MASK 

GRTC interrupt from compare event on channel 6.

NRF_GRTC_INT_COMPARE7_MASK 

GRTC interrupt from compare event on channel 7.

NRF_GRTC_INT_COMPARE8_MASK 

GRTC interrupt from compare event on channel 8.

NRF_GRTC_INT_COMPARE9_MASK 

GRTC interrupt from compare event on channel 9.

NRF_GRTC_INT_COMPARE10_MASK 

GRTC interrupt from compare event on channel 10.

NRF_GRTC_INT_COMPARE11_MASK 

GRTC interrupt from compare event on channel 11.

NRF_GRTC_INT_RTCOMPARE_MASK 

GRTC interrupt from RTCOUNTER compare event.

NRF_GRTC_INT_RTCOMPARESYNC_MASK 

GRTC interrupt from RTCOUNTER synchronized compare event.

NRF_GRTC_INT_SYSCOUNTERVALID_MASK 

GRTC interrupt from SYSCOUNTER valid event.

◆ nrf_grtc_short_mask_t

Types of GRTC shortcuts.

Enumerator
NRF_GRTC_SHORT_RTCOMPARE_CLEAR_MASK 

Shortcut between RTCOMPARE event and CLEAR task.

◆ nrf_grtc_task_t

GRTC tasks.

Enumerator
NRF_GRTC_TASK_START 

Start.

NRF_GRTC_TASK_STOP 

Stop.

NRF_GRTC_TASK_CLEAR 

Clear.

NRF_GRTC_TASK_PWM_START 

Start the PWM.

NRF_GRTC_TASK_PWM_STOP 

Stop the PWM.

NRF_GRTC_TASK_CAPTURE_0 

Capture the counter value on channel 0.

NRF_GRTC_TASK_CAPTURE_1 

Capture the counter value on channel 1.

NRF_GRTC_TASK_CAPTURE_2 

Capture the counter value on channel 2.

NRF_GRTC_TASK_CAPTURE_3 

Capture the counter value on channel 3.

NRF_GRTC_TASK_CAPTURE_4 

Capture the counter value on channel 4.

NRF_GRTC_TASK_CAPTURE_5 

Capture the counter value on channel 5.

NRF_GRTC_TASK_CAPTURE_6 

Capture the counter value on channel 6.

NRF_GRTC_TASK_CAPTURE_7 

Capture the counter value on channel 7.

NRF_GRTC_TASK_CAPTURE_8 

Capture the counter value on channel 8.

NRF_GRTC_TASK_CAPTURE_9 

Capture the counter value on channel 9.

NRF_GRTC_TASK_CAPTURE_10 

Capture the counter value on channel 10.

NRF_GRTC_TASK_CAPTURE_11 

Capture the counter value on channel 11.

Function Documentation

◆ nrf_grtc_clkout_divider_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_clkout_divider_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the fast clock divisor value of clock output.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Fastclock divisor value.

◆ nrf_grtc_clkout_divider_set()

NRF_STATIC_INLINE void nrf_grtc_clkout_divider_set ( NRF_GRTC_Type *  p_reg,
uint32_t  value 
)

Function for setting the fast clock divisor value of clock output.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]valueFast clock divisor value.

◆ nrf_grtc_clkout_enable_check()

NRF_STATIC_INLINE bool nrf_grtc_clkout_enable_check ( NRF_GRTC_Type const *  p_reg,
nrf_grtc_clkout_t  clkout 
)

Function for checking whether clock source is connected to clkout pin.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]clkoutSelected clkout source.
Return values
Trueif the clkout source is enabled, false otherwise.

◆ nrf_grtc_clkout_set()

NRF_STATIC_INLINE void nrf_grtc_clkout_set ( NRF_GRTC_Type *  p_reg,
nrf_grtc_clkout_t  clkout,
bool  enable 
)

Function for setting the specified clock source to be connected to output pin.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]clkoutSelected clkout source.
[in]enableTrue if the clkout source is to be enabled, false otherwise.

◆ nrf_grtc_clksel_get()

NRF_STATIC_INLINE nrf_grtc_clksel_t nrf_grtc_clksel_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the clock source of the GRTC low-frequency clock.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Clock source configuration.

◆ nrf_grtc_clksel_set()

NRF_STATIC_INLINE void nrf_grtc_clksel_set ( NRF_GRTC_Type *  p_reg,
nrf_grtc_clksel_t  clksel 
)

Function for setting the clock source for the GRTC low-frequency clock.

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

◆ nrf_grtc_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_event_address_get ( NRF_GRTC_Type const *  p_reg,
nrf_grtc_event_t  event 
)

Function for returning the address of an event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventRequested event.
Returns
Address of the requested event register.

◆ nrf_grtc_event_check()

NRF_STATIC_INLINE bool nrf_grtc_event_check ( NRF_GRTC_Type const *  p_reg,
nrf_grtc_event_t  event 
)

Function for retrieving the state of the GRTC 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.

◆ nrf_grtc_event_clear()

NRF_STATIC_INLINE void nrf_grtc_event_clear ( NRF_GRTC_Type *  p_reg,
nrf_grtc_event_t  event 
)

Function for clearing an event.

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

◆ nrf_grtc_event_disable()

NRF_STATIC_INLINE void nrf_grtc_event_disable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for disabling events.

Note
Only specific events can be individually enabled or disabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of event flags to be disabled.

◆ nrf_grtc_event_enable()

NRF_STATIC_INLINE void nrf_grtc_event_enable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for enabling events.

Note
Only specific events can be individually enabled or disabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of event flags to be enabled.

◆ nrf_grtc_int_disable()

NRF_STATIC_INLINE void nrf_grtc_int_disable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for disabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_grtc_int_mask_t values for bit masking.

◆ nrf_grtc_int_enable()

NRF_STATIC_INLINE void nrf_grtc_int_enable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for enabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_grtc_int_mask_t values for bit masking.

◆ nrf_grtc_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_grtc_int_enable_check ( NRF_GRTC_Type const *  p_reg,
uint32_t  mask 
)

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_grtc_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrf_grtc_int_pending_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_int_pending_get ( NRF_GRTC_Type const *  p_reg)

Function for retrieving the state of pending interrupts.

Note
States of pending interrupt are saved as a bitmask. One set at particular position means that interrupt for event is pending.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Bitmask with information about pending interrupts. Use nrf_grtc_int_mask_t values for bit masking.

◆ nrf_grtc_publish_clear()

NRF_STATIC_INLINE void nrf_grtc_publish_clear ( NRF_GRTC_Type *  p_reg,
nrf_grtc_event_t  event 
)

Function for clearing the publish configuration for a given GRTC event.

Note
Not every event has its corresponding publish register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrf_grtc_publish_set()

NRF_STATIC_INLINE void nrf_grtc_publish_set ( NRF_GRTC_Type *  p_reg,
nrf_grtc_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given GRTC event.

Note
Not every event has its corresponding publish register. Refer to the Product Specification for more information.
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.

◆ nrf_grtc_pwm_compare_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_pwm_compare_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the PWM compare value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Valueof PWM compare.

◆ nrf_grtc_pwm_compare_set()

NRF_STATIC_INLINE void nrf_grtc_pwm_compare_set ( NRF_GRTC_Type *  p_reg,
uint32_t  value 
)

Function for setting the PWM compare value.

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

◆ nrf_grtc_rt_counter_cc_get()

NRF_STATIC_INLINE uint64_t nrf_grtc_rt_counter_cc_get ( NRF_GRTC_Type const *  p_reg)

Function for returning the compare value for the RTCOUNTER.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value from the capture/compare register in 32 kHz units.

◆ nrf_grtc_rt_counter_cc_set()

NRF_STATIC_INLINE void nrf_grtc_rt_counter_cc_set ( NRF_GRTC_Type *  p_reg,
uint64_t  cc_value,
bool  sync 
)

Function for setting a compare value for the RTCOUNTER.

Note
The internal synchronization mechanism ensures that the desired value will be properly latched by the GRTC. However when sync parameter is true then the process of capturing the value lasts up to two 32 kHz cycles. If the sync parameter is false then the capturing the value will occur on the following rising edge of 32 kHz clock. In this case it is user's responsibility to execute the function between the 32 kHz rising edges.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_valueCompare value to be set in 32 kHz units.
[in]syncTrue if the internal synchronization mechanism shall be used, false otherwise.

◆ nrf_grtc_rt_counter_high_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_rt_counter_high_get ( NRF_GRTC_Type const *  p_reg)

Function for returning the higher 32-bits of RTCOUNTER value.

Note
The whole RTCOUNTER value is latched when nrf_grtc_rt_counter_low_get function is executed. Thus nrf_grtc_rt_counter_low_get must be executed before calling nrf_grtc_rt_counter_high_get.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Higher part of RTCOUNTER value.

◆ nrf_grtc_rt_counter_low_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_rt_counter_low_get ( NRF_GRTC_Type const *  p_reg)

Function for returning the lower 32-bits of RTCOUNTER value.

Note
The whole RTCOUNTER value is latched when nrf_grtc_rt_counter_low_get function is executed. Thus nrf_grtc_rt_counter_low_get must be executed before calling nrf_grtc_rt_counter_high_get.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Lower part of RTCOUNTER value.

◆ nrf_grtc_shorts_disable()

NRF_STATIC_INLINE void nrf_grtc_shorts_disable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for disabling the specified shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskBitmask of shortcuts to be disabled.

◆ nrf_grtc_shorts_enable()

NRF_STATIC_INLINE void nrf_grtc_shorts_enable ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for enabling the specified shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskBitmask of shortcuts to be enabled.

◆ nrf_grtc_shorts_set()

NRF_STATIC_INLINE void nrf_grtc_shorts_set ( NRF_GRTC_Type *  p_reg,
uint32_t  mask 
)

Function for setting the specified shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskBitmask of shortcuts to be set.

◆ nrf_grtc_subscribe_clear()

NRF_STATIC_INLINE void nrf_grtc_subscribe_clear ( NRF_GRTC_Type *  p_reg,
nrf_grtc_task_t  task 
)

Function for clearing the subscribe configuration for a given GRTC task.

Note
Not every task has its corresponding subscribe register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrf_grtc_subscribe_set()

NRF_STATIC_INLINE void nrf_grtc_subscribe_set ( NRF_GRTC_Type *  p_reg,
nrf_grtc_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given GRTC task.

Note
Not every task has its corresponding subscribe register. Refer to the Product Specification for more information.
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.

◆ nrf_grtc_sys_counter_active_check()

NRF_STATIC_INLINE bool nrf_grtc_sys_counter_active_check ( NRF_GRTC_Type const *  p_reg)

Function for checking whether the specified SYSCOUNTER channel is requested to remain active.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Trueif SYSCOUNTER channel is requested to remain active, false otherwise.

◆ nrf_grtc_sys_counter_active_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_active_set ( NRF_GRTC_Type *  p_reg,
bool  enable 
)

Function for setting the request to keep the specified SYSCOUNTER channel active.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if the SYSCOUNTER channel is to be kept active, false otherwise.

◆ nrf_grtc_sys_counter_active_state_request_check()

NRF_STATIC_INLINE bool nrf_grtc_sys_counter_active_state_request_check ( NRF_GRTC_Type const *  p_reg)

Function for checking whether the SYSCOUNTER is requested to remain active.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Trueif request for keeping the SYSCOUNTER is active, false otherwise.

◆ nrf_grtc_sys_counter_active_state_request_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_active_state_request_get ( NRF_GRTC_Type const *  p_reg,
uint32_t  mask 
)

Function for getting the domains that requested the SYSCOUNTER to remain active.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskDomains mask.
Return values
Bitmaskof domains that keep the SYSCOUNTER active.

◆ nrf_grtc_sys_counter_active_state_request_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_active_state_request_set ( NRF_GRTC_Type *  p_reg,
bool  enable 
)

Function for setting the request to keep the SYSCOUNTER active.

Note
This function modifies the KEEPRUNNING register, which possesses information whether any local CPU needs keeping the SYSCOUNTER active.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if the automatic mode is to be enabled, false otherwise.

◆ nrf_grtc_sys_counter_auto_mode_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_auto_mode_set ( NRF_GRTC_Type *  p_reg,
bool  enable 
)

Function for setting automatic mode for the SYSCOUNTER.

Note
When enable is false then the SYSCOUNTER remains active when KEEPRUNNING is set, or any task register, INT register or SYSCOUNTER register is being accessed. When enable is true then in addition the SYSCOUNTER remains active when any local CPU that is not sleeping keeps the SYSCOUNTER active.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if the automatic mode is to be enabled, false otherwise.

◆ nrf_grtc_sys_counter_capture_task_get()

NRF_STATIC_INLINE nrf_grtc_task_t nrf_grtc_sys_counter_capture_task_get ( uint8_t  cc_channel)

Function for getting the 1 MHz SYSCOUNTER timer capture task associated with the specified channel.

Parameters
[in]cc_channelCapture channel.
Returns
Capture task.

◆ nrf_grtc_sys_counter_cc_add_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_cc_add_set ( NRF_GRTC_Type *  p_reg,
uint8_t  cc_channel,
uint32_t  value,
nrf_grtc_cc_add_reference_t  reference 
)

Function for setting the value to be added to capture/compare register for the SYSCOUNTER.

Note
There are two available configurations of adding operation: When reference value equals NRF_GRTC_CC_ADD_REFERENCE_SYSCOUNTER then the final value of capture/compare register is a sum of SYSCOUNTER current value and value. When reference value equals NRF_GRTC_CC_ADD_REFERENCE_CC then the final value of capture/compare register is a sum of current capture/compare value and value. If the capture/compare register overflows after this write, then the corresponding event is generated immediately.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelThe specified capture/compare channel.
[in]valueValue to be added in 1 MHz units.
[in]referenceConfiguration of adding mode.

◆ nrf_grtc_sys_counter_cc_enable_check()

NRF_STATIC_INLINE bool nrf_grtc_sys_counter_cc_enable_check ( NRF_GRTC_Type const *  p_reg,
uint8_t  cc_channel 
)

Function for checking whether the specified capture/compare channel is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelChannel to be checked.
Return values
trueSpecified channel is enabled.
falseSpecified channel is disabled.

◆ nrf_grtc_sys_counter_cc_get()

NRF_STATIC_INLINE uint64_t nrf_grtc_sys_counter_cc_get ( NRF_GRTC_Type const *  p_reg,
uint8_t  cc_channel 
)

Function for getting the capture/compare value of channel for the SYSCOUNTER.

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 in 1MHz units.

◆ nrf_grtc_sys_counter_cc_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_cc_set ( NRF_GRTC_Type *  p_reg,
uint8_t  cc_channel,
uint64_t  cc_value 
)

Function for setting the compare value of channel for the SYSCOUNTER.

Note
The corresponding event is automatically disabled by hardware during the operation.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelThe specified capture/compare channel.
[in]cc_valueCompare value to be set in 1 MHz units.

◆ nrf_grtc_sys_counter_check()

NRF_STATIC_INLINE bool nrf_grtc_sys_counter_check ( NRF_GRTC_Type const *  p_reg)

Function for checking whether the SYSCOUNTER is in active state.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Trueif the SYSCOUNTER is active, false otherwise.

◆ nrf_grtc_sys_counter_compare_event_disable()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_compare_event_disable ( NRF_GRTC_Type *  p_reg,
uint8_t  cc_channel 
)

Function for disabling SYSCOUNTER compare event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelChannel number of compare event to be disabled.

◆ nrf_grtc_sys_counter_compare_event_enable()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_compare_event_enable ( NRF_GRTC_Type *  p_reg,
uint8_t  cc_channel 
)

Function for enabling SYSCOUNTER compare event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]cc_channelChannel number of compare event to be enabled.

◆ nrf_grtc_sys_counter_compare_event_get()

NRF_STATIC_INLINE nrf_grtc_event_t nrf_grtc_sys_counter_compare_event_get ( uint8_t  cc_channel)

Function for getting the SYSCOUNTER compare event associated with the specified compare cc_channel.

Parameters
[in]cc_channelCompare channel number.
Returns
Requested compare event.

◆ nrf_grtc_sys_counter_high_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_high_get ( NRF_GRTC_Type const *  p_reg)

Function for returning the higher 32-bits of SYSCOUNTER value.

Note
nrf_grtc_sys_counter_low_get must be executed before calling nrf_grtc_sys_counter_high_get. In addition, after this, nrf_grtc_sys_counter_overflow_check should be called. If it retuns true, whole procedure should be repeated.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Higher part SYSCOUNTER value.

◆ nrf_grtc_sys_counter_interval_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_interval_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the value of interval for periodic capture/compare event for channel 0.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Valueof the interval in 1 MHz units.

◆ nrf_grtc_sys_counter_interval_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_interval_set ( NRF_GRTC_Type *  p_reg,
uint32_t  value 
)

Function for setting the periodic compare event for capture/compare channel 0.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]valuePeriod value in 1 MHz units.

◆ nrf_grtc_sys_counter_low_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_sys_counter_low_get ( NRF_GRTC_Type const *  p_reg)

Function for returning the lower 32-bits of SYSCOUNTER value.

Note
nrf_grtc_sys_counter_low_get must be executed before calling nrf_grtc_sys_counter_high_get. In addition, after this, nrf_grtc_sys_counter_overflow_check should be called. If it retuns true, whole procedure should be repeated.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Lower part of SYSCOUNTER value.

◆ nrf_grtc_sys_counter_overflow_check()

NRF_STATIC_INLINE bool nrf_grtc_sys_counter_overflow_check ( NRF_GRTC_Type const *  p_reg)

Function for checking whether the lower 32-bits of SYSCOUNTER overflowed after last execution of nrf_grtc_sys_counter_low_get.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Trueif the lower 32-bits of SYSCOUNTER overflowed, false otherwise.

◆ nrf_grtc_sys_counter_set()

NRF_STATIC_INLINE void nrf_grtc_sys_counter_set ( NRF_GRTC_Type *  p_reg,
bool  enable 
)

Function for setting the SYSCOUNTER.

Note
When the SYSCOUNTER is disabled the GRTC uses RTCOUNTER by default.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if SYSCOUNTER is to be enabled, false otherwise.

◆ nrf_grtc_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_task_address_get ( NRF_GRTC_Type const *  p_reg,
nrf_grtc_task_t  task 
)

Function for returning the address of a task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskRequested task.
Returns
Address of the requested task register.

◆ nrf_grtc_task_trigger()

NRF_STATIC_INLINE void nrf_grtc_task_trigger ( NRF_GRTC_Type *  p_reg,
nrf_grtc_task_t  task 
)

Function for starting a task.

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

◆ nrf_grtc_timeout_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_timeout_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the value of the timeout value for GRTC.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Valueof the timeout in 32 kHz units.

◆ nrf_grtc_timeout_set()

NRF_STATIC_INLINE void nrf_grtc_timeout_set ( NRF_GRTC_Type *  p_reg,
uint32_t  value 
)

Function for setting the timeout value for GRTC.

Note
Timeout between all CPUs going to sleep and stopping the SYSCOUNTER.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]valueTimeout value in 32 kHz units.

◆ nrf_grtc_waketime_get()

NRF_STATIC_INLINE uint32_t nrf_grtc_waketime_get ( NRF_GRTC_Type const *  p_reg)

Function for getting the wake time value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Valueof wake time in 32 kHz units.

◆ nrf_grtc_waketime_set()

NRF_STATIC_INLINE void nrf_grtc_waketime_set ( NRF_GRTC_Type *  p_reg,
uint32_t  value 
)

Function for setting the wake time value for GRTC.

Note
The wake time is maximum number of 32 kHz cycles takes to restore the APB registers when waking from sleep state.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]valueWake time value in 32 kHz units.

Documentation feedback | Developer Zone | Subscribe | Updated