nrfx 2.5
Macros | Enumerations | Functions
WDT HAL

Hardware access layer for managing the Watchdog Timer (WDT) peripheral. More...

Macros

#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) }
 WDT tasks. More...
 
enum  nrf_wdt_event_t { NRF_WDT_EVENT_TIMEOUT = offsetof(NRF_WDT_Type, EVENTS_TIMEOUT) }
 WDT events. More...
 
enum  nrf_wdt_behaviour_t {
  NRF_WDT_BEHAVIOUR_RUN_SLEEP = WDT_CONFIG_SLEEP_Msk,
  NRF_WDT_BEHAVIOUR_RUN_HALT = WDT_CONFIG_HALT_Msk,
  NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT = WDT_CONFIG_SLEEP_Msk | WDT_CONFIG_HALT_Msk,
  NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT = 0
}
 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_int_mask_t { NRF_WDT_INT_TIMEOUT_MASK = WDT_INTENSET_TIMEOUT_Msk }
 WDT interrupts. More...
 

Functions

NRF_STATIC_INLINE void nrf_wdt_behaviour_set (NRF_WDT_Type *p_reg, nrf_wdt_behaviour_t behaviour)
 Function for configuring the watchdog behavior when the CPU is sleeping or halted. More...
 
NRF_STATIC_INLINE void nrf_wdt_task_trigger (NRF_WDT_Type *p_reg, nrf_wdt_task_t task)
 Function for starting the WDT task. More...
 
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. More...
 
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. More...
 
NRF_STATIC_INLINE void nrf_wdt_int_enable (NRF_WDT_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupt. More...
 
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. More...
 
NRF_STATIC_INLINE void nrf_wdt_int_disable (NRF_WDT_Type *p_reg, uint32_t mask)
 Function for disabling a specific interrupt. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
NRF_STATIC_INLINE bool nrf_wdt_started (NRF_WDT_Type const *p_reg)
 Function for retrieving the watchdog status. More...
 
NRF_STATIC_INLINE bool nrf_wdt_request_status (NRF_WDT_Type const *p_reg, nrf_wdt_rr_register_t rr_register)
 Function for retrieving the watchdog reload request status. More...
 
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. More...
 
NRF_STATIC_INLINE uint32_t nrf_wdt_reload_value_get (NRF_WDT_Type const *p_reg)
 Function for retrieving the watchdog reload value. More...
 
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. More...
 
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. More...
 
NRF_STATIC_INLINE bool nrf_wdt_reload_request_is_enabled (NRF_WDT_Type const *p_reg, nrf_wdt_rr_register_t rr_register)
 Function for retrieving the status of a specific reload request register. More...
 
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. More...
 

Detailed Description

Hardware access layer for managing the Watchdog Timer (WDT) peripheral.

Enumeration Type Documentation

◆ nrf_wdt_behaviour_t

WDT behavior in the SLEEP or HALT CPU modes.

Enumerator
NRF_WDT_BEHAVIOUR_RUN_SLEEP 

WDT will run when CPU is in SLEEP mode.

NRF_WDT_BEHAVIOUR_RUN_HALT 

WDT will run when CPU is in HALT mode.

NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT 

WDT will run when CPU is in SLEEP or HALT mode.

NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT 

WDT will be paused when CPU is in SLEEP or HALT mode.

◆ nrf_wdt_event_t

WDT events.

Enumerator
NRF_WDT_EVENT_TIMEOUT 

Event from WDT time-out.

◆ nrf_wdt_int_mask_t

WDT interrupts.

Enumerator
NRF_WDT_INT_TIMEOUT_MASK 

WDT interrupt from time-out event.

◆ nrf_wdt_rr_register_t

WDT reload request registers.

Enumerator
NRF_WDT_RR0 

Reload request register 0.

NRF_WDT_RR1 

Reload request register 1.

NRF_WDT_RR2 

Reload request register 2.

NRF_WDT_RR3 

Reload request register 3.

NRF_WDT_RR4 

Reload request register 4.

NRF_WDT_RR5 

Reload request register 5.

NRF_WDT_RR6 

Reload request register 6.

NRF_WDT_RR7 

Reload request register 7.

◆ nrf_wdt_task_t

WDT tasks.

Enumerator
NRF_WDT_TASK_START 

Task for starting WDT.

Function Documentation

◆ nrf_wdt_behaviour_set()

NRF_STATIC_INLINE void nrf_wdt_behaviour_set ( NRF_WDT_Type *  p_reg,
nrf_wdt_behaviour_t  behaviour 
)

Function for configuring the watchdog behavior when the CPU is sleeping or halted.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]behaviourWatchdog behavior when CPU is in SLEEP or HALT mode.

◆ nrf_wdt_event_address_get()

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.

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

◆ nrf_wdt_event_check()

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.

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_wdt_event_clear()

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.

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

◆ nrf_wdt_int_disable()

NRF_STATIC_INLINE void nrf_wdt_int_disable ( NRF_WDT_Type *  p_reg,
uint32_t  mask 
)

Function for disabling a specific interrupt.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled.

◆ nrf_wdt_int_enable()

NRF_STATIC_INLINE void nrf_wdt_int_enable ( NRF_WDT_Type *  p_reg,
uint32_t  mask 
)

Function for enabling the specified interrupt.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled.

◆ nrf_wdt_int_enable_check()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked.
Returns
Mask of enabled interrupts.

◆ nrf_wdt_publish_clear()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrf_wdt_publish_set()

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.

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_wdt_reload_request_disable()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rr_registerReload request register to be disabled.

◆ nrf_wdt_reload_request_enable()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rr_registerReload request register to be enabled.

◆ nrf_wdt_reload_request_is_enabled()

NRF_STATIC_INLINE bool nrf_wdt_reload_request_is_enabled ( NRF_WDT_Type const *  p_reg,
nrf_wdt_rr_register_t  rr_register 
)

Function for retrieving the status of a specific reload request register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rr_registerReload request register to be checked.
Return values
trueThe reload request register is enabled.
falseThe reload request register is not enabled.

◆ nrf_wdt_reload_request_set()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rr_registerReload request register to set.

◆ nrf_wdt_reload_value_get()

NRF_STATIC_INLINE uint32_t nrf_wdt_reload_value_get ( NRF_WDT_Type const *  p_reg)

Function for retrieving the watchdog reload value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Reload value.

◆ nrf_wdt_reload_value_set()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]reload_valueWatchdog counter initial value.

◆ nrf_wdt_request_status()

NRF_STATIC_INLINE bool nrf_wdt_request_status ( NRF_WDT_Type const *  p_reg,
nrf_wdt_rr_register_t  rr_register 
)

Function for retrieving the watchdog reload request status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rr_registerReload request register to be checked.
Return values
trueReload request is running.
falseNo reload requests are running.

◆ nrf_wdt_started()

NRF_STATIC_INLINE bool nrf_wdt_started ( NRF_WDT_Type const *  p_reg)

Function for retrieving the watchdog status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe watchdog is started.
falseThe watchdog is not started.

◆ nrf_wdt_subscribe_clear()

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.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrf_wdt_subscribe_set()

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.

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_wdt_task_address_get()

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.

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

◆ nrf_wdt_task_trigger()

NRF_STATIC_INLINE void nrf_wdt_task_trigger ( NRF_WDT_Type *  p_reg,
nrf_wdt_task_t  task 
)

Function for starting the WDT task.

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

Documentation feedback | Developer Zone | Subscribe | Updated