Independent Watchdog (IWDG) support.
Contents
To use the independent watchdog, first call iwdg_init() with the appropriate prescaler and IWDG counter reload values for your application. Afterwards, you must periodically call iwdg_feed() before the IWDG counter reaches 0 to reset the counter to its reload value. If you do not, the chip will reset.
Once started, the independent watchdog cannot be turned off.
Independent watchdog register map type.
Public Members
- __io uint32 KR
Key register.
- __io uint32 PR
Prescaler register.
- __io uint32 RLR
Reload register.
- __io uint32 SR
Status register.
Independent watchdog prescalers.
These divide the 40 kHz IWDG clock.
Values:
Divide by 4.
Divide by 8.
Divide by 16.
Divide by 32.
Divide by 64.
Divide by 128.
Divide by 256.
Initialise and start the watchdog.
The prescaler and reload set the timeout. For example, a prescaler of IWDG_PRE_32 divides the 40 kHz clock by 32 and gives roughly 1 ms per reload.
Parameters: |
|
---|
Reset the IWDG counter.
Calling this function will cause the IWDG counter to be reset to its reload value.
Independent watchdog base pointer.