Hardware access layer with cache and barrier support for managing the GRTC peripheral. More...
Macros | |
#define | NRFY_GRTC_HAS_EXTENDED 1 |
#define | NRFY_GRTC_HAS_RTCOUNTER 1 |
#define | NRFY_GRTC_HAS_SYSCOUNTER_ARRAY 1 |
#define | NRFY_GRTC_HAS_PWM 1 |
#define | NRFY_GRTC_HAS_CLKOUT 1 |
#define | NRFY_GRTC_HAS_CLKSEL 1 |
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. | |
NRFY_STATIC_INLINE void | nrfy_grtc_int_uninit (NRF_GRTC_Type *p_reg) |
Function for uninitializing the GRTC interrupts. | |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_events_process (NRF_GRTC_Type *p_reg, uint32_t mask) |
Function for processing the specified GRTC events. | |
NRFY_STATIC_INLINE void | nrfy_grtc_prepare (NRF_GRTC_Type *p_reg, bool busy_wait) |
Function for preparing the GRTC peripheral. | |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_start (NRF_GRTC_Type *p_reg, bool busy_wait) |
Function for starting the SYSCOUNTER. | |
NRFY_STATIC_INLINE uint64_t | nrfy_grtc_sys_counter_get (NRF_GRTC_Type const *p_reg) |
Function for returning the SYSCOUNTER 1 MHz 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. | |
NRFY_STATIC_INLINE uint64_t | nrfy_grtc_rt_counter_get (NRF_GRTC_Type const *p_reg) |
Function for returning the RTCOUNTER 32 kHz 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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_cc_set (NRF_GRTC_Type *p_reg, uint8_t cc_channel, uint64_t cc_value) |
NRFY_STATIC_INLINE uint64_t | nrfy_grtc_sys_counter_cc_get (NRF_GRTC_Type const *p_reg, uint8_t cc_channel) |
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) |
NRFY_STATIC_INLINE void | nrfy_grtc_rt_counter_cc_set (NRF_GRTC_Type *p_reg, uint64_t cc_value, bool sync) |
NRFY_STATIC_INLINE uint64_t | nrfy_grtc_rt_counter_cc_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_int_enable (NRF_GRTC_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_grtc_int_disable (NRF_GRTC_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_int_enable_check (NRF_GRTC_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_int_pending_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_shorts_enable (NRF_GRTC_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_grtc_shorts_disable (NRF_GRTC_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_grtc_shorts_set (NRF_GRTC_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_grtc_subscribe_set (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_grtc_subscribe_clear (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task) |
NRFY_STATIC_INLINE void | nrfy_grtc_publish_set (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event, uint8_t channel) |
NRFY_STATIC_INLINE void | nrfy_grtc_publish_clear (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event) |
NRFY_STATIC_INLINE bool | nrfy_grtc_event_check (NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event) |
NRFY_STATIC_INLINE void | nrfy_grtc_event_clear (NRF_GRTC_Type *p_reg, nrf_grtc_event_t event) |
NRFY_STATIC_INLINE bool | nrfy_grtc_sys_counter_overflow_check (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_event_address_get (NRF_GRTC_Type const *p_reg, nrf_grtc_event_t event) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_task_address_get (NRF_GRTC_Type const *p_reg, nrf_grtc_task_t task) |
NRFY_STATIC_INLINE void | nrfy_grtc_task_trigger (NRF_GRTC_Type *p_reg, nrf_grtc_task_t task) |
NRFY_STATIC_INLINE nrf_grtc_task_t | nrfy_grtc_sys_counter_capture_task_get (uint8_t cc_channel) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_compare_event_enable (NRF_GRTC_Type *p_reg, uint8_t cc_channel) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_compare_event_disable (NRF_GRTC_Type *p_reg, uint8_t cc_channel) |
NRFY_STATIC_INLINE nrf_grtc_event_t | nrfy_grtc_sys_counter_compare_event_get (uint8_t cc_channel) |
NRFY_STATIC_INLINE bool | nrfy_grtc_sys_counter_cc_enable_check (NRF_GRTC_Type const *p_reg, uint8_t cc_channel) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_set (NRF_GRTC_Type *p_reg, bool enable) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_auto_mode_set (NRF_GRTC_Type *p_reg, bool enable) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_active_set (NRF_GRTC_Type *p_reg, bool enable) |
NRFY_STATIC_INLINE bool | nrfy_grtc_sys_counter_active_check (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE bool | nrfy_grtc_sys_counter_check (NRF_GRTC_Type *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_active_state_request_set (NRF_GRTC_Type *p_reg, bool enable) |
NRFY_STATIC_INLINE bool | nrfy_grtc_sys_counter_active_state_request_check (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_sys_counter_active_state_request_get (NRF_GRTC_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_grtc_sys_counter_interval_set (NRF_GRTC_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_sys_counter_interval_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_timeout_set (NRF_GRTC_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_timeout_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_waketime_set (NRF_GRTC_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_waketime_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_pwm_compare_set (NRF_GRTC_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_pwm_compare_get (NRF_GRTC_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_grtc_clkout_set (NRF_GRTC_Type *p_reg, nrf_grtc_clkout_t clkout, bool enable) |
NRFY_STATIC_INLINE bool | nrfy_grtc_clkout_enable_check (NRF_GRTC_Type const *p_reg, nrf_grtc_clkout_t clkout) |
NRFY_STATIC_INLINE void | nrfy_grtc_clkout_divider_set (NRF_GRTC_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_grtc_clkout_divider_get (NRF_GRTC_Type const *p_reg) |
NRF_STATIC_INLINE void | nrfy_grtc_clksel_set (NRF_GRTC_Type *p_reg, nrf_grtc_clksel_t clksel) |
NRF_STATIC_INLINE nrf_grtc_clksel_t | nrfy_grtc_clksel_get (NRF_GRTC_Type const *p_reg) |
Hardware access layer with cache and barrier support for managing the GRTC peripheral.
#define NRFY_GRTC_HAS_CLKOUT 1 |
#define NRFY_GRTC_HAS_CLKSEL 1 |
#define NRFY_GRTC_HAS_EXTENDED 1 |
#define NRFY_GRTC_HAS_PWM 1 |
#define NRFY_GRTC_HAS_RTCOUNTER 1 |
#define NRFY_GRTC_HAS_SYSCOUNTER_ARRAY 1 |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_clkout_divider_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Fast | clock divisor value. |
NRFY_STATIC_INLINE void nrfy_grtc_clkout_divider_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | value | Fast clock divisor value. |
NRFY_STATIC_INLINE bool nrfy_grtc_clkout_enable_check | ( | NRF_GRTC_Type const * | p_reg, |
nrf_grtc_clkout_t | clkout | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | clkout | Selected clkout source. |
True | if the clkout source is enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_clkout_set | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_clkout_t | clkout, | ||
bool | enable | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | clkout | Selected clkout source. |
[in] | enable | True if the clkout source is to be enabled, false otherwise. |
NRF_STATIC_INLINE nrf_grtc_clksel_t nrfy_grtc_clksel_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrfy_grtc_clksel_set | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_clksel_t | clksel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | clksel | Selected clock source. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_event_address_get | ( | NRF_GRTC_Type const * | p_reg, |
nrf_grtc_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Requested event. |
NRFY_STATIC_INLINE bool nrfy_grtc_event_check | ( | NRF_GRTC_Type const * | p_reg, |
nrf_grtc_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be cleared. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_events_process | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for processing the specified GRTC events.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK(). |
NRFY_STATIC_INLINE void nrfy_grtc_int_disable | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_grtc_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_grtc_int_enable | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. 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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_grtc_int_mask_t values for bit masking. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be initialized. |
[in] | irq_priority | Interrupt priority. |
[in] | enable | True if the interrupts are to be enabled, false otherwise. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_int_pending_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_grtc_int_uninit | ( | NRF_GRTC_Type * | p_reg | ) |
Function for uninitializing the GRTC interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_grtc_prepare | ( | NRF_GRTC_Type * | p_reg, |
bool | busy_wait | ||
) |
Function for preparing the GRTC peripheral.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | busy_wait | True if wait for synchronization operation is to be performed, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_publish_clear | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event 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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to set the configuration. |
[in] | channel | Channel through which to publish the event. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_pwm_compare_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Value | of PWM compare. |
NRFY_STATIC_INLINE void nrfy_grtc_pwm_compare_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | value | PWM compare value. |
NRFY_STATIC_INLINE uint64_t nrfy_grtc_rt_counter_cc_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_grtc_rt_counter_cc_set | ( | NRF_GRTC_Type * | p_reg, |
uint64_t | cc_value, | ||
bool | sync | ||
) |
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.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_value | Compare value to be set in 32 kHz units. |
[in] | sync | True if the internal synchronization mechanism shall be used, 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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_grtc_shorts_disable | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Bitmask of shortcuts to be disabled. |
NRFY_STATIC_INLINE void nrfy_grtc_shorts_enable | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Bitmask of shortcuts to be enabled. |
NRFY_STATIC_INLINE void nrfy_grtc_shorts_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Bitmask of shortcuts to be set. |
NRFY_STATIC_INLINE void nrfy_grtc_subscribe_clear | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to clear the configuration. |
NRFY_STATIC_INLINE void nrfy_grtc_subscribe_set | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_task_t | task, | ||
uint8_t | channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to set the configuration. |
[in] | channel | Channel through which to subscribe events. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_active_check | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
True | if SYSCOUNTER channel is requested to remain active, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_active_set | ( | NRF_GRTC_Type * | p_reg, |
bool | enable | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if the SYSCOUNTER channel is to be kept active, false otherwise. |
NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_active_state_request_check | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
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 | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Domains mask. |
Bitmask | of domains that keep the SYSCOUNTER active. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_active_state_request_set | ( | NRF_GRTC_Type * | p_reg, |
bool | enable | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if the automatic mode is to be enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_auto_mode_set | ( | NRF_GRTC_Type * | p_reg, |
bool | enable | ||
) |
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.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if the automatic mode is to be enabled, false otherwise. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Compare channel for which to clear the configuration. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Compare channel for which to set the configuration. |
[in] | channel | Channel through which to subscribe events. |
NRFY_STATIC_INLINE nrf_grtc_task_t nrfy_grtc_sys_counter_capture_task_get | ( | uint8_t | cc_channel | ) |
[in] | cc_channel | Capture channel. |
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 | ||
) |
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.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | The specified capture/compare channel. |
[in] | value | Value to be added in 1 MHz units. |
[in] | reference | Configuration of adding mode. |
NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_cc_enable_check | ( | NRF_GRTC_Type const * | p_reg, |
uint8_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Channel to be checked. |
true | Specified channel is enabled. |
false | Specified channel is disabled. |
NRFY_STATIC_INLINE uint64_t nrfy_grtc_sys_counter_cc_get | ( | NRF_GRTC_Type const * | p_reg, |
uint8_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | The specified capture/compare channel. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_cc_set | ( | NRF_GRTC_Type * | p_reg, |
uint8_t | cc_channel, | ||
uint64_t | cc_value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | The specified capture/compare channel. |
[in] | cc_value | Compare value to be set in 1 MHz units. |
NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_check | ( | NRF_GRTC_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
True | if the SYSCOUNTER is active, 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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Compare channel of the corresponding event to be checked. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Compare channel of the corresponding event to be cleared. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_disable | ( | NRF_GRTC_Type * | p_reg, |
uint8_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Channel number of compare event to be disabled. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_compare_event_enable | ( | NRF_GRTC_Type * | p_reg, |
uint8_t | cc_channel | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Channel number of compare event to be enabled. |
NRFY_STATIC_INLINE nrf_grtc_event_t nrfy_grtc_sys_counter_compare_event_get | ( | uint8_t | cc_channel | ) |
[in] | cc_channel | Compare channel number. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | channel | Channel representing the GRTC compare event. |
[in] | enable | True if associated interrupt is to be enabled, false otherwise. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | 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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cc_channel | Compare channel for which to set the configuration. |
[in] | channel | Channel through which to publish the event. |
NRFY_STATIC_INLINE uint64_t nrfy_grtc_sys_counter_get | ( | NRF_GRTC_Type const * | p_reg | ) |
Function for returning the SYSCOUNTER 1 MHz value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_sys_counter_interval_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Value | of the interval in 1 MHz units. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_interval_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | value | Period value in 1 MHz units. |
NRFY_STATIC_INLINE bool nrfy_grtc_sys_counter_overflow_check | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
True | if the lower 32-bits of SYSCOUNTER overflowed, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_set | ( | NRF_GRTC_Type * | p_reg, |
bool | enable | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if SYSCOUNTER is to be enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_grtc_sys_counter_start | ( | NRF_GRTC_Type * | p_reg, |
bool | busy_wait | ||
) |
Function for starting the SYSCOUNTER.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | busy_wait | True if wait for synchronization operation is to be performed, false otherwise. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_task_address_get | ( | NRF_GRTC_Type const * | p_reg, |
nrf_grtc_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Requested task. |
NRFY_STATIC_INLINE void nrfy_grtc_task_trigger | ( | NRF_GRTC_Type * | p_reg, |
nrf_grtc_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Requested task. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_timeout_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Value | of the timeout in 32 kHz units. |
NRFY_STATIC_INLINE void nrfy_grtc_timeout_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | value | Timeout value in 32 kHz units. |
NRFY_STATIC_INLINE uint32_t nrfy_grtc_waketime_get | ( | NRF_GRTC_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Value | of wake time in 32 kHz units. |
NRFY_STATIC_INLINE void nrfy_grtc_waketime_set | ( | NRF_GRTC_Type * | p_reg, |
uint32_t | value | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | value | Wake time value in 32 kHz units. |