aboutsummaryrefslogtreecommitdiff
path: root/drivers/arm/analog.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/arm/analog.h')
-rw-r--r--drivers/arm/analog.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/arm/analog.h b/drivers/arm/analog.h
index 081d0c1e7..ab592ada3 100644
--- a/drivers/arm/analog.h
+++ b/drivers/arm/analog.h
@@ -20,35 +20,32 @@
20#include "ch.h" 20#include "ch.h"
21#include <hal.h> 21#include <hal.h>
22 22
23
24#if !defined(STM32F0XX) && !defined(STM32F3XX) 23#if !defined(STM32F0XX) && !defined(STM32F3XX)
25#error "Only STM23F0 and STM32F3 devices have ADC support in QMK at this time." 24# error "Only STM23F0 and STM32F3 devices have ADC support in QMK at this time."
26#endif 25#endif
27 26
28#if !HAL_USE_ADC 27#if !HAL_USE_ADC
29#error "You need to set HAL_USE_ADC to TRUE in your halconf.h to use the ADC." 28# error "You need to set HAL_USE_ADC to TRUE in your halconf.h to use the ADC."
30#endif 29#endif
31 30
32#if !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 31#if !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4
33#error "You need to set one of the 'STM32_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC." 32# error "You need to set one of the 'STM32_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC."
34#endif 33#endif
35 34
36#if STM32_ADC_DUAL_MODE 35#if STM32_ADC_DUAL_MODE
37#error "STM32 ADC Dual Mode is not supported at this time." 36# error "STM32 ADC Dual Mode is not supported at this time."
38#endif 37#endif
39 38
40#if STM32_ADCV3_OVERSAMPLING 39#if STM32_ADCV3_OVERSAMPLING
41#error "STM32 ADCV3 Oversampling is not supported at this time." 40# error "STM32 ADCV3 Oversampling is not supported at this time."
42#endif 41#endif
43 42
44
45
46typedef struct { 43typedef struct {
47 pin_t pin; 44 pin_t pin;
48 uint8_t adc; 45 uint8_t adc;
49} pin_and_adc; 46} pin_and_adc;
50#define PIN_AND_ADC(p,a) (pin_and_adc){p,a} 47#define PIN_AND_ADC(p, a) \
51 48 (pin_and_adc) { p, a }
52 49
53// analogReference has been left un-defined for ARM devices. 50// analogReference has been left un-defined for ARM devices.
54// void analogReference(uint8_t mode); 51// void analogReference(uint8_t mode);