Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the WDOG Peripheral driver. The WDOG driver configures and initializes the WDOG.
To initialize the WDOG module, call the WDOG_DRV_Init() function and pass in the user configuration structure. This function automatically enables the WDOG module and clock.
After the WDOG_DRV_Init() function is called, the WDOG is enabled and its counter is working. Therefore, the WDOG_DRV_Refresh() function should be called before the WDOG times out.
This example code shows how to initialize and configure the driver:
After the WDOG is enabled, the WDOG_DRV_Refresh() function should be called periodically to prevent the WDOG from timing out.
Otherwise, a reset is asserted. This is called "Feed Dog".
The WDOG can record the reset count caused by the WDOG timeout.
The WDOG can be used to reset the MCU.
If the WDOG interrupt is enabled, the WDOG asserts an interrupt and resets the system after 256 bus clock.
Watchdog Driver | |
Data structure for Watchdog initialization This structure is used when initializing the WDOG during the wdog_init function call. It contains all WDOG configurations. | |
wdog_status_t | WDOG_DRV_Init (const wdog_config_t *userConfigPtr) |
Initializes the Watchdog. More... | |
wdog_status_t | WDOG_DRV_Deinit (void) |
Shuts down the Watchdog. More... | |
void | WDOG_DRV_Refresh (void) |
Refreshes the Watchdog. More... | |
bool | WDOG_DRV_IsRunning (void) |
Gets the Watchdog running status. More... | |
void | WDOG_DRV_ResetSystem (void) |
Resets the MCU by using the Watchdog. More... | |
wdog_status_t WDOG_DRV_Init | ( | const wdog_config_t * | userConfigPtr | ) |
This function initializes the WDOG. When called, the WDOG runs according to the requirements of the configuration.
userConfigPtr | Watchdog user configure data structure, see #wdog_user_config_t. |
wdog_status_t WDOG_DRV_Deinit | ( | void | ) |
This function shuts down the WDOG.
void WDOG_DRV_Refresh | ( | void | ) |
This function feeds the WDOG. It sets the WDOG timer count to zero and should be called before the Watchdog timer times out. Otherwise, a reset is asserted. Enough time should be allowed for the refresh sequence to be detected by the Watchdog timer on the Watchdog clock.
bool WDOG_DRV_IsRunning | ( | void | ) |
This function gets the WDOG running status.
void WDOG_DRV_ResetSystem | ( | void | ) |
This function resets the MCU by using the WDOG.