R1 code for micro:bit based train controller code, requires second micro:bit running rx code to operate - see https://meanderingpi.wordpress.com/ for more information
Fork of
nrf51-sdk
by Lancaster University
« Back to documentation index
WDT HAL
Hardware access layer for accessing the watchdog timer (WDT) peripheral.
More...
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 CPU SLEEP or HALT mode.
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
__STATIC_INLINE void nrf_wdt_behaviour_set (nrf_wdt_behaviour_t behaviour)
Function for configuring the watchdog behavior when the CPU is sleeping or halted.
__STATIC_INLINE void nrf_wdt_task_trigger (nrf_wdt_task_t task)
Function for starting the watchdog.
__STATIC_INLINE void nrf_wdt_event_clear (nrf_wdt_event_t event)
Function for clearing the WDT event.
__STATIC_INLINE bool nrf_wdt_event_check (nrf_wdt_event_t event)
Function for retrieving the state of the WDT event.
__STATIC_INLINE void nrf_wdt_int_enable (uint32_t int_mask)
Function for enabling a specific interrupt.
__STATIC_INLINE bool nrf_wdt_int_enable_check (uint32_t int_mask)
Function for retrieving the state of given interrupt.
__STATIC_INLINE void nrf_wdt_int_disable (uint32_t int_mask)
Function for disabling a specific interrupt.
__STATIC_INLINE uint32_t nrf_wdt_task_address_get (nrf_wdt_task_t task)
Function for returning the address of a specific WDT task register.
__STATIC_INLINE uint32_t nrf_wdt_event_address_get (nrf_wdt_event_t event)
Function for returning the address of a specific WDT event register.
__STATIC_INLINE bool nrf_wdt_started (void)
Function for retrieving the watchdog status.
__STATIC_INLINE bool nrf_wdt_request_status (nrf_wdt_rr_register_t rr_register)
Function for retrieving the watchdog reload request status.
__STATIC_INLINE void nrf_wdt_reload_value_set (uint32_t reload_value)
Function for setting the watchdog reload value.
__STATIC_INLINE uint32_t nrf_wdt_reload_value_get (void)
Function for retrieving the watchdog reload value.
__STATIC_INLINE void nrf_wdt_reload_request_enable (nrf_wdt_rr_register_t rr_register)
Function for enabling a specific reload request register.
__STATIC_INLINE void nrf_wdt_reload_request_disable (nrf_wdt_rr_register_t rr_register)
Function for disabling a specific reload request register.
__STATIC_INLINE bool nrf_wdt_reload_request_is_enabled (nrf_wdt_rr_register_t rr_register)
Function for retrieving the status of a specific reload request register.
__STATIC_INLINE void nrf_wdt_reload_request_set (nrf_wdt_rr_register_t rr_register)
Function for setting a specific reload request register.
Detailed Description
Hardware access layer for accessing the watchdog timer (WDT) peripheral.
Enumeration Type Documentation
WDT behavior in CPU SLEEP or HALT mode.
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.
Definition at line 82 of file nrf_wdt.h .
WDT events.
Enumerator:
NRF_WDT_EVENT_TIMEOUT
Event from WDT time-out.
Definition at line 71 of file nrf_wdt.h .
WDT interrupts.
Enumerator:
NRF_WDT_INT_TIMEOUT_MASK
WDT interrupt from time-out event.
Definition at line 110 of file nrf_wdt.h .
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.
Definition at line 94 of file nrf_wdt.h .
WDT tasks.
Enumerator:
NRF_WDT_TASK_START
Task for starting WDT.
Definition at line 60 of file nrf_wdt.h .
Function Documentation
Function for configuring the watchdog behavior when the CPU is sleeping or halted.
Parameters:
behaviour Watchdog behavior when CPU is in SLEEP or HALT mode.
Definition at line 120 of file nrf_wdt.h .
__STATIC_INLINE uint32_t nrf_wdt_event_address_get
(
nrf_wdt_event_t
event )
Function for returning the address of a specific WDT event register.
Parameters:
Return values:
address of requested event register
Definition at line 216 of file nrf_wdt.h .
Function for retrieving the state of the WDT event.
Parameters:
Return values:
true If the event is set.
false If the event is not set.
Definition at line 156 of file nrf_wdt.h .
Function for clearing the WDT event.
Parameters:
Definition at line 142 of file nrf_wdt.h .
__STATIC_INLINE void nrf_wdt_int_disable
(
uint32_t
int_mask )
Function for disabling a specific interrupt.
Parameters:
Definition at line 192 of file nrf_wdt.h .
__STATIC_INLINE void nrf_wdt_int_enable
(
uint32_t
int_mask )
Function for enabling a specific interrupt.
Parameters:
Definition at line 167 of file nrf_wdt.h .
__STATIC_INLINE bool nrf_wdt_int_enable_check
(
uint32_t
int_mask )
Function for retrieving the state of given interrupt.
Parameters:
Return values:
true Interrupt is enabled.
false Interrupt is not enabled.
Definition at line 181 of file nrf_wdt.h .
Function for disabling a specific reload request register.
Parameters:
[in] rr_register Reload request register to disable.
Definition at line 286 of file nrf_wdt.h .
Function for enabling a specific reload request register.
Parameters:
[in] rr_register Reload request register to enable.
Definition at line 275 of file nrf_wdt.h .
Function for retrieving the status of a specific reload request register.
Parameters:
[in] rr_register Reload request register to check.
Return values:
true If the reload request register is enabled.
false If the reload request register is not enabled.
Definition at line 300 of file nrf_wdt.h .
Function for setting a specific reload request register.
Parameters:
[in] rr_register Reload request register to set.
Definition at line 311 of file nrf_wdt.h .
__STATIC_INLINE uint32_t nrf_wdt_reload_value_get
(
void
)
Function for retrieving the watchdog reload value.
Return values:
Definition at line 264 of file nrf_wdt.h .
__STATIC_INLINE void nrf_wdt_reload_value_set
(
uint32_t
reload_value )
Function for setting the watchdog reload value.
Parameters:
[in] reload_value Watchdog counter initial value.
Definition at line 253 of file nrf_wdt.h .
Function for retrieving the watchdog reload request status.
Parameters:
[in] rr_register Reload request register to check.
Return values:
true If a reload request is running.
false If no reload request is running.
Definition at line 242 of file nrf_wdt.h .
__STATIC_INLINE bool nrf_wdt_started
(
void
)
Function for retrieving the watchdog status.
Return values:
true If the watchdog is started.
false If the watchdog is not started.
Definition at line 228 of file nrf_wdt.h .
__STATIC_INLINE uint32_t nrf_wdt_task_address_get
(
nrf_wdt_task_t
task )
Function for returning the address of a specific WDT task register.
Parameters:
Definition at line 203 of file nrf_wdt.h .
Function for starting the watchdog.
Parameters:
Definition at line 131 of file nrf_wdt.h .