libxr
Embedded C++ framework for bare-metal, RTOS and Linux
Loading...
Searching...
No Matches
power.hpp
1#pragma once
2
3#include "gpio.hpp"
4#include "libxr.hpp"
5#include "ramfs.hpp"
6
7namespace LibXR
8{
9
21{
22 public:
26 PowerManager() = default;
27
31 virtual ~PowerManager() = default;
32
40 virtual void Reset() = 0;
41
49 virtual void Shutdown() = 0;
50
58 virtual void JumpToBootloader() { Reset(); }
59
73 void RegisterCommand(RamFS& ramfs);
74
91 void CheckBootloaderPin(GPIO& pin, bool level);
92};
93
94} // namespace LibXR
通用输入输出(GPIO)接口类。 General Purpose Input/Output (GPIO) interface class.
Definition gpio.hpp:14
电源管理器基类 / Abstract base class for Power Manager
Definition power.hpp:21
virtual void Reset()=0
复位电源管理模块 / Resets the power management module
virtual void Shutdown()=0
关闭系统电源 / Shuts down the system power
void RegisterCommand(RamFS &ramfs)
在 RamFS 根目录注册 power 命令 / Registers the power command in the RamFS root
Definition power.cpp:39
virtual ~PowerManager()=default
默认析构函数 / Default destructor
PowerManager()=default
默认构造函数 / Default constructor
void CheckBootloaderPin(GPIO &pin, bool level)
启动时按引脚电平进入启动加载器 / Pin-level bootloader entry at startup
Definition power.cpp:45
virtual void JumpToBootloader()
跳转到启动加载器 / Jumps to the bootloader
Definition power.hpp:58
轻量级内存文件系统 / Lightweight in-memory file system
Definition ramfs.hpp:23
LibXR 命名空间 / LibXR namespace.
Definition ch32_can.hpp:14