mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #3013 from bcostm/check_adcintch_pins
STM32xx - Change how the ADC internal pins are checked before pinmap_…pull/3076/head
commit
2ae71777aa
|
@ -50,8 +50,9 @@ void analogin_init(analogin_t *obj, PinName pin) {
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref)
|
||||
if ((obj->channel != 16) && (obj->channel != 17)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vlcd)
|
||||
if ((obj->channel != 16) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref)
|
||||
if ((obj->channel != 16) && (obj->channel != 17)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,9 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
MBED_ASSERT(function != (uint32_t)NC);
|
||||
obj->channel = STM_PIN_CHANNEL(function);
|
||||
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat)
|
||||
if ((obj->channel != 0) && (obj->channel != 17) && (obj->channel != 18)) {
|
||||
// Configure GPIO excepted for internal channels (Temperature, Vref, Vbat, ...)
|
||||
// ADC Internal Channels "pins" are described in PinNames.h and must have a value >= 0xF0
|
||||
if (pin < 0xF0) {
|
||||
pinmap_pinout(pin, PinMap_ADC);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue