libxr
1.0
Want to be the best embedded framework
|
通用看门狗(Watchdog)抽象接口 General Watchdog interface for both thread and task style usage More...
#include <watchdog.hpp>
Data Structures | |
struct | Configuration |
看门狗配置结构体 Configuration for the watchdog More... | |
Public Member Functions | |
Watchdog () | |
构造函数 Constructor | |
virtual | ~Watchdog () |
虚析构函数 Virtual destructor | |
virtual ErrorCode | SetConfig (const Configuration &config)=0 |
初始化硬件并设置超时时间 Initialize hardware and set overflow time | |
virtual ErrorCode | Feed ()=0 |
立即手动喂狗 Feed the watchdog immediately | |
virtual ErrorCode | Start ()=0 |
启动看门狗 / Start the watchdog | |
virtual ErrorCode | Stop ()=0 |
停止看门狗 / Stop the watchdog | |
Static Public Member Functions | |
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. | |
Data Fields | |
uint32_t | timeout_ms_ = 3000 |
溢出时间 | |
uint32_t | feed_ms_ = 1000 |
自动喂狗间隔 | |
bool | auto_feed_ = false |
是否自动喂狗 | |
通用看门狗(Watchdog)抽象接口 General Watchdog interface for both thread and task style usage
Definition at line 13 of file watchdog.hpp.
|
inline |
|
inlinevirtual |
|
pure virtual |
立即手动喂狗 Feed the watchdog immediately
Implemented in LibXR::STM32Watchdog.
|
pure virtual |
初始化硬件并设置超时时间 Initialize hardware and set overflow time
config | 配置参数 Configuration |
Implemented in LibXR::STM32Watchdog.
|
pure virtual |
启动看门狗 / Start the watchdog
Implemented in LibXR::STM32Watchdog.
|
pure virtual |
停止看门狗 / Stop the watchdog
Implemented in LibXR::STM32Watchdog.
|
inlinestatic |
Watchdog 自动喂狗定时器任务函数 Watchdog timer task function for auto-feeding.
适合轮询/定时任务调度环境。可直接作为Timer/Task回调,每次被调度时喂狗一次。 Suitable for cooperative/periodic polling system. Called by timer, feeds the watchdog once per call.
Definition at line 101 of file watchdog.hpp.
|
inlinestatic |
Watchdog 自动喂狗线程函数 Watchdog thread function for auto-feeding.
适合 RTOS/多线程环境。可直接传递给线程创建API作为入口,循环调用 Feed(),每隔 feed_ms 毫秒自动喂狗。 Suitable for RTOS or multi-threading. Call by thread system, periodically feeds the watchdog.
Definition at line 78 of file watchdog.hpp.
bool LibXR::Watchdog::auto_feed_ = false |
是否自动喂狗
Definition at line 111 of file watchdog.hpp.
uint32_t LibXR::Watchdog::feed_ms_ = 1000 |
自动喂狗间隔
Definition at line 110 of file watchdog.hpp.
uint32_t LibXR::Watchdog::timeout_ms_ = 3000 |
溢出时间
Definition at line 109 of file watchdog.hpp.