diff options
author | Vic Yang <victoryang@chromium.org> | 2013-03-13 08:48:03 +0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-13 12:11:59 -0700 |
commit | 2823e7e13208a70c7c1b0fce56758f17049a1658 (patch) | |
tree | ddc0d577600026026956a86abf6de4428c6a58a4 /include/adc.h | |
parent | eefc0ac8c5e3b167d902997e28324e5f57e0a932 (diff) | |
download | chrome-ec-2823e7e13208a70c7c1b0fce56758f17049a1658.tar.gz |
stm32f: Add support for ADC watchdog
This makes it possible to have ADC module monitor an input voltage and
trigger interrupt when it goes out of accepted range.
BUG=chrome-os-partner:18171
TEST=Manual
BRANCH=spring
Change-Id: Ia0c981fadd9bcaa40afe30ca2624c2f3644b95fe
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45277
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/adc.h')
-rw-r--r-- | include/adc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/adc.h b/include/adc.h index 646298ca76..715852cd76 100644 --- a/include/adc.h +++ b/include/adc.h @@ -29,4 +29,24 @@ int adc_read_channel(enum adc_channel ch); */ int adc_read_all_channels(int *data); +/** + * Enable ADC watchdog. Note that interrupts might come in repeatedly very + * quickly when ADC output goes out of the accepted range. + * + * @param ain_id The AIN to be watched by the watchdog. + * @param high The high threshold that the watchdog would trigger + * an interrupt when exceeded. + * @param low The low threshold. + * + * @return EC_SUCCESS, or non-zero if any error. + */ +int adc_enable_watchdog(int ain_id, int high, int low); + +/** + * Disable ADC watchdog. + * + * @return EC_SUCCESS, or non-zero if any error. + */ +int adc_disable_watchdog(void); + #endif /* __CROS_EC_ADC_H */ |