From adbd2969e6e6fd584d46ef60a3fa40bf878d7e00 Mon Sep 17 00:00:00 2001 From: Cástor Muñoz Date: Fri, 12 Aug 2016 02:37:45 +0200 Subject: iPod Classic: ADC updates Add code to read USB D+/D- and accessory ADCs, it is shown in HW debug menu, might be useful in future for RB and/or the bootloader to identify external USB chargers. Change-Id: Ia48ca5e06bb7ddc52bb55abedde6734653ce8dba --- firmware/target/arm/s5l8702/ipod6g/pmu-target.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'firmware/target/arm/s5l8702/ipod6g/pmu-target.h') diff --git a/firmware/target/arm/s5l8702/ipod6g/pmu-target.h b/firmware/target/arm/s5l8702/ipod6g/pmu-target.h index 5552e2196a..d33db42717 100644 --- a/firmware/target/arm/s5l8702/ipod6g/pmu-target.h +++ b/firmware/target/arm/s5l8702/ipod6g/pmu-target.h @@ -22,6 +22,7 @@ #ifndef __PMU_TARGET_H__ #define __PMU_TARGET_H__ +#include #include #include "config.h" @@ -72,14 +73,22 @@ enum pcf50635_reg_gpiostat { * GPIO3: output, unknown */ +struct pmu_adc_channel +{ + const char *name; + uint8_t adcc1; + uint8_t adcc2; + uint8_t adcc3; + uint8_t bias_dly; /* RB ticks */ +}; unsigned char pmu_read(int address); int pmu_write(int address, unsigned char val); int pmu_read_multiple(int address, int count, unsigned char* buffer); int pmu_write_multiple(int address, int count, unsigned char* buffer); -int pmu_read_adc(unsigned int adc); -int pmu_read_battery_voltage(void); -int pmu_read_battery_current(void); +unsigned short pmu_read_adc(const struct pmu_adc_channel *ch); +unsigned short pmu_adc_raw2mv( + const struct pmu_adc_channel *ch, unsigned short raw); void pmu_init(void); void pmu_ldo_on_in_standby(unsigned int ldo, int onoff); void pmu_ldo_set_voltage(unsigned int ldo, unsigned char voltage); -- cgit v1.2.3