aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/ADCv1
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-07-29 13:09:28 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-07-29 13:09:28 +0000
commite9329762b11d7e3188a6610c6dcde36a66778e34 (patch)
tree10d26dab7114be39b68afd2a85890e21ea5b4feb /os/hal/ports/STM32/LLD/ADCv1
parent20bd48025885d03ae1ecc46bb9f8f2f1fa952630 (diff)
downloadChibiOS-e9329762b11d7e3188a6610c6dcde36a66778e34.tar.gz
ChibiOS-e9329762b11d7e3188a6610c6dcde36a66778e34.tar.bz2
ChibiOS-e9329762b11d7e3188a6610c6dcde36a66778e34.zip
More checks in STM32 ADCv1 driver. Added notes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8129 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/ADCv1')
-rw-r--r--os/hal/ports/STM32/LLD/ADCv1/adc_lld.h11
-rw-r--r--os/hal/ports/STM32/LLD/ADCv1/notes.txt16
2 files changed, 27 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/ADCv1/adc_lld.h b/os/hal/ports/STM32/LLD/ADCv1/adc_lld.h
index 41ca80859..1ec639801 100644
--- a/os/hal/ports/STM32/LLD/ADCv1/adc_lld.h
+++ b/os/hal/ports/STM32/LLD/ADCv1/adc_lld.h
@@ -215,6 +215,17 @@
#endif
#endif
+/* Check on the presence of the DMA streams settings in mcuconf.h.*/
+#if STM32_ADC_USE_ADC1 && !defined(STM32_ADC_ADC1_DMA_STREAM)
+#error "ADC DMA stream not defined"
+#endif
+
+/* Check on the validity of the assigned DMA channels.*/
+#if STM32_ADC_USE_ADC1 && \
+ !STM32_DMA_IS_VALID_ID(STM32_ADC_ADC1_DMA_STREAM, STM32_ADC1_DMA_MSK)
+#error "invalid DMA stream associated to ADC1"
+#endif
+
#if !defined(STM32_DMA_REQUIRED)
#define STM32_DMA_REQUIRED
#endif
diff --git a/os/hal/ports/STM32/LLD/ADCv1/notes.txt b/os/hal/ports/STM32/LLD/ADCv1/notes.txt
new file mode 100644
index 000000000..5dd7576c4
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/ADCv1/notes.txt
@@ -0,0 +1,16 @@
+STM32 ADCv1 driver.
+
+Driver capability:
+
+- Supports the STM32 "simple" ADC, the one found on small devices (F0, L0).
+
+The file registry must export:
+
+STM32_HAS_ADC1 - ADC1 presence flag.
+STM32_ADC_SUPPORTS_PRESCALER - Support of CCR PRESC field.
+STM32_ADC_SUPPORTS_OVERSAMPLING - Support of oversampling-related fields.
+STM32_ADC1_IRQ_SHARED_WITH_EXTI - TRUE if the IRQ is shared with EXTI.
+STM32_ADC1_HANDLER - IRQ vector name.
+STM32_ADC1_NUMBER - IRQ vector number.
+STM32_ADC1_DMA_MSK - Mask of the compatible DMA channels.
+STM32_ADC1_DMA_CHN - Mask of the challens mapping.