[Stub] support.
Independent watchdog support.
Once started, the independent watchdog cannot be turned off.
Defines
Author: Michael Hope, Marti Bolivar <> 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. Enums
- IWDG_BASE
- IWDG_KR_UNLOCK
- IWDG_KR_FEED
- IWDG_KR_START
- IWDG_PR_DIV_4
- IWDG_PR_DIV_8
- IWDG_PR_DIV_16
- IWDG_PR_DIV_32
- IWDG_PR_DIV_64
- IWDG_PR_DIV_128
- IWDG_PR_DIV_256
- IWDG_SR_RVU_BIT
- IWDG_SR_PVU_BIT
- IWDG_SR_RVU
- IWDG_SR_PVU
Functions
- iwdg_prescaler enum
Independent watchdog prescalers.
Values:
- IWDG_PRE_4 = IWDG_PR_DIV_4 -
- IWDG_PRE_8 = IWDG_PR_DIV_8 -
- IWDG_PRE_16 = IWDG_PR_DIV_16 -
- IWDG_PRE_32 = IWDG_PR_DIV_32 -
- IWDG_PRE_64 = IWDG_PR_DIV_64 -
- IWDG_PRE_128 = IWDG_PR_DIV_128 -
- IWDG_PRE_256 = IWDG_PR_DIV_256 -
- void iwdg_init(iwdg_prescaler prescaler, uint16 reload)
Initialise and start the watchdog.
The prescaler and reload set the timeout. A prescaler of 3 divides the 40 kHz clock by 32 and gives roughly 1 ms per reload.
Parameters:
- prescaler -
Prescaler for the 40 KHz IWDG clock.
- reload -
Independent watchdog counter reload value.
- void iwdg_feed(void )
Reset the IWDG counter.
Calling this function will cause the IWDG counter to be reset to its reload value.
class iwdg_reg_map
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.