feat(battery): 添加电池管理模块和IP5305 PMIC支持
- 添加电池状态监测模块,包括ADC采样和SOC估算功能 - 集成IP5305电源管理芯片支持,配置I2C通信和保活机制 - 实现电池状态事件系统,包含充电状态、满电状态和电量百分比 - 添加电池使能GPIO控制和采样工作队列 - 配置设备树支持电池检测和PMIC控制 - 添加外部模块路径到CMakeLists.txt并更新.gitignore
This commit is contained in:
20
src/events/battery_status_event.h
Normal file
20
src/events/battery_status_event.h
Normal 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
|
||||
Reference in New Issue
Block a user