Expose input current setting
This commit is contained in:
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
struct battery_info battery_info = { 0 };
|
struct battery_info battery_info = { 0 };
|
||||||
|
|
||||||
|
uint16_t battery_charger_input_current = CHARGER_INPUT_CURRENT;
|
||||||
|
|
||||||
// Default values to disable battery charging thresholds
|
// Default values to disable battery charging thresholds
|
||||||
#define BATTERY_START_DEFAULT 0
|
#define BATTERY_START_DEFAULT 0
|
||||||
#define BATTERY_END_DEFAULT 100
|
#define BATTERY_END_DEFAULT 100
|
||||||
|
@ -145,7 +145,7 @@ int16_t battery_charger_enable(void) {
|
|||||||
return res;
|
return res;
|
||||||
|
|
||||||
// Set input current in mA
|
// Set input current in mA
|
||||||
res = smbus_write(CHARGER_ADDRESS, REG_INPUT_CURRENT, INPUT_CURRENT(CHARGER_INPUT_CURRENT));
|
res = smbus_write(CHARGER_ADDRESS, REG_INPUT_CURRENT, INPUT_CURRENT(battery_charger_input_current));
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ int16_t battery_charger_enable(void) {
|
|||||||
return res;
|
return res;
|
||||||
|
|
||||||
// Set input current in mA
|
// Set input current in mA
|
||||||
res = smbus_write(CHARGER_ADDRESS, REG_ADAPTER_CURRENT, INPUT_CURRENT(CHARGER_INPUT_CURRENT));
|
res = smbus_write(CHARGER_ADDRESS, REG_ADAPTER_CURRENT, INPUT_CURRENT(battery_charger_input_current));
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ struct battery_info {
|
|||||||
};
|
};
|
||||||
extern struct battery_info battery_info;
|
extern struct battery_info battery_info;
|
||||||
|
|
||||||
|
extern uint16_t battery_charger_input_current;
|
||||||
|
|
||||||
uint8_t battery_get_start_threshold(void);
|
uint8_t battery_get_start_threshold(void);
|
||||||
bool battery_set_start_threshold(uint8_t value);
|
bool battery_set_start_threshold(uint8_t value);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user