diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/adc.h | 17 | ||||
-rw-r--r-- | firmware/export/config-ondiofm.h | 4 | ||||
-rw-r--r-- | firmware/export/config-ondiosp.h | 3 |
3 files changed, 24 insertions, 0 deletions
diff --git a/firmware/export/adc.h b/firmware/export/adc.h index 1c94eec63e..cbc40e2662 100644 --- a/firmware/export/adc.h +++ b/firmware/export/adc.h | |||
@@ -21,6 +21,21 @@ | |||
21 | 21 | ||
22 | #define NUM_ADC_CHANNELS 8 | 22 | #define NUM_ADC_CHANNELS 8 |
23 | 23 | ||
24 | #ifdef HAVE_ONDIO_ADC | ||
25 | |||
26 | #define ADC_MMC_SWITCH 0 /* Battery voltage always reads 0x3FF due to | ||
27 | silly scaling */ | ||
28 | #define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */ | ||
29 | #define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */ | ||
30 | #define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */ | ||
31 | #define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different | ||
32 | voltages for different keys */ | ||
33 | #define ADC_UNREG_POWER 7 /* Battery voltage */ | ||
34 | /* FixMe: this doesn't exist, just to make the compiler happy */ | ||
35 | #define ADC_EXT_POWER 5 /* The external power voltage, V=X*0.0148 */ | ||
36 | |||
37 | #else | ||
38 | /* normal JBR channel assignment */ | ||
24 | #define ADC_BATTERY 0 /* Battery voltage always reads 0x3FF due to | 39 | #define ADC_BATTERY 0 /* Battery voltage always reads 0x3FF due to |
25 | silly scaling */ | 40 | silly scaling */ |
26 | #ifdef HAVE_FMADC | 41 | #ifdef HAVE_FMADC |
@@ -39,6 +54,8 @@ | |||
39 | #define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */ | 54 | #define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */ |
40 | #define ADC_EXT_POWER 7 /* The external power voltage, V=X*0.0148 */ | 55 | #define ADC_EXT_POWER 7 /* The external power voltage, V=X*0.0148 */ |
41 | 56 | ||
57 | #endif | ||
58 | |||
42 | #define EXT_SCALE_FACTOR 14800 | 59 | #define EXT_SCALE_FACTOR 14800 |
43 | 60 | ||
44 | unsigned short adc_read(int channel); | 61 | unsigned short adc_read(int channel); |
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 44742a62f9..62e7c86c4b 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h | |||
@@ -54,3 +54,7 @@ | |||
54 | 54 | ||
55 | /* Define this for different I2C pinout */ | 55 | /* Define this for different I2C pinout */ |
56 | #define HAVE_ONDIO_I2C | 56 | #define HAVE_ONDIO_I2C |
57 | |||
58 | /* Define this for different ADC channel assignment */ | ||
59 | #define HAVE_ONDIO_ADC | ||
60 | |||
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 8907d465ab..f8d04bf20c 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h | |||
@@ -54,3 +54,6 @@ | |||
54 | 54 | ||
55 | /* Define this for different I2C pinout */ | 55 | /* Define this for different I2C pinout */ |
56 | #define HAVE_ONDIO_I2C | 56 | #define HAVE_ONDIO_I2C |
57 | |||
58 | /* Define this for different ADC channel assignment */ | ||
59 | #define HAVE_ONDIO_ADC | ||