feat(power): add battery monitoring and status overlays
This commit is contained in:
+86
-4
@@ -718,12 +718,12 @@ menu "Example Configuration"
|
||||
|
||||
config TQ_POWER_HOLD_GPIO
|
||||
int "Power hold GPIO (-1 to disable)"
|
||||
default 9
|
||||
default -1
|
||||
range -1 48
|
||||
help
|
||||
GPIO used to keep board power enabled after boot. The
|
||||
2026-07-24 board maps the Power net to IO9. Set to -1 only
|
||||
when no external power-hold circuit is connected.
|
||||
GPIO used to keep board power enabled after boot. The current
|
||||
battery-sensing board uses IO9 as an ADC input and therefore
|
||||
disables the legacy power-hold output by default.
|
||||
|
||||
config TQ_POWER_HOLD_ACTIVE_LEVEL
|
||||
int "Power hold active level"
|
||||
@@ -732,6 +732,88 @@ menu "Example Configuration"
|
||||
help
|
||||
Logic level that keeps the external power-hold circuit active.
|
||||
|
||||
config TQ_BATTERY_ENABLE
|
||||
bool "Enable battery monitoring"
|
||||
default y
|
||||
|
||||
config TQ_BATTERY_ADC_GPIO
|
||||
int "Battery voltage ADC GPIO"
|
||||
default 9
|
||||
range 0 48
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CHARGE_GPIO
|
||||
int "TP4057 charge status GPIO (-1 to disable)"
|
||||
default 10
|
||||
range -1 48
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CHARGE_ACTIVE_LEVEL
|
||||
int "TP4057 charging active level"
|
||||
default 0
|
||||
range 0 1
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_DIVIDER_HIGH_OHM
|
||||
int "Battery divider resistance from VBAT to ADC (ohm)"
|
||||
default 100000
|
||||
range 1 10000000
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_DIVIDER_LOW_OHM
|
||||
int "Battery divider resistance from ADC to ground (ohm)"
|
||||
default 100000
|
||||
range 1 10000000
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CALIBRATION_GAIN_PPM
|
||||
int "Board battery voltage calibration gain (ppm)"
|
||||
default 1000000
|
||||
range 800000 1200000
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CALIBRATION_OFFSET_MV
|
||||
int "Board battery voltage calibration offset (mV)"
|
||||
default 0
|
||||
range -500 500
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_SAMPLE_INTERVAL_SEC
|
||||
int "Battery monitoring interval (seconds)"
|
||||
default 10
|
||||
range 1 3600
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_LOAD_COOLDOWN_SEC
|
||||
int "Battery sampling cooldown after high load (seconds)"
|
||||
default 5
|
||||
range 0 60
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_LOW_ENTER_PERCENT
|
||||
int "Low battery entry threshold (percent)"
|
||||
default 20
|
||||
range 1 99
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_LOW_EXIT_PERCENT
|
||||
int "Low battery recovery threshold (percent)"
|
||||
default 25
|
||||
range 1 100
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CRITICAL_ENTER_PERCENT
|
||||
int "Critical battery entry threshold (percent)"
|
||||
default 5
|
||||
range 0 99
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
config TQ_BATTERY_CRITICAL_EXIT_PERCENT
|
||||
int "Critical battery recovery threshold (percent)"
|
||||
default 10
|
||||
range 1 100
|
||||
depends on TQ_BATTERY_ENABLE
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Wi-Fi Provisioning"
|
||||
|
||||
Reference in New Issue
Block a user