|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
HPM 电源管理实现 / HPM power manager implementation. More...
#include <hpm_power.hpp>
Public Member Functions | |
| void | Reset () override |
| PPOR 软件复位整机 / Resets the whole device through the PPOR. | |
| void | Shutdown () override |
| 进入 power down 模式 / Enters the power down mode | |
| void | JumpToBootloader () override |
| 进入 ROM ISP / Enters the ROM ISP | |
Public Member Functions inherited from LibXR::PowerManager | |
| PowerManager ()=default | |
| 默认构造函数 / Default constructor | |
| virtual | ~PowerManager ()=default |
| 默认析构函数 / Default destructor | |
| void | RegisterCommand (RamFS &ramfs) |
| 在 RamFS 根目录注册 power 命令 / Registers the power command in the RamFS root | |
| void | CheckBootloaderPin (GPIO &pin, bool level) |
| 启动时按引脚电平进入启动加载器 / Pin-level bootloader entry at startup | |
HPM 电源管理实现 / HPM power manager implementation.
Definition at line 12 of file hpm_power.hpp.
|
explicit |
Definition at line 11 of file hpm_power.cpp.
|
overridevirtual |
进入 ROM ISP / Enters the ROM ISP
关中断后调用 ROM API 进入 ISP,外设由 ROM 自动探测;正常不返回,返回时复位整机。 Disables the interrupts and calls the ROM API to enter the ISP, with the peripheral auto-detected by the ROM; the call does not return normally, and a return resets the device.
Reimplemented from LibXR::PowerManager.
Definition at line 63 of file hpm_power.cpp.
|
overridevirtual |
PPOR 软件复位整机 / Resets the whole device through the PPOR.
做法与 SDK 的 DFU 触发例程一致:使能软件复位源后按 24 个计数(约 1 微秒)触发复位。 The same sequence as the DFU trigger sample of the SDK: enable the software reset source, then issue the reset after 24 counters (about one microsecond).
Implements LibXR::PowerManager.
Definition at line 20 of file hpm_power.cpp.
|
overridevirtual |
进入 power down 模式 / Enters the power down mode
有 PDGO 的 SoC(HPM5300 系列等)按 SDK 电源模式例程的做法设置关断计数后等待断电, 由 RESETN 或 WAKEUP 引脚唤醒;没有 PDGO 的 SoC 退化为关中断后执行 WFI 等待。 SoCs with a PDGO (the HPM5300 series among others) set the turn-off counter as the power mode sample of the SDK does and wait for the power down, woken up by the RESETN or WAKEUP pin; SoCs without a PDGO fall back to disabling interrupts and executing WFI.
Implements LibXR::PowerManager.
Definition at line 39 of file hpm_power.cpp.