Watchdog Timer
25 Watchdog Timer
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
25.1 Introduction
The watchdog timer API provides a set of functions for using the watchdog timer module. Functions
are provided to deal with the watchdog timer interrupts, and to handle status and configuration of
the watchdog timer.
The watchdog timer module’s function is to prevent system hangs. The watchdog timer module
consists of a 32-bit down counter, a programmable load register, interrupt generation logic, and a
locking register. Once the watchdog timer has been configured, the lock register can be written to
prevent the timer configuration from being inadvertently altered.
The watchdog timer can be configured to generate an interrupt to the processor upon its first time-
out, and to generate a reset signal upon its second timeout. The watchdog timer module generates
the first timeout signal when the 32-bit counter reaches the zero state after being enabled; en-
abling the counter also enables the watchdog timer interrupt. After the first timeout event, the 32-bit
counter is reloaded with the value of the watchdog timer load register, and the timer resumes count-
ing down from that value. If the timer counts down to its zero state again before the first timeout
interrupt is cleared, and the reset signal has been enabled, the watchdog timer asserts its reset
signal to the system. If the interrupt is cleared before the 32-bit counter reaches its second timeout,
the 32-bit counter is loaded with the value in the load register, and counting resumes from that
value. If the load register is written with a new value while the watchdog timer counter is counting,
then the counter is loaded with the new value and continues counting.
25.2 Functions
Functions
void ROM_WatchdogEnable (uint32_t ui32Base)
void ROM_WatchdogIntClear (uint32_t ui32Base)
void ROM_WatchdogIntEnable (uint32_t ui32Base)
uint32_t ROM_WatchdogIntStatus (uint32_t ui32Base, bool bMasked)
void ROM_WatchdogIntTypeSet (uint32_t ui32Base, uint32_t ui32Type)
void ROM_WatchdogLock (uint32_t ui32Base)
bool ROM_WatchdogLockState (uint32_t ui32Base)
uint32_t ROM_WatchdogReloadGet (uint32_t ui32Base)
void ROM_WatchdogReloadSet (uint32_t ui32Base, uint32_t ui32LoadVal)
void ROM_WatchdogResetDisable (uint32_t ui32Base)
void ROM_WatchdogResetEnable (uint32_t ui32Base)
bool ROM_WatchdogRunning (uint32_t ui32Base)
void ROM_WatchdogStallDisable (uint32_t ui32Base)
void ROM_WatchdogStallEnable (uint32_t ui32Base)
April 8, 2013 341