- 添加IP5306 PMIC驱动实现,包括I2C通信和GPIO唤醒功能 - 实现电源管理芯片的状态读取接口(充电状态、满电状态) - 集成Wakeup保持脉冲功能,支持可配置的脉冲宽度和间隔时间 - 添加设备树绑定文件和Kconfig配置选项 refactor(blinky): 集成IP5306电源管理芯片到电池模块 - 在电池模块中集成IP5306 PMIC状态监控功能 - 修改日志输出格式,显示电池电压及充电/满电状态 - 增加设备初始化检查和错误处理机制 - 配置电源管理限制级别为暂停模式 build: 配置CMakeLists.txt以包含驱动子目录 - 更新主CMakeLists.txt文件添加drivers子目录 - 配置驱动程序的构建层次结构(pmic -> ip5306) - 设置条件编译目标源文件 docs: 添加设备树和板级配置支持 - 添加mini_keyboard板的I2C引脚控制配置 - 配置IP5306设备节点和相关GPIO引脚定义 - 启用I2C配置选项以支持PMIC通信
113 lines
2.0 KiB
Plaintext
113 lines
2.0 KiB
Plaintext
/dts-v1/;
|
|
#include <nordic/nrf52840_qiaa.dtsi>
|
|
#include "mini_keyboard-pinctrl.dtsi"
|
|
#include <zephyr/dt-bindings/adc/adc.h>
|
|
|
|
/ {
|
|
model = "Mini keyboard";
|
|
compatible = "atguigu,mini-keyboard";
|
|
|
|
chosen {
|
|
zephyr,sram = &sram0;
|
|
zephyr,flash = &flash0;
|
|
zephyr,code-partition = &slot0_partition;
|
|
};
|
|
|
|
aliases {
|
|
led0 = &myled0;
|
|
};
|
|
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
myled0: led_0 {
|
|
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
|
|
vbatt: vbatt {
|
|
compatible = "voltage-divider";
|
|
io-channels = <&adc 7>;
|
|
output-ohms = <100000>;
|
|
full-ohms = <200000>;
|
|
power-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
|
power-on-sample-delay-us = <200>;
|
|
};
|
|
};
|
|
|
|
&flash0 {
|
|
partitions {
|
|
compatible = "fixed-partitions";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
boot_partition: partition@0 {
|
|
label = "mcuboot";
|
|
reg = <0x00000000 DT_SIZE_K(48)>;
|
|
};
|
|
|
|
slot0_partition: partition@c000 {
|
|
label = "image-0";
|
|
reg = <0x0000c000 DT_SIZE_K(472)>;
|
|
};
|
|
|
|
slot1_partition: partition@82000 {
|
|
label = "image-1";
|
|
reg = <0x00082000 DT_SIZE_K(472)>;
|
|
};
|
|
|
|
storage_partition: partition@f8000 {
|
|
label = "storage";
|
|
reg = <0x000f8000 DT_SIZE_K(32)>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&uicr {
|
|
nfct-pins-as-gpios;
|
|
};
|
|
|
|
&adc {
|
|
status = "okay";
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
channel@7 {
|
|
reg = <7>;
|
|
zephyr,gain = "ADC_GAIN_1_4";
|
|
zephyr,reference = "ADC_REF_INTERNAL";
|
|
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40)>;
|
|
zephyr,input-positive = <NRF_SAADC_AIN7>;
|
|
zephyr,resolution = <14>;
|
|
zephyr,oversampling = <4>;
|
|
};
|
|
};
|
|
|
|
&i2c0 {
|
|
status = "okay";
|
|
pinctrl-0 = <&i2c0_default>;
|
|
pinctrl-1 = <&i2c0_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
clock-frequency = <400000>;
|
|
|
|
ip5306: pmic@75 {
|
|
compatible = "injoinic,ip5306";
|
|
reg = <0x75>;
|
|
wakeup-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
|
|
keepalive-interval-ms = <8000>;
|
|
keepalive-pulse-width-ms = <500>;
|
|
status = "okay";
|
|
};
|
|
};
|
|
|
|
&gpio0 {
|
|
status = "okay";
|
|
};
|
|
|
|
&gpio1 {
|
|
status = "okay";
|
|
};
|
|
|
|
&gpiote {
|
|
status = "okay";
|
|
};
|