diff options
Diffstat (limited to 'firmware/target/arm/imx233/lradc-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/lradc-imx233.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/lradc-imx233.h b/firmware/target/arm/imx233/lradc-imx233.h index d1529f4266..f274db3520 100644 --- a/firmware/target/arm/imx233/lradc-imx233.h +++ b/firmware/target/arm/imx233/lradc-imx233.h | |||
@@ -55,10 +55,12 @@ | |||
55 | #define LRADC_SRC_NMOS_THICK LRADC_SRC(10) | 55 | #define LRADC_SRC_NMOS_THICK LRADC_SRC(10) |
56 | #define LRADC_SRC_PMOS_THICK LRADC_SRC(11) | 56 | #define LRADC_SRC_PMOS_THICK LRADC_SRC(11) |
57 | #define LRADC_SRC_PMOS_THICK LRADC_SRC(11) | 57 | #define LRADC_SRC_PMOS_THICK LRADC_SRC(11) |
58 | #if IMX233_SUBTARGET >= 3700 | ||
58 | #define LRADC_SRC_USB_DP LRADC_SRC(12) | 59 | #define LRADC_SRC_USB_DP LRADC_SRC(12) |
59 | #define LRADC_SRC_USB_DN LRADC_SRC(13) | 60 | #define LRADC_SRC_USB_DN LRADC_SRC(13) |
60 | #define LRADC_SRC_VBG LRADC_SRC(14) | 61 | #define LRADC_SRC_VBG LRADC_SRC(14) |
61 | #define LRADC_SRC_5V LRADC_SRC(15) | 62 | #define LRADC_SRC_5V LRADC_SRC(15) |
63 | #endif | ||
62 | 64 | ||
63 | /* frequency of the delay counter */ | 65 | /* frequency of the delay counter */ |
64 | #define LRADC_DELAY_FREQ 2000 | 66 | #define LRADC_DELAY_FREQ 2000 |
@@ -72,14 +74,17 @@ void imx233_lradc_setup_delay(int dchan, int trigger_lradc, int trigger_delays, | |||
72 | void imx233_lradc_clear_channel_irq(int channel); | 74 | void imx233_lradc_clear_channel_irq(int channel); |
73 | bool imx233_lradc_read_channel_irq(int channel); | 75 | bool imx233_lradc_read_channel_irq(int channel); |
74 | void imx233_lradc_enable_channel_irq(int channel, bool enable); | 76 | void imx233_lradc_enable_channel_irq(int channel, bool enable); |
77 | /* a non-null cb will enable the icoll interrupt, a null one will disable it | ||
78 | * NOTE the channel irq is automatically cleared */ | ||
75 | void imx233_lradc_set_channel_irq_callback(int channel, lradc_irq_fn_t cb); | 79 | void imx233_lradc_set_channel_irq_callback(int channel, lradc_irq_fn_t cb); |
76 | void imx233_lradc_kick_channel(int channel); | 80 | void imx233_lradc_kick_channel(int channel); |
77 | void imx233_lradc_kick_delay(int dchan); | 81 | void imx233_lradc_kick_delay(int dchan); |
78 | void imx233_lradc_wait_channel(int channel); | 82 | void imx233_lradc_wait_channel(int channel); |
79 | int imx233_lradc_read_channel(int channel); | 83 | int imx233_lradc_read_channel(int channel); |
80 | void imx233_lradc_clear_channel(int channel); | 84 | void imx233_lradc_clear_channel(int channel); |
81 | // acquire a virtual channel, returns -1 on timeout, channel otherwise */ | 85 | /* acquire a channel, returns -1 on timeout, channel otherwise |
82 | int imx233_lradc_acquire_channel(int timeout); | 86 | * the returned channel is garanteed to be able measure source src */ |
87 | int imx233_lradc_acquire_channel(int src, int timeout); | ||
83 | void imx233_lradc_release_channel(int chan); | 88 | void imx233_lradc_release_channel(int chan); |
84 | // doesn't check that channel is in use! | 89 | // doesn't check that channel is in use! |
85 | void imx233_lradc_reserve_channel(int channel); | 90 | void imx233_lradc_reserve_channel(int channel); |
@@ -96,9 +101,11 @@ void imx233_lradc_enable_touch_detect_irq(bool enable); | |||
96 | void imx233_lradc_clear_touch_detect_irq(void); | 101 | void imx233_lradc_clear_touch_detect_irq(void); |
97 | bool imx233_lradc_read_touch_detect(void); | 102 | bool imx233_lradc_read_touch_detect(void); |
98 | 103 | ||
104 | #if IMX233_SUBTARGET >= 3700 | ||
99 | /* enable sensing and return temperature in kelvin, | 105 | /* enable sensing and return temperature in kelvin, |
100 | * channels needs not to be configured */ | 106 | * channels needs not to be configured */ |
101 | int imx233_lradc_sense_die_temperature(int nmos_chan, int pmos_chan); | 107 | int imx233_lradc_sense_die_temperature(int nmos_chan, int pmos_chan); |
108 | #endif | ||
102 | /* return *raw* external temperature, might need some transformation | 109 | /* return *raw* external temperature, might need some transformation |
103 | * channel needs not to be configured */ | 110 | * channel needs not to be configured */ |
104 | int imx233_lradc_sense_ext_temperature(int chan, int sensor); | 111 | int imx233_lradc_sense_ext_temperature(int chan, int sensor); |