libxr
1.0
Want to be the best embedded framework
|
STM32 IWDG 独立看门狗 / Independent Watchdog. More...
#include <stm32_watchdog.hpp>
Public Member Functions | |
STM32Watchdog (IWDG_HandleTypeDef *hiwdg, uint32_t timeout_ms=1000, uint32_t feed_ms=250, uint32_t clock=LSI_VALUE) | |
ErrorCode | SetConfig (const Configuration &config) override |
初始化硬件并设置超时时间 Initialize hardware and set overflow time | |
ErrorCode | Feed () override |
立即手动喂狗 Feed the watchdog immediately | |
ErrorCode | Start () override |
启动看门狗 / Start the watchdog | |
ErrorCode | Stop () override |
停止看门狗 / Stop the watchdog | |
![]() | |
Watchdog () | |
构造函数 Constructor | |
virtual | ~Watchdog () |
虚析构函数 Virtual destructor | |
Data Fields | |
IWDG_HandleTypeDef * | hiwdg_ |
STM32 HAL IWDG handle. | |
uint32_t | clock_ |
LSI clock in Hz. | |
![]() | |
uint32_t | timeout_ms_ = 3000 |
溢出时间 | |
uint32_t | feed_ms_ = 1000 |
自动喂狗间隔 | |
bool | auto_feed_ = false |
是否自动喂狗 | |
Additional Inherited Members | |
![]() | |
static void | ThreadFun (Watchdog *wdg) |
Watchdog 自动喂狗线程函数 Watchdog thread function for auto-feeding. | |
static void | TaskFun (Watchdog *wdg) |
Watchdog 自动喂狗定时器任务函数 Watchdog timer task function for auto-feeding. | |
STM32 IWDG 独立看门狗 / Independent Watchdog.
Definition at line 16 of file stm32_watchdog.hpp.
|
inlineexplicit |
Definition at line 19 of file stm32_watchdog.hpp.
|
inlineoverridevirtual |
立即手动喂狗 Feed the watchdog immediately
Implements LibXR::Watchdog.
Definition at line 86 of file stm32_watchdog.hpp.
|
inlineoverridevirtual |
初始化硬件并设置超时时间 Initialize hardware and set overflow time
config | 配置参数 Configuration |
Implements LibXR::Watchdog.
Definition at line 27 of file stm32_watchdog.hpp.
|
inlineoverridevirtual |
启动看门狗 / Start the watchdog
Implements LibXR::Watchdog.
Definition at line 91 of file stm32_watchdog.hpp.
|
inlineoverridevirtual |
停止看门狗 / Stop the watchdog
Implements LibXR::Watchdog.
Definition at line 101 of file stm32_watchdog.hpp.
uint32_t LibXR::STM32Watchdog::clock_ |
LSI clock in Hz.
Definition at line 109 of file stm32_watchdog.hpp.
IWDG_HandleTypeDef* LibXR::STM32Watchdog::hiwdg_ |
STM32 HAL IWDG handle.
Definition at line 108 of file stm32_watchdog.hpp.