GRTC HALY

group nrfy_grtc

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

Defines

NRFY_GRTC_HAS_EXTENDED

See also

NRF_GRTC_HAS_EXTENDED Symbol indicating whether GRTC has extended functionality.

NRFY_GRTC_HAS_RTCOUNTER

See also

NRF_GRTC_HAS_RTCOUNTER Symbol indicating whether GRTC has RTCOUNTER.

NRFY_GRTC_HAS_SYSCOUNTER_ARRAY

See also

NRF_GRTC_HAS_SYSCOUNTER_ARRAY Symbol indicating whether GRTC has multiple SYSCOUNTER registers.

NRFY_GRTC_HAS_PWM

See also

NRF_GRTC_HAS_CLKOUT Symbol indicating whether GRTC has clock output registers.

NRFY_GRTC_HAS_CLKOUT

See also

NRF_GRTC_HAS_CLKOUT Symbol indicating whether GRTC has clock output registers.

NRFY_GRTC_HAS_CLKSEL

See also

NRF_GRTC_HAS_CLKSEL Symbol indicating whether GRTC has clock source selection.

NRFY_GRTC_SYSCOUNTER_RETRY_MASK

Mask to determine whether the SYSCOUNTER value is reliable.

Functions

NRFY_STATIC_INLINE void nrfy_grtc_int_init(NRF_GRTC_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable)

Function for initializing the specified GRTC 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_grtc_int_uninit(NRF_GRTC_Type *p_reg)

Function for uninitializing the GRTC interrupts.

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

NRFY_STATIC_INLINE uint32_t nrfy_grtc_events_process(NRF_GRTC_Type *p_reg, uint32_t mask)

Function for processing the specified GRTC 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_grtc_prepare(NRF_GRTC_Type *p_reg, bool busy_wait)

Function for preparing the GRTC peripheral.

Note

This function clears all shorts, interrupts, resets and starts the GRTC.

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

  • busy_wait[in] True if wait for synchronization operation is to be performed, false otherwise.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_start(NRF_GRTC_Type *p_reg, bool busy_wait)

Function for starting the SYSCOUNTER.

Note

This function enables the 1 MHz counter and set it as always active.

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

  • busy_wait[in] True if wait for synchronization operation is to be performed, false otherwise.

NRFY_STATIC_INLINE uint64_t nrfy_grtc_sys_counter_get(NRF_GRTC_Type const *p_reg)

Function for returning the SYSCOUNTER 1 MHz value.

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

Returns:

SYSCOUNTER value.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_conter_ready_check(NRF_GRTC_Type const *p_reg)

Function for checking whether SYSCOUNTER value is ready to be read.

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

Returns:

True if SYSCOUNTER is ready to be read, false otherwise.

NRFY_STATIC_INLINE uint64_t nrfy_grtc_rt_counter_get(NRF_GRTC_Type const *p_reg)

Function for returning the RTCOUNTER 32 kHz value.

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

Returns:

RTCOUNTER value.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_int_clear_enable(NRF_GRTC_Type *p_reg, uint8_t channel, bool enable)

Function for enabling the GRTC compare 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.

  • channel[in] Channel representing the GRTC compare event.

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

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_compare_event_check(NRF_GRTC_Type const *p_reg, uint8_t cc_channel)

Function for retrieving the state of the compare GRTC event.

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

  • cc_channel[in] Compare channel of the corresponding event to be checked.

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

  • false – The event has not been generated.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_clear(NRF_GRTC_Type *p_reg, uint8_t cc_channel)

Function for clearing a compare GRTC event.

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

  • cc_channel[in] Compare channel of the corresponding event to be cleared.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_capture_subscribe_set(NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint8_t channel)

Function for setting the subscribe configuration for a given GRTC capture channel.

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

  • cc_channel[in] Compare channel for which to set the configuration.

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

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_capture_subscribe_clear(NRF_GRTC_Type *p_reg, uint8_t cc_channel)

Function for clearing the subscribe configuration for a given GRTC capture channel.

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

  • cc_channel[in] Compare channel for which to clear the configuration.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_publish_set(NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint8_t channel)

Function for setting the publish configuration for a given GRTC compare channel.

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

  • cc_channel[in] Compare channel for which to set the configuration.

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

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_publish_clear(NRF_GRTC_Type *p_reg, uint8_t cc_channel)

Function for clearing the publish configuration for a given GRTC compare channel.

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

  • cc_channel[in] Compare channel for which to clear the configuration.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_cc_set(NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint64_t cc_value)

See also

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

Note

The corresponding event is automatically disabled by hardware during the operation.

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

  • cc_channel[in] The specified capture/compare channel.

  • cc_value[in] Compare value to be set in 1 MHz units.

NRFY_STATIC_INLINE uint64_t nrfy_grtc_sys_counter_cc_get(NRF_GRTC_Type const *p_reg, uint8_t cc_channel)

See also

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

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

  • cc_channel[in] The specified capture/compare channel.

Returns:

Value from the specified capture/compare register in 1MHz units.

NRFY_STATIC_INLINE void nrfy_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)

See also

nrf_grtc_sys_counter_cc_add_set 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • cc_channel[in] The specified capture/compare channel.

  • value[in] Value to be added in 1 MHz units.

  • reference[in] Configuration of adding mode.

NRFY_STATIC_INLINE void nrfy_grtc_rt_counter_cc_set(NRF_GRTC_Type *p_reg, uint64_t cc_value, bool sync)

See also

nrf_grtc_rt_counter_cc_set 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • cc_value[in] Compare value to be set in 32 kHz units.

  • sync[in] True if the internal synchronization mechanism shall be used, false otherwise.

NRFY_STATIC_INLINE uint64_t nrfy_grtc_rt_counter_cc_get(NRF_GRTC_Type const *p_reg)

See also

nrf_grtc_rt_counter_cc_get Function for returning the compare value for the RTCOUNTER.

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

Returns:

Value from the capture/compare register in 32 kHz units.

NRFY_STATIC_INLINE void nrfy_grtc_int_enable(NRF_GRTC_Type *p_reg, uint32_t mask)

See also

nrf_grtc_int_enable Function for enabling specified interrupts.

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

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

NRFY_STATIC_INLINE void nrfy_grtc_int_disable(NRF_GRTC_Type *p_reg, uint32_t mask)

See also

nrf_grtc_int_disable Function for disabling specified interrupts.

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

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

NRFY_STATIC_INLINE uint32_t nrfy_grtc_int_enable_check(NRF_GRTC_Type const *p_reg, uint32_t mask)

See also

nrf_grtc_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_grtc_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_int_pending_get(NRF_GRTC_Type const *p_reg)

See also

nrf_grtc_int_pending_get 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:
  • p_reg[in] Pointer 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.

NRFY_STATIC_INLINE void nrfy_grtc_shorts_enable(NRF_GRTC_Type *p_reg, uint32_t mask)

See also

nrf_grtc_shorts_enable Function for enabling the specified shortcuts.

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

  • mask[in] Bitmask of shortcuts to be enabled.

NRFY_STATIC_INLINE void nrfy_grtc_shorts_disable(NRF_GRTC_Type *p_reg, uint32_t mask)

See also

nrf_grtc_shorts_disable Function for disabling the specified shortcuts.

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

  • mask[in] Bitmask of shortcuts to be disabled.

NRFY_STATIC_INLINE void nrfy_grtc_shorts_set(NRF_GRTC_Type *p_reg, uint32_t mask)

See also

nrf_grtc_shorts_set Function for setting the specified shortcuts.

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

  • mask[in] Bitmask of shortcuts to be set.

NRFY_STATIC_INLINE void nrfy_grtc_subscribe_set(NRF_GRTC_Type *p_reg, nrf_grtc_task_t task, uint8_t channel)

See also

nrf_grtc_subscribe_set 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:
  • 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_grtc_subscribe_clear(NRF_GRTC_Type *p_reg, nrf_grtc_task_t task)

See also

nrf_grtc_subscribe_clear 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:
  • 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_grtc_publish_set(NRF_GRTC_Type *p_reg, nrf_grtc_event_t event, uint8_t channel)

See also

nrf_grtc_publish_set 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:
  • 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_grtc_publish_clear(NRF_GRTC_Type *p_reg, nrf_grtc_event_t event)

See also

nrf_grtc_publish_clear 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:
  • 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_grtc_event_check(NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event)

See also

nrf_grtc_event_check Function for retrieving the state of the GRTC 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_grtc_event_clear(NRF_GRTC_Type *p_reg, nrf_grtc_event_t event)

See also

nrf_grtc_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 bool nrfy_grtc_sys_counter_overflow_check(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

True – if the lower 32-bits of SYSCOUNTER overflowed, false otherwise.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_event_address_get(NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event)

See also

nrf_grtc_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_grtc_task_address_get(NRF_GRTC_Type const *p_reg, nrf_grtc_task_t task)

See also

nrf_grtc_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_grtc_task_trigger(NRF_GRTC_Type *p_reg, nrf_grtc_task_t task)

See also

nrf_grtc_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_grtc_task_t nrfy_grtc_sys_counter_capture_task_get(uint8_t cc_channel)

See also

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

Parameters:
  • cc_channel[in] Capture channel.

Returns:

Capture task.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_enable(NRF_GRTC_Type *p_reg, uint8_t cc_channel)

See also

nrf_grtc_sys_counter_compare_event_enable Function for enabling SYSCOUNTER compare event.

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

  • cc_channel[in] Channel number of compare event to be enabled.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_disable(NRF_GRTC_Type *p_reg, uint8_t cc_channel)

See also

nrf_grtc_sys_counter_compare_event_disable Function for disabling SYSCOUNTER compare event.

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

  • cc_channel[in] Channel number of compare event to be disabled.

NRFY_STATIC_INLINE nrf_grtc_event_t nrfy_grtc_sys_counter_compare_event_get(uint8_t cc_channel)

See also

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

Parameters:
  • cc_channel[in] Compare channel number.

Returns:

Requested compare event.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_cc_enable_check(NRF_GRTC_Type const *p_reg, uint8_t cc_channel)

See also

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

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

  • cc_channel[in] Channel to be checked.

Return values:
  • true – Specified channel is enabled.

  • false – Specified channel is disabled.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_set(NRF_GRTC_Type *p_reg, bool enable)

See also

nrf_grtc_sys_counter_set Function for setting the SYSCOUNTER.

Note

When the SYSCOUNTER is disabled the GRTC uses RTCOUNTER by default.

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

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

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_auto_mode_set(NRF_GRTC_Type *p_reg, bool enable)

See also

nrf_grtc_sys_counter_auto_mode_set 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if the automatic mode is to be enabled, false otherwise.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_auto_mode_check(NRF_GRTC_Type *p_reg)

See also

nrf_grtc_sys_counter_auto_mode_check Function for checking whether the SYSCOUNTER has automatic mode enabled.

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

Returns:

True Automatic mode is enabled.

Returns:

False Automatic mode is disabled.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_active_set(NRF_GRTC_Type *p_reg, bool enable)

See also

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

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

  • enable[in] True if the SYSCOUNTER channel is to be kept active, false otherwise.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_active_check(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

True – if SYSCOUNTER channel is requested to remain active, false otherwise.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_check(NRF_GRTC_Type *p_reg)

See also

nrf_grtc_sys_counter_check Function for checking whether the SYSCOUNTER is in active state.

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

Return values:

True – if the SYSCOUNTER is active, false otherwise.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_active_state_request_set(NRF_GRTC_Type *p_reg, bool enable)

See also

nrf_grtc_sys_counter_active_state_request_set 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • enable[in] True if the automatic mode is to be enabled, false otherwise.

NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_active_state_request_check(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

True – if request for keeping the SYSCOUNTER is active, false otherwise.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_sys_counter_active_state_request_get(NRF_GRTC_Type const *p_reg, uint32_t mask)

See also

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

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

  • mask[in] Domains mask.

Return values:

Bitmask – of domains that keep the SYSCOUNTER active.

NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_interval_set(NRF_GRTC_Type *p_reg, uint32_t value)

See also

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

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

  • value[in] Period value in 1 MHz units.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_sys_counter_interval_get(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

Value – of the interval in 1 MHz units.

NRFY_STATIC_INLINE void nrfy_grtc_timeout_set(NRF_GRTC_Type *p_reg, uint32_t value)

See also

nrf_grtc_timeout_set Function for setting the timeout value for GRTC.

Note

Timeout between all CPUs going to sleep and stopping the SYSCOUNTER.

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

  • value[in] Timeout value in 32 kHz units.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_timeout_get(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

Value – of the timeout in 32 kHz units.

NRFY_STATIC_INLINE void nrfy_grtc_waketime_set(NRF_GRTC_Type *p_reg, uint32_t value)

See also

nrf_grtc_waketime_set 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:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • value[in] Wake time value in 32 kHz units.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_waketime_get(NRF_GRTC_Type const *p_reg)

See also

nrf_grtc_waketime_get Function for getting the wake time value.

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

Return values:

Value – of wake time in 32 kHz units.

NRFY_STATIC_INLINE void nrfy_grtc_pwm_compare_set(NRF_GRTC_Type *p_reg, uint32_t value)

See also

nrf_grtc_pwm_compare_set Function for setting the PWM compare value.

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

  • value[in] PWM compare value.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_pwm_compare_get(NRF_GRTC_Type const *p_reg)

See also

nrf_grtc_pwm_compare_get Function for getting the PWM compare value.

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

Return values:

Value – of PWM compare.

NRFY_STATIC_INLINE void nrfy_grtc_clkout_set(NRF_GRTC_Type *p_reg, nrf_grtc_clkout_t clkout, bool enable)

See also

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

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

  • clkout[in] Selected clkout source.

  • enable[in] True if the clkout source is to be enabled, false otherwise.

NRFY_STATIC_INLINE bool nrfy_grtc_clkout_enable_check(NRF_GRTC_Type const *p_reg, nrf_grtc_clkout_t clkout)

See also

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

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

  • clkout[in] Selected clkout source.

Return values:

True – if the clkout source is enabled, false otherwise.

NRFY_STATIC_INLINE void nrfy_grtc_clkout_divider_set(NRF_GRTC_Type *p_reg, uint32_t value)

See also

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

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

  • value[in] Fast clock divisor value.

NRFY_STATIC_INLINE uint32_t nrfy_grtc_clkout_divider_get(NRF_GRTC_Type const *p_reg)

See also

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

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

Return values:

Fast – clock divisor value.

NRF_STATIC_INLINE void nrfy_grtc_clksel_set(NRF_GRTC_Type *p_reg, nrf_grtc_clksel_t clksel)

See also

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

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

  • clksel[in] Selected clock source.

NRF_STATIC_INLINE nrf_grtc_clksel_t nrfy_grtc_clksel_get(NRF_GRTC_Type const *p_reg)

See also

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

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

Returns:

Clock source configuration.