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/adc-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/adc-target.h')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/adc-target.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/adc-target.h b/firmware/target/arm/s5l8702/ipod6g/adc-target.h index d4dce3d31f..bedc0a8447 100644 --- a/firmware/target/arm/s5l8702/ipod6g/adc-target.h +++ b/firmware/target/arm/s5l8702/ipod6g/adc-target.h | |||
@@ -21,13 +21,23 @@ | |||
21 | #ifndef _ADC_TARGET_H_ | 21 | #ifndef _ADC_TARGET_H_ |
22 | #define _ADC_TARGET_H_ | 22 | #define _ADC_TARGET_H_ |
23 | 23 | ||
24 | #define NUM_ADC_CHANNELS 4 | 24 | #include <stdbool.h> |
25 | #include "config.h" | ||
25 | 26 | ||
26 | #define ADC_UNKNOWN_0 0 | 27 | enum |
27 | #define ADC_UNKNOWN_1 1 | 28 | { |
28 | #define ADC_BATTERY 2 | 29 | ADC_BATTERY = 0, |
29 | #define ADC_UNKNOWN_3 3 | 30 | ADC_USBDATA, |
31 | ADC_ACCESSORY, | ||
32 | NUM_ADC_CHANNELS | ||
33 | }; | ||
30 | 34 | ||
31 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | 35 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ |
32 | 36 | ||
37 | unsigned short adc_read_millivolts(int channel); | ||
38 | unsigned int adc_read_battery_voltage(void); | ||
39 | unsigned int adc_read_usbdata_voltage(bool dp); | ||
40 | int adc_read_accessory_resistor(void); | ||
41 | const char *adc_name(int channel); | ||
42 | |||
33 | #endif | 43 | #endif |