summaryrefslogtreecommitdiff
path: root/firmware/export/adc.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/adc.h')
-rw-r--r--firmware/export/adc.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/firmware/export/adc.h b/firmware/export/adc.h
index d8e3b7078f..e10cce0d27 100644
--- a/firmware/export/adc.h
+++ b/firmware/export/adc.h
@@ -20,52 +20,8 @@
20#define _ADC_H_ 20#define _ADC_H_
21 21
22#include "config.h" 22#include "config.h"
23
24#ifdef TARGET_TREE
25#include "adc-target.h" 23#include "adc-target.h"
26 24
27#else
28
29#define NUM_ADC_CHANNELS 8
30
31#ifdef HAVE_ONDIO_ADC
32
33#define ADC_MMC_SWITCH 0 /* low values if MMC inserted */
34#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
35#define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */
36#define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */
37#define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different
38 voltages for different keys */
39#define ADC_USB_ACTIVE 5 /* USB bridge activity */
40#define ADC_UNREG_POWER 7 /* Battery voltage */
41
42#else
43/* normal JBR channel assignment */
44#define ADC_BATTERY 0 /* Battery voltage always reads 0x3FF due to
45 silly scaling */
46#ifdef HAVE_FMADC
47#define ADC_CHARGE_REGULATOR 0 /* Uh, we read the battery voltage? */
48#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
49#define ADC_BUTTON_OFF 2 /* the off button, high value if pressed */
50#define ADC_BUTTON_ON 3 /* the on button, low value if pressed */
51#else
52#define ADC_CHARGE_REGULATOR 1 /* Regulator reference voltage, should read
53 about 0x1c0 when charging, else 0x3FF */
54#define ADC_USB_POWER 2 /* USB, reads 0x3FF when USB is inserted */
55#endif
56
57#define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different
58 voltages for different keys */
59#define ADC_BUTTON_ROW2 5 /* Used for scanning the keys, different
60 voltages for different keys */
61#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
62#define ADC_EXT_POWER 7 /* The external power voltage, 0v or 2.7v */
63
64#endif
65
66#define EXT_SCALE_FACTOR 14800
67#endif
68
69unsigned short adc_read(int channel); 25unsigned short adc_read(int channel);
70void adc_init(void); 26void adc_init(void);
71 27