summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/button-lradc-imx233.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/button-lradc-imx233.h')
-rw-r--r--firmware/target/arm/imx233/button-lradc-imx233.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/button-lradc-imx233.h b/firmware/target/arm/imx233/button-lradc-imx233.h
index eac5517adf..d96823fcdc 100644
--- a/firmware/target/arm/imx233/button-lradc-imx233.h
+++ b/firmware/target/arm/imx233/button-lradc-imx233.h
@@ -30,7 +30,19 @@
30 * - imx233_button_lradc_mapping: target-defined table of adc values and mapping 30 * - imx233_button_lradc_mapping: target-defined table of adc values and mapping
31 * - IMX233_BUTTON_LRADC_CHANNEL: lradc channel to use 31 * - IMX233_BUTTON_LRADC_CHANNEL: lradc channel to use
32 * - IMX233_BUTTON_LRADC_HOLD_DET: define hold detection method (ignored if !HAS_BUTTON_HOLD) 32 * - IMX233_BUTTON_LRADC_HOLD_DET: define hold detection method (ignored if !HAS_BUTTON_HOLD)
33 * - IMX233_BUTTON_LRADC_MODE: define the button lradc mode
33 * 34 *
35 * The LRADC code supports two modes of operations: VDDIO relative or absolute.
36 * In the (default) absolute value mode, the LRADC channel is sampled and its value
37 * is compared to the one in the imx233_button_lradc_mapping table. This is
38 * appropriate when the resistor ladder is derived from a fixed voltage.
39 * In the VDDIO relative mode, the values in imx233_button_lradc_mapping are
40 * the values for a specific value of VDDIO which is given by
41 * IMX233_BUTTON_LRADC_VDDIO. In this mode, the code will also sample VDDIO
42 * and do the following comparison:
43 * lradc_value <=? imx233_button_lradc_mapping[i] * vddio_ref / vddio_value
44 * where vddio_ref is IMX233_BUTTON_LRADC_VDDIO.
45 *
34 * The available values of IMX233_BUTTON_LRADC_HOLD are: 46 * The available values of IMX233_BUTTON_LRADC_HOLD are:
35 * - BLH_ADC: detect hold using adc 47 * - BLH_ADC: detect hold using adc
36 * - BLH_EXT: target button driver implements imx233_button_lradc_hold() using 48 * - BLH_EXT: target button driver implements imx233_button_lradc_hold() using
@@ -40,6 +52,10 @@
40 * + BLH_GPIO_PIN: pin in bank 52 * + BLH_GPIO_PIN: pin in bank
41 * + BLH_GPIO_INVERTED: define if inverted, default is active high 53 * + BLH_GPIO_INVERTED: define if inverted, default is active high
42 * + BLH_GPIO_PULLUP: define if pins needs pullup 54 * + BLH_GPIO_PULLUP: define if pins needs pullup
55 *
56 * WARNING
57 * There must always be entry in imx233_button_lradc_mapping whose value is the steady
58 * value of the channel when no button is pressed, and which maps to no button (.btn = 0)
43 */ 59 */
44 60
45/* hold detect method */ 61/* hold detect method */
@@ -74,5 +90,8 @@ int imx233_button_lradc_read(int others);
74bool imx233_button_lradc_hold(void); 90bool imx233_button_lradc_hold(void);
75#endif 91#endif
76int imx233_button_lradc_read_raw(void); // return raw adc value 92int imx233_button_lradc_read_raw(void); // return raw adc value
93#ifdef IMX233_BUTTON_LRADC_VDDIO
94int imx233_button_lradc_read_vddio(void);
95#endif
77 96
78#endif /* __button_lradc_imx233__ */ 97#endif /* __button_lradc_imx233__ */