feat(battery): 添加电池管理模块和IP5305 PMIC支持

- 添加电池状态监测模块,包括ADC采样和SOC估算功能
- 集成IP5305电源管理芯片支持,配置I2C通信和保活机制
- 实现电池状态事件系统,包含充电状态、满电状态和电量百分比
- 添加电池使能GPIO控制和采样工作队列
- 配置设备树支持电池检测和PMIC控制
- 添加外部模块路径到CMakeLists.txt并更新.gitignore
This commit is contained in:
2026-03-11 18:30:24 +08:00
parent 86af0d2373
commit b3516b988a
7 changed files with 423 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#ifndef BATTERY_STATUS_EVENT_H
#define BATTERY_STATUS_EVENT_H
#include <stdbool.h>
#include <stdint.h>
#include <app_event_manager.h>
#include <app_event_manager_profiler_tracer.h>
struct battery_status_event
{
struct app_event_header header;
bool charging;
bool full;
uint8_t soc;
};
APP_EVENT_TYPE_DECLARE(battery_status_event);
#endif