summaryrefslogtreecommitdiff
path: root/include/adc.h
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-03-17 16:52:57 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-20 23:51:28 +0000
commitb9b5c89c301d5c7eb68b5ad5b9e05978ce93f436 (patch)
treef175f95ccf20c4dd01b662f086ce0c2459e122b1 /include/adc.h
parent6472ce964dba986907ee4b1a0250c8e27658a492 (diff)
downloadchrome-ec-b9b5c89c301d5c7eb68b5ad5b9e05978ce93f436.tar.gz
stm32: implement ADC support for STM32F0xx
Replace the stubs by an actual implementation for ADC and Analog watchdog support on STM32F0xx chips. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=manually read ADC values on STM32F072B discovery. TEST=read all ADC values at once. TEST=Enable watchdog and check it fires when the voltage goes out of range. TEST=read ADC value(s) while watchdog is enabled. TEST=Disable watchdog and check it's actually disabled. Change-Id: Ie6fbd1aa95a3d76394fa47803e8cfc24bf5e4562 Reviewed-on: https://chromium-review.googlesource.com/190710 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/adc.h')
-rw-r--r--include/adc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/adc.h b/include/adc.h
index 3ff88b77f9..efca057445 100644
--- a/include/adc.h
+++ b/include/adc.h
@@ -57,4 +57,15 @@ int adc_enable_watchdog(int ain_id, int high, int low);
*/
int adc_disable_watchdog(void);
+/**
+ * Set the delay between ADC watchdog samples. This can be used as a trade-off
+ * of power consumption and performance.
+ *
+ * @param delay_ms The delay in milliseconds between two ADC watchdog
+ * samples.
+ *
+ * @return EC_SUCCESS, or non-zero if any error or not supported.
+ */
+int adc_set_watchdog_delay(int delay_ms);
+
#endif /* __CROS_EC_ADC_H */