Watchdog Timer (WDT) peripheral driver.
More...
Watchdog Timer (WDT) peripheral driver.
◆ NRFX_WDT_DEFAULT_CONFIG
#define NRFX_WDT_DEFAULT_CONFIG |
Value:{ \
.reload_value = 2000, \
NRFX_WDT_IRQ_CONFIG \
}
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_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:88
Macro for creating an instance of the WDT driver.
◆ nrfx_wdt_channel_alloc()
Function for allocating a watchdog channel.
- Note
- This function can not be called after nrfx_wdt_start().
- 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 invidual 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. |
[in] | wdt_event_handler | Event handler provided by the user. Ignored when NRFX_WDT_CONFIG_NO_IRQ option is enabled. |
- Return values
-
NRFX_SUCCESS | Initialization was successful. |
NRFX_ERROR_INVALID_STATE | The driver was already initialized. |
◆ 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.