Skip to content

Commit 81da257

Browse files
authored
Update cool642tb-mini_R.overlay
1 parent 7cf3ea9 commit 81da257

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

config/boards/shields/Test/cool642tb-mini_R.overlay

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,22 @@
6464

6565

6666
/ {
67-
chosen {
68-
zephyr,battery = &battery;
67+
battery: battery {
68+
compatible = "voltage-divider";
69+
io-channels = <&adc 0>; // A0 ピンが BAT 電圧につながってる
70+
output-ohms = <100000>; // 分圧抵抗値(実際の値に合わせて調整)
71+
full-ohms = <200000>;
72+
power-gpios = <>;
73+
zephyr,voltage-min-mv = <2000>; // 0% (NiMH 1.0V ×2)
74+
zephyr,voltage-max-mv = <2700>; // 100% (NiMH 満充電直後)
6975
};
7076
};
7177

72-
&battery {
73-
/* エネループ 2本用設定 */
74-
zephyr,voltage-min-mv = <2000>; // 0%とみなす電圧 (1.0V x2)
75-
zephyr,voltage-max-mv = <2700>; // 100%とみなす電圧 (満充電直後)
78+
&adc {
79+
status = "okay";
80+
};
81+
82+
&adc_ch0 {
83+
status = "okay";
7684
};
7785

0 commit comments

Comments
 (0)