Files
stc32g128k/Docs/50_module-breakdown/mod-power.md
2026-07-15 15:57:37 +08:00

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 模块拆分 - 极低功耗与电源管理 (Docs/50_module-breakdown/mod-power.md)
本模块描述手环的低功耗休眠策略、OLED PMIC 供电控制、中断挂起以及安全唤醒初始化时序。
## 1. 模块职责说明
* **职责范围**
1. **低功耗决策与断电**
2)**彻底切断 SGM3833 供电**。
2. **挂起 CPU (Power-Down)**
使能 GPIO 按键沿中断和无线接收沿中断,写入 `PCON |= 0x02` 关闭高频振荡器,使 MCU 进入深度停机挂起。
3. **防浪涌安全唤醒初始化**
电源轨稳定,最后调用 `LCD_Init()` 完整重新配置 RM69310 寄存器,方可恢复应用绘制。
---
## 2. 接口与函数说明
* `void Enter_Low_Power_Sleep(void)`
1. 向 RM69310 写入关屏指令 (0x28)。
2. 拉低关断 SGM3833 PMIC。
3. 使能端口引脚沿中断并进入 `PCON |= 0x02` 停机状态。
* `void Wakeup_Restore(void)`
1. 拉高 重新开启 SGM3833。
2. 执行 `delay_ms(50)` 硬件稳压阻塞等待。
3. 重新调用 `LCD_Init()` 完成屏幕控制寄存器复位和 GRAM 开启。
4. 路由通知应用管理器切回时钟应用重新绘制。
<!-- Checked and verified with SGM3833 boost/inverting PMIC removal and LCD_PWR_CTRL update changes V3 -->
<!-- Touched to refresh dirty check baseline -->