fix(battery): detect TP4056 charging and full states on new board

This commit is contained in:
chenjintao
2026-10-23 16:23:39 +08:00
parent 415c75b0e6
commit 6116a67d5f
13 changed files with 617 additions and 249 deletions
+6 -5
View File
@@ -51,14 +51,15 @@ not been enabled as a replacement.
| `CONFIG_TQ_POWER_HOLD_GPIO` | -1 | No MCU power-hold net on the new board |
| `CONFIG_TQ_RESET_BUTTON_ENABLE` | Disabled | The old optional reset default GPIO14 now belongs to stepper IN1; configure separate physical wiring before enabling |
| `CONFIG_TQ_BATTERY_SHUTDOWN_WAKE_BUTTON_GPIO` | -1 | No additional deep-sleep wake button |
| GPIO8 / 充满检测 | Not consumed | Full-charge input exists on hardware; no option/driver added |
| GPIO8 / 充满检测 | Input | `CONFIG_TQ_BATTERY_FULL_GPIO=8`, low-active TP4056 STDBY# via Q8 |
| GPIO10 / 马达控制 | Not consumed | Rocker-motor gate held off by external R30 pull-down; no new option/driver added |
| GPIO3 / 35 / 36 / 37 / 45 / 46 | NC on schematic | Do not infer arbitrary availability from NC |
Mechanical switches use pull-up only. PTT and charger active levels are retained
from the previous configuration and require actual idle/active measurements.
Battery full-charge prompts still use voltage/percentage/time inference rather
than GPIO8. ADC divider gain/offset remain unchanged pending VBAT measurements.
Battery charge/full state uses GPIO18/GPIO8 with 100ms polling and 1s sampled
stability confirmation. Both active means fault; both inactive means not charging.
Full prompts require a confirmed charging-to-full transition; no voltage inference. ADC divider gain/offset remain unchanged pending VBAT measurements.
## Boot Calibration And Sleep
@@ -66,8 +67,8 @@ than GPIO8. ADC divider gain/offset remain unchanged pending VBAT measurements.
switch 1 on GPIO11 with IN1/IN2/IN3/IN4 = 14/21/47/48. Verify motor direction,
mechanical limits and bounded stop on hardware.
Charge-state edge interrupts and low-active deep-sleep wake both follow
`CONFIG_TQ_BATTERY_CHARGE_GPIO=18`. Verify charger insertion/removal and wake
Charge inputs are polled without GPIO interrupts. Low-active deep-sleep wake follows
`CONFIG_TQ_BATTERY_CHARGE_GPIO=18`; the full input is not a wake source. Verify charger insertion/removal and wake
behavior after changing the board.
## System Interfaces