mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2000 from egostm/STM32F4xx_ADC2_support
[STM32F4] Add ADC2 support to F4 familypull/2009/head
commit
e508525bd4
|
@ -38,6 +38,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE,
|
||||
ADC_2 = (int)ADC2_BASE,
|
||||
ADC_3 = (int)ADC3_BASE
|
||||
} ADCName;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE,
|
||||
ADC_2 = (int)ADC2_BASE,
|
||||
ADC_3 = (int)ADC3_BASE
|
||||
} ADCName;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE,
|
||||
ADC_2 = (int)ADC2_BASE,
|
||||
ADC_3 = (int)ADC3_BASE
|
||||
} ADCName;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE,
|
||||
ADC_2 = (int)ADC2_BASE,
|
||||
ADC_3 = (int)ADC3_BASE
|
||||
} ADCName;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE,
|
||||
ADC_2 = (int)ADC2_BASE,
|
||||
ADC_3 = (int)ADC3_BASE
|
||||
} ADCName;
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
#if defined(ADC1)
|
||||
static int adc1_inited = 0;
|
||||
#endif
|
||||
#if defined(ADC2)
|
||||
static int adc2_inited = 0;
|
||||
#endif
|
||||
#if defined(ADC3)
|
||||
static int adc3_inited = 0;
|
||||
#endif
|
||||
|
@ -70,6 +73,13 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
adc1_inited = 1;
|
||||
}
|
||||
#endif
|
||||
#if defined(ADC2)
|
||||
if ((obj->adc == ADC_2) && adc2_inited) return;
|
||||
if (obj->adc == ADC_2) {
|
||||
__ADC2_CLK_ENABLE();
|
||||
adc2_inited = 1;
|
||||
}
|
||||
#endif
|
||||
#if defined(ADC3)
|
||||
if ((obj->adc == ADC_3) && adc3_inited) return;
|
||||
if (obj->adc == ADC_3) {
|
||||
|
|
Loading…
Reference in New Issue