Watchdog Timer (WDT) peripheral driver.
More...
|
#define | NRFX_WDT_HAS_STOP 1 |
| Symbol indicating whether watchdog stopping is supported.
|
|
#define | NRFX_WDT_IRQ_CONFIG .interrupt_priority = NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY |
| WDT instance interrupt priority configuration.
|
|
#define | NRFX_WDT_INSTANCE(id) |
| Macro for creating an instance of the WDT driver.
|
|
#define | NRFX_WDT_DEFAULT_CONFIG |
| WDT driver default configuration.
|
|
#define | NRFX_WDT_INST_HANDLER_GET(idx) NRFX_CONCAT_3(nrfx_wdt_, idx, _irq_handler) |
| Macro returning WDT interrupt handler.
|
|
Watchdog Timer (WDT) peripheral driver.
◆ NRFX_WDT_DEFAULT_CONFIG
#define NRFX_WDT_DEFAULT_CONFIG |
Value:{ \
.reload_value = 2000, \
}
@ NRF_WDT_BEHAVIOUR_RUN_SLEEP_MASK
Definition: nrf_wdt.h:73
#define NRFX_WDT_IRQ_CONFIG
WDT instance interrupt priority configuration.
Definition: nrfx_wdt.h:34
WDT driver default configuration.
This configuration sets up WDT with the following options:
- run when CPU is in SLEEP mode, pause when in HALT mode
- reload value: 2000 ms
◆ NRFX_WDT_INST_HANDLER_GET
#define NRFX_WDT_INST_HANDLER_GET |
( |
|
idx | ) |
NRFX_CONCAT_3(nrfx_wdt_, idx, _irq_handler) |
Macro returning WDT interrupt handler.
param[in] idx WDT index.
- Returns
- Interrupt handler.
◆ NRFX_WDT_INSTANCE
#define NRFX_WDT_INSTANCE |
( |
|
id | ) |
|
Value:{ \
.p_reg = NRF_WDT##id, \
}
#define NRFX_CONCAT_3(p1, p2, p3)
Macro for concatenating three tokens in macro expansion.
Definition: nrfx_common.h:155
Macro for creating an instance of the WDT driver.
◆ nrfx_wdt_event_handler_t
typedef void(* nrfx_wdt_event_handler_t) (nrf_wdt_event_t event_type, uint32_t requests, void *p_context) |
WDT event handler function type.
- Parameters
-
[in] | event_type | WDT event. |
[in] | requests | Value of the request status register. Bits that have been set can be used to determine which RR (Reload Request) register was the reason for timeout event. Valid only when NRF_WDT_EVENT_TIMEOUT is passed in event_type . |
[in] | p_context | User context. |
◆ nrfx_wdt_channel_alloc()
Function for allocating a watchdog channel.
- Note
- This function can not be called after nrfx_wdt_enable.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[out] | p_channel_id | ID of granted channel. |
- Return values
-
NRFX_SUCCESS | The channel was successfully allocated. |
NRFX_ERROR_NO_MEM | There is no available channel to be used. |
◆ nrfx_wdt_channel_feed()
Function for feeding an individual watchdog channel.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[in] | channel_id | ID of watchdog channel. |
◆ nrfx_wdt_enable()
void nrfx_wdt_enable |
( |
nrfx_wdt_t const * |
p_instance | ) |
|
Function for starting the watchdog.
- Note
- After calling this function the watchdog is started, so the user needs to feed all allocated watchdog channels to avoid reset. At least one watchdog channel must be allocated.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
◆ nrfx_wdt_event_address_get()
Function for returning a requested event address for the WDT driver module.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[in] | event | One of the WDT events. |
- Returns
- Event address.
◆ nrfx_wdt_feed()
void nrfx_wdt_feed |
( |
nrfx_wdt_t const * |
p_instance | ) |
|
Function for feeding the watchdog.
Function feeds all allocated watchdog channels.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
◆ nrfx_wdt_init()
Function for initializing the WDT driver instance.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[in] | p_config | Pointer to the structure with the initial configuration. NULL if configuration is to be skipped and will be done later using nrfx_wdt_reconfigure. |
[in] | wdt_event_handler | Event handler provided by the user. Ignored when NRFX_WDT_CONFIG_NO_IRQ option is enabled. |
[in] | p_context | User context passed in event handler. Ignored when NRFX_WDT_CONFIG_NO_IRQ option is enabled. |
- Return values
-
NRFX_SUCCESS | Initialization was successful. |
NRFX_ERROR_ALREADY | The driver is already initialized. |
NRFX_ERROR_INVALID_STATE | The driver is already initialized. Deprecated - use NRFX_ERROR_ALREADY instead. |
◆ nrfx_wdt_init_check()
bool nrfx_wdt_init_check |
( |
nrfx_wdt_t const * |
p_instance | ) |
|
Function for checking if the WDT driver instance is initialized.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
- Return values
-
true | Instance is already initialized. |
false | Instance is not initialized. |
◆ nrfx_wdt_reconfigure()
Function for reconfiguring the watchdog.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[in] | p_config | Pointer to the structure with the initial configuration. |
- Return values
-
NRFX_SUCCESS | Reconfiguration was successful. |
NRFX_ERROR_BUSY | The watchdog is already active. |
NRFX_ERROR_INVALID_STATE | The watchdog is uninitialized. |
◆ nrfx_wdt_stop()
Function for stopping the watchdog.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
- Return values
-
NRFX_SUCCESS | Watchdog has been successfully stopped. |
NRFX_ERROR_FORBIDDEN | Configuration does not allow for stopping the watchdog. |
◆ nrfx_wdt_task_address_get()
Function for returning a requested task address for the WDT driver module.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |
[in] | task | One of the WDT tasks. |
- Returns
- Task address.
◆ nrfx_wdt_uninit()
void nrfx_wdt_uninit |
( |
nrfx_wdt_t const * |
p_instance | ) |
|
Function for uninitializing the WDT driver instance.
The instance can be uninitialized only when not running.
- Parameters
-
[in] | p_instance | Pointer to the driver instance structure. |