summaryrefslogtreecommitdiff
path: root/chip/stm32/adc-stm32f0.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/adc-stm32f0.c')
-rw-r--r--chip/stm32/adc-stm32f0.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/chip/stm32/adc-stm32f0.c b/chip/stm32/adc-stm32f0.c
index cffae10fd9..fd9711d44a 100644
--- a/chip/stm32/adc-stm32f0.c
+++ b/chip/stm32/adc-stm32f0.c
@@ -284,6 +284,16 @@ int adc_read_channel(enum adc_channel ch)
return value * adc->factor_mul / adc->factor_div + adc->shift;
}
+void adc_disable(void)
+{
+ STM32_ADC_CR |= STM32_ADC_CR_ADDIS;
+ /*
+ * Note that the ADC is not in OFF state immediately.
+ * Once the ADC is effectively put into OFF state,
+ * STM32_ADC_CR_ADDIS bit will be cleared by hardware.
+ */
+}
+
static void adc_init(void)
{
/*