07-27-2022, 11:17 AM
Using a python script to create a poc.
I could not find a setting to disable charging. Since pp draws more than 0.1A it's sufficient to set the current limit to 0.1A.
I could not find a setting to disable charging. Since pp draws more than 0.1A it's sufficient to set the current limit to 0.1A.
Code:
'battery_current': {
'filename': '/sys/class/power_supply/axp20x-battery/hwmon4/curr1_input', # noqa E501
'description': 'battery current in mA'},
# 'battery_voltage': {
# 'filename': '/sys/class/power_supply/axp20x-battery/hwmon4/in0_input',
# 'description': 'battery voltage in mV'},
'usb_current_limit': {
'filename': '/sys/class/power_supply/axp20x-usb/input_current_limit',
'description': 'usb current limit in µA'},
'usb_charger_current_limit': {
'filename': '/sys/class/power_supply/axp20x-usb/usb_dcp_input_current_limit', # noqa E501
'description': 'usb charger current limit in µA'},
'battery_capacity': {
'filename': '/sys/class/power_supply/axp20x-battery/capacity',
'description': 'battery capacity in %'},
'usb_charger_online': {
'filename': '/sys/class/power_supply/axp20x-usb/online',
'description': 'charger is online'},