|
Intel® Quark™ Microcontroller Software Interface
1.4.0
Intel® Quark™ Microcontroller BSP
|
Watchdog timer. More...
Data Structures | |
| struct | qm_wdt_config_t |
| QM WDT configuration type. More... | |
Enumerations | |
| enum | qm_wdt_mode_t { QM_WDT_MODE_RESET = 0, QM_WDT_MODE_INTERRUPT_RESET } |
| WDT Mode type. More... | |
Functions | |
| int | qm_wdt_start (const qm_wdt_t wdt) |
| Start WDT. More... | |
| int | qm_wdt_set_config (const qm_wdt_t wdt, const qm_wdt_config_t *const cfg) |
| Set configuration of WDT module. More... | |
| int | qm_wdt_reload (const qm_wdt_t wdt) |
| Reload the WDT counter. More... | |
| int | qm_wdt_save_context (const qm_wdt_t wdt, qm_wdt_context_t *const ctx) |
| Save watchdog context. More... | |
| int | qm_wdt_restore_context (const qm_wdt_t wdt, const qm_wdt_context_t *const ctx) |
| Restore watchdog context. More... | |
Watchdog timer.
| enum qm_wdt_mode_t |
WDT Mode type.
| int qm_wdt_reload | ( | const qm_wdt_t | wdt | ) |
Reload the WDT counter.
Reload the WDT counter with safety value, i.e. service the watchdog.
| [in] | wdt | WDT index. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 98 of file qm_wdt.c.
Referenced by qm_wdt_set_config(), and qm_wdt_start().
| int qm_wdt_restore_context | ( | const qm_wdt_t | wdt, |
| const qm_wdt_context_t *const | ctx | ||
| ) |
Restore watchdog context.
Restore the configuration of the watchdog after exiting sleep.
| [in] | wdt | WDT index. |
| [in] | ctx | WDT context structure. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
| int qm_wdt_save_context | ( | const qm_wdt_t | wdt, |
| qm_wdt_context_t *const | ctx | ||
| ) |
Save watchdog context.
Save the configuration of the watchdog before entering sleep.
| [in] | wdt | WDT index. |
| [out] | ctx | WDT context structure. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
| int qm_wdt_set_config | ( | const qm_wdt_t | wdt, |
| const qm_wdt_config_t *const | cfg | ||
| ) |
Set configuration of WDT module.
This includes the timeout period in PCLK cycles, the WDT mode of operation. It also registers an ISR to the user defined callback.
| [in] | wdt | WDT index. |
| [in] | cfg | New configuration for WDT. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 60 of file qm_wdt.c.
References qm_wdt_config_t::callback, qm_wdt_config_t::callback_data, qm_wdt_config_t::mode, qm_wdt_config_t::pause_en, QM_WDT_MODE_INTERRUPT_RESET, qm_wdt_reload(), and qm_wdt_config_t::timeout.
| int qm_wdt_start | ( | const qm_wdt_t | wdt | ) |
Start WDT.
Once started, WDT can only be stopped by a SoC reset.
| [in] | wdt | WDT index. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 44 of file qm_wdt.c.
References CLK_PERIPH_CLK, clk_periph_enable(), CLK_PERIPH_WDT_REGISTER, and qm_wdt_reload().