From 8272baa0fd3c189f5037e5eb7a4a3078be99c29b Mon Sep 17 00:00:00 2001 From: Stefan Haun <tux@netz39.de> Date: Thu, 22 Aug 2019 09:27:25 +0200 Subject: [PATCH] Add epicardium API calls 0x31 - battery_current 0x32 - chargein_voltage 0x33 - chargein_current 0x34 - system_voltage 0x35 - thermistor_voltage --- epicardium/epicardium.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 2e7944b6..ebf66a9f 100644 --- a/epicardium/epicardium.h +++ b/epicardium/epicardium.h @@ -54,6 +54,13 @@ typedef _Bool bool; #define API_DISP_PIXEL 0x28 #define API_DISP_FRAMEBUFFER 0x29 +/* API_BATTERY_VOLTAGE 0x30 */ +#define API_BATTERY_CURRENT 0x31 +#define API_CHARGEIN_VOLTAGE 0x32 +#define API_CHARGEIN_CURRENT 0x33 +#define API_SYSTEM_VOLTAGE 0x34 +#define API_THERMISTOR_VOLTAGE 0x35 + #define API_FILE_OPEN 0x40 #define API_FILE_CLOSE 0x41 #define API_FILE_READ 0x42 @@ -227,15 +234,42 @@ API(API_SYSTEM_EXEC, int __epic_exec(char *name)); API(API_SYSTEM_RESET, void epic_system_reset(void)); /** - * Battery Voltage + * PMIC API * =============== */ + /** * Read the current battery voltage. */ API(API_BATTERY_VOLTAGE, int epic_read_battery_voltage(float *result)); +/** + * Read the current battery current. + */ +API(API_BATTERY_CURRENT, int epic_read_battery_current(float *result)); + +/** + * Read the current charge voltage. + */ +API(API_CHARGEIN_VOLTAGE, int epic_read_chargein_voltage(float *result)); + +/** + * Read the current charge current. + */ +API(API_CHARGEIN_CURRENT, int epic_read_chargein_current(float *result)); + +/** + * Read the current system voltage. + */ +API(API_SYSTEM_VOLTAGE, int epic_read_system_voltage(float *result)); + +/** + * Read the current thermistor voltage. + */ +API(API_THERMISTOR_VOLTAGE, int epic_read_thermistor_voltage(float *result)); + + /** * UART/Serial Interface * ===================== -- GitLab