Hardware access layer for managing the Watchdog Timer (WDT) peripheral. More...
Macros | |
#define | NRF_WDT_INST_GET(idx) NRFX_CONCAT(NRF_, WDT, idx) |
Macro getting pointer to the structure of registers of the WDT peripheral. | |
#define | NRF_WDT_HAS_STOP 1 |
Presence of Task STOP functionality. | |
#define | NRF_WDT_HAS_NMI 1 |
Presence of non-maskable interrupt configuration. | |
#define | NRF_WDT_CHANNEL_NUMBER 0x8UL |
Number of WDT channels. | |
#define | NRF_WDT_RR_VALUE 0x6E524635UL /* Fixed value; should not be modified. */ |
WDT register reload value. | |
Enumerations | |
enum | nrf_wdt_task_t { NRF_WDT_TASK_START = offsetof(NRF_WDT_Type, TASKS_START) , NRF_WDT_TASK_STOP = offsetof(NRF_WDT_Type, TASKS_STOP) } |
WDT tasks. More... | |
enum | nrf_wdt_event_t { NRF_WDT_EVENT_TIMEOUT = offsetof(NRF_WDT_Type, EVENTS_TIMEOUT) , NRF_WDT_EVENT_STOPPED = offsetof(NRF_WDT_Type, EVENTS_STOPPED) } |
WDT events. More... | |
enum | nrf_wdt_behaviour_mask_t { NRF_WDT_BEHAVIOUR_RUN_SLEEP_MASK = WDT_CONFIG_SLEEP_Msk , NRF_WDT_BEHAVIOUR_RUN_HALT_MASK = WDT_CONFIG_HALT_Msk , NRF_WDT_BEHAVIOUR_STOP_ENABLE_MASK = WDT_CONFIG_STOPEN_Msk } |
WDT behavior in the SLEEP or HALT CPU modes. More... | |
enum | nrf_wdt_rr_register_t { NRF_WDT_RR0 = 0 , NRF_WDT_RR1 , NRF_WDT_RR2 , NRF_WDT_RR3 , NRF_WDT_RR4 , NRF_WDT_RR5 , NRF_WDT_RR6 , NRF_WDT_RR7 } |
WDT reload request registers. More... | |
enum | nrf_wdt_rr_register_mask_t { NRF_WDT_RR0_MASK = (1UL << NRF_WDT_RR0) , NRF_WDT_RR1_MASK = (1UL << NRF_WDT_RR1) , NRF_WDT_RR2_MASK = (1UL << NRF_WDT_RR2) , NRF_WDT_RR3_MASK = (1UL << NRF_WDT_RR3) , NRF_WDT_RR4_MASK = (1UL << NRF_WDT_RR4) , NRF_WDT_RR5_MASK = (1UL << NRF_WDT_RR5) , NRF_WDT_RR6_MASK = (1UL << NRF_WDT_RR6) , NRF_WDT_RR7_MASK = (1UL << NRF_WDT_RR7) } |
WDT reload request registers mask. More... | |
enum | nrf_wdt_int_mask_t { NRF_WDT_INT_TIMEOUT_MASK = WDT_INTENSET_TIMEOUT_Msk , NRF_WDT_INT_STOPPED_MASK = WDT_INTENSET_STOPPED_Msk } |
WDT interrupts. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_wdt_behaviour_set (NRF_WDT_Type *p_reg, uint32_t mask) |
Function for configuring the watchdog behaviour when the CPU is sleeping or halted. | |
NRF_STATIC_INLINE void | nrf_wdt_task_trigger (NRF_WDT_Type *p_reg, nrf_wdt_task_t task) |
Function for starting the WDT task. | |
NRF_STATIC_INLINE void | nrf_wdt_event_clear (NRF_WDT_Type *p_reg, nrf_wdt_event_t event) |
Function for clearing the WDT event register. | |
NRF_STATIC_INLINE bool | nrf_wdt_event_check (NRF_WDT_Type const *p_reg, nrf_wdt_event_t event) |
Function for retrieving the state of the WDT event. | |
NRF_STATIC_INLINE void | nrf_wdt_int_enable (NRF_WDT_Type *p_reg, uint32_t mask) |
Function for enabling the specified interrupts. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_int_enable_check (NRF_WDT_Type const *p_reg, uint32_t mask) |
Function for checking if the specified interrupts are enabled. | |
NRF_STATIC_INLINE void | nrf_wdt_int_disable (NRF_WDT_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupts. | |
NRF_STATIC_INLINE void | nrf_wdt_nmi_int_enable (NRF_WDT_Type *p_reg, uint32_t mask) |
Function for enabling the specified non-maskable interrupts. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_nmi_int_enable_check (NRF_WDT_Type const *p_reg, uint32_t mask) |
Function for checking if the specified non-maskable interrupts are enabled. | |
NRF_STATIC_INLINE void | nrf_wdt_nmi_int_disable (NRF_WDT_Type *p_reg, uint32_t mask) |
Function for disabling a specified non-maskable interrupts. | |
NRF_STATIC_INLINE void | nrf_wdt_subscribe_set (NRF_WDT_Type *p_reg, nrf_wdt_task_t task, uint8_t channel) |
Function for setting the subscribe configuration for a given WDT task. | |
NRF_STATIC_INLINE void | nrf_wdt_subscribe_clear (NRF_WDT_Type *p_reg, nrf_wdt_task_t task) |
Function for clearing the subscribe configuration for a given WDT task. | |
NRF_STATIC_INLINE void | nrf_wdt_publish_set (NRF_WDT_Type *p_reg, nrf_wdt_event_t event, uint8_t channel) |
Function for setting the publish configuration for a given WDT event. | |
NRF_STATIC_INLINE void | nrf_wdt_publish_clear (NRF_WDT_Type *p_reg, nrf_wdt_event_t event) |
Function for clearing the publish configuration for a given WDT event. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_task_address_get (NRF_WDT_Type const *p_reg, nrf_wdt_task_t task) |
Function for returning the address of a specific WDT task register. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_event_address_get (NRF_WDT_Type const *p_reg, nrf_wdt_event_t event) |
Function for returning the address of a specific WDT event register. | |
NRF_STATIC_INLINE bool | nrf_wdt_started_check (NRF_WDT_Type const *p_reg) |
Function for retrieving the watchdog status. | |
NRF_STATIC_INLINE bool | nrf_wdt_request_status_check (NRF_WDT_Type const *p_reg, nrf_wdt_rr_register_t rr_register) |
Function for retrieving the watchdog reload request status for specified register. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_request_status_get (NRF_WDT_Type const *p_reg) |
Function for retrieving the watchdog reload requests status mask. | |
NRF_STATIC_INLINE void | nrf_wdt_reload_value_set (NRF_WDT_Type *p_reg, uint32_t reload_value) |
Function for setting the watchdog reload value. | |
NRF_STATIC_INLINE uint32_t | nrf_wdt_reload_value_get (NRF_WDT_Type const *p_reg) |
Function for retrieving the watchdog reload value. | |
NRF_STATIC_INLINE void | nrf_wdt_reload_request_enable (NRF_WDT_Type *p_reg, nrf_wdt_rr_register_t rr_register) |
Function for enabling a specific reload request register. | |
NRF_STATIC_INLINE void | nrf_wdt_reload_request_disable (NRF_WDT_Type *p_reg, nrf_wdt_rr_register_t rr_register) |
Function for disabling a specific reload request register. | |
NRF_STATIC_INLINE bool | nrf_wdt_reload_request_enable_check (NRF_WDT_Type const *p_reg, nrf_wdt_rr_register_t rr_register) |
Function for retrieving the status of a specific reload request register. | |
NRF_STATIC_INLINE void | nrf_wdt_reload_request_set (NRF_WDT_Type *p_reg, nrf_wdt_rr_register_t rr_register) |
Function for setting a specific reload request register. | |
NRF_STATIC_INLINE void | nrf_wdt_task_stop_enable_set (NRF_WDT_Type *p_reg, bool enable) |
Function for enabling or disabling stopping the watchdog. | |
Hardware access layer for managing the Watchdog Timer (WDT) peripheral.
#define NRF_WDT_INST_GET | ( | idx | ) | NRFX_CONCAT(NRF_, WDT, idx) |
Macro getting pointer to the structure of registers of the WDT peripheral.
[in] | idx | WDT instance index. |
enum nrf_wdt_event_t |
enum nrf_wdt_int_mask_t |
WDT reload request registers mask.
WDT reload request registers.
enum nrf_wdt_task_t |
NRF_STATIC_INLINE void nrf_wdt_behaviour_set | ( | NRF_WDT_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for configuring the watchdog behaviour when the CPU is sleeping or halted.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Watchdog behaviour mask, created using nrf_wdt_behaviour_mask_t. |
NRF_STATIC_INLINE uint32_t nrf_wdt_event_address_get | ( | NRF_WDT_Type const * | p_reg, |
nrf_wdt_event_t | event | ||
) |
Function for returning the address of a specific WDT event register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event. |
NRF_STATIC_INLINE bool nrf_wdt_event_check | ( | NRF_WDT_Type const * | p_reg, |
nrf_wdt_event_t | event | ||
) |
Function for retrieving the state of the WDT 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. |
NRF_STATIC_INLINE void nrf_wdt_event_clear | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_event_t | event | ||
) |
Function for clearing the WDT event register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event. |
NRF_STATIC_INLINE void nrf_wdt_int_disable | ( | NRF_WDT_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_wdt_int_enable | ( | NRF_WDT_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_wdt_int_enable_check | ( | NRF_WDT_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_wdt_nmi_int_disable | ( | NRF_WDT_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling a specified non-maskable interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_wdt_nmi_int_enable | ( | NRF_WDT_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified non-maskable interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_wdt_nmi_int_enable_check | ( | NRF_WDT_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified non-maskable interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_wdt_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_wdt_publish_clear | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_event_t | event | ||
) |
Function for clearing the publish configuration for a given WDT event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to clear the configuration. |
NRF_STATIC_INLINE void nrf_wdt_publish_set | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_event_t | event, | ||
uint8_t | channel | ||
) |
Function for setting the publish configuration for a given WDT event.
[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. |
NRF_STATIC_INLINE void nrf_wdt_reload_request_disable | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_rr_register_t | rr_register | ||
) |
Function for disabling a specific reload request register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | rr_register | Reload request register to be disabled. |
NRF_STATIC_INLINE void nrf_wdt_reload_request_enable | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_rr_register_t | rr_register | ||
) |
Function for enabling a specific reload request register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | rr_register | Reload request register to be enabled. |
NRF_STATIC_INLINE bool nrf_wdt_reload_request_enable_check | ( | NRF_WDT_Type const * | p_reg, |
nrf_wdt_rr_register_t | rr_register | ||
) |
Function for retrieving the status of a specific reload request register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | rr_register | Reload request register to be checked. |
true | The reload request register is enabled. |
false | The reload request register is not enabled. |
NRF_STATIC_INLINE void nrf_wdt_reload_request_set | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_rr_register_t | rr_register | ||
) |
Function for setting a specific reload request register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | rr_register | Reload request register to set. |
NRF_STATIC_INLINE uint32_t nrf_wdt_reload_value_get | ( | NRF_WDT_Type const * | p_reg | ) |
Function for retrieving the watchdog reload value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_wdt_reload_value_set | ( | NRF_WDT_Type * | p_reg, |
uint32_t | reload_value | ||
) |
Function for setting the watchdog reload value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | reload_value | Watchdog counter initial value. |
NRF_STATIC_INLINE bool nrf_wdt_request_status_check | ( | NRF_WDT_Type const * | p_reg, |
nrf_wdt_rr_register_t | rr_register | ||
) |
Function for retrieving the watchdog reload request status for specified register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | rr_register | Reload request register to be checked. |
true | Reload request is running. |
false | No reload requests are running. |
NRF_STATIC_INLINE uint32_t nrf_wdt_request_status_get | ( | NRF_WDT_Type const * | p_reg | ) |
Function for retrieving the watchdog reload requests status mask.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE bool nrf_wdt_started_check | ( | NRF_WDT_Type const * | p_reg | ) |
Function for retrieving the watchdog status.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | The watchdog is started. |
false | The watchdog is not started. |
NRF_STATIC_INLINE void nrf_wdt_subscribe_clear | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_task_t | task | ||
) |
Function for clearing the subscribe configuration for a given WDT task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to clear the configuration. |
NRF_STATIC_INLINE void nrf_wdt_subscribe_set | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_task_t | task, | ||
uint8_t | channel | ||
) |
Function for setting the subscribe configuration for a given WDT task.
[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. |
NRF_STATIC_INLINE uint32_t nrf_wdt_task_address_get | ( | NRF_WDT_Type const * | p_reg, |
nrf_wdt_task_t | task | ||
) |
Function for returning the address of a specific WDT task register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task. |
NRF_STATIC_INLINE void nrf_wdt_task_stop_enable_set | ( | NRF_WDT_Type * | p_reg, |
bool | enable | ||
) |
Function for enabling or disabling stopping the watchdog.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if stopping is to be enabled, false otherwise. |
NRF_STATIC_INLINE void nrf_wdt_task_trigger | ( | NRF_WDT_Type * | p_reg, |
nrf_wdt_task_t | task | ||
) |
Function for starting the WDT task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task. |