diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2016-08-12 02:37:45 +0200 |
---|---|---|
committer | Cástor Muñoz <cmvidal@gmail.com> | 2016-08-12 14:17:46 +0200 |
commit | adbd2969e6e6fd584d46ef60a3fa40bf878d7e00 (patch) | |
tree | 628a89d0e63cd338bbd741702c9b36010f679437 /firmware/target/arm/s5l8702/ipod6g/pmu-target.h | |
parent | a25d0c58aa801087e80b479a7f536d519a422891 (diff) | |
download | rockbox-adbd2969e6e6fd584d46ef60a3fa40bf878d7e00.tar.gz rockbox-adbd2969e6e6fd584d46ef60a3fa40bf878d7e00.zip |
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
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/pmu-target.h')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/pmu-target.h | 15 |
1 files changed, 12 insertions, 3 deletions
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 @@ | |||
22 | #ifndef __PMU_TARGET_H__ | 22 | #ifndef __PMU_TARGET_H__ |
23 | #define __PMU_TARGET_H__ | 23 | #define __PMU_TARGET_H__ |
24 | 24 | ||
25 | #include <stdint.h> | ||
25 | #include <stdbool.h> | 26 | #include <stdbool.h> |
26 | #include "config.h" | 27 | #include "config.h" |
27 | 28 | ||
@@ -72,14 +73,22 @@ enum pcf50635_reg_gpiostat { | |||
72 | * GPIO3: output, unknown | 73 | * GPIO3: output, unknown |
73 | */ | 74 | */ |
74 | 75 | ||
76 | struct pmu_adc_channel | ||
77 | { | ||
78 | const char *name; | ||
79 | uint8_t adcc1; | ||
80 | uint8_t adcc2; | ||
81 | uint8_t adcc3; | ||
82 | uint8_t bias_dly; /* RB ticks */ | ||
83 | }; | ||
75 | 84 | ||
76 | unsigned char pmu_read(int address); | 85 | unsigned char pmu_read(int address); |
77 | int pmu_write(int address, unsigned char val); | 86 | int pmu_write(int address, unsigned char val); |
78 | int pmu_read_multiple(int address, int count, unsigned char* buffer); | 87 | int pmu_read_multiple(int address, int count, unsigned char* buffer); |
79 | int pmu_write_multiple(int address, int count, unsigned char* buffer); | 88 | int pmu_write_multiple(int address, int count, unsigned char* buffer); |
80 | int pmu_read_adc(unsigned int adc); | 89 | unsigned short pmu_read_adc(const struct pmu_adc_channel *ch); |
81 | int pmu_read_battery_voltage(void); | 90 | unsigned short pmu_adc_raw2mv( |
82 | int pmu_read_battery_current(void); | 91 | const struct pmu_adc_channel *ch, unsigned short raw); |
83 | void pmu_init(void); | 92 | void pmu_init(void); |
84 | void pmu_ldo_on_in_standby(unsigned int ldo, int onoff); | 93 | void pmu_ldo_on_in_standby(unsigned int ldo, int onoff); |
85 | void pmu_ldo_set_voltage(unsigned int ldo, unsigned char voltage); | 94 | void pmu_ldo_set_voltage(unsigned int ldo, unsigned char voltage); |