Independent Watchdog (IWDG)¶
1. Introduction¶
- IWDG is a hardware timer used to monitor system faults caused by abnormal operation and to recover from such faults.
2. Features¶
- CI13XX supports one IWDG module. IWDG is based on a 32‑bit down‑counter. The counter decrements from the load value; when it reaches 0, a timeout interrupt is generated and the counter is reloaded. If the timeout interrupt is not cleared and the counter reaches 0 again, the IWDG will request a reset.
- The reset domain can be configured via
dpmu_iwdg_reset_none_config,dpmu_iwdg_reset_system_config, anddpmu_iwdg_reset_bus_config.
3. API List¶
| Function | Description |
|---|---|
| iwdg_init | Initialize IWDG device |
| iwdg_open | Start IWDG device |
| iwdg_close | Stop IWDG device |
| iwdg_feed | Feed the IWDG |
4. Example¶
The following code configures and starts the IWDG with a 1 s feed interval:
```c
include “ci130x_scu.h”¶
include “ci130x_dpmu.h”¶
include “ci130x_iwdg.h”¶
include “ci130x_core_eclic.h”¶
void iwdg_test() { /* Enable IWDG controller clock */
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
}