Skip to content
Permalink
Browse files

drivers: gpio: stm32: add ASCR configuration for L47x+

For STM32L47x/48x series devices, register ASCR should be configured to
connect analog switch of gpio lines to the ADC.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
  • Loading branch information...
cybertale authored and galak committed Mar 7, 2019
1 parent 25ea5fe commit 3751275fb0ef513c708b5be0c9acb45c05fda20f
Showing with 10 additions and 0 deletions.
  1. +10 −0 drivers/gpio/gpio_stm32.c
@@ -163,6 +163,16 @@ int gpio_stm32_configure(u32_t *base_addr, int pin, int conf, int altf)
}
}

#if defined(CONFIG_SOC_SERIES_STM32L4X) && defined(GPIO_ASCR_ASC0)
/*
* For STM32L47xx/48xx, register ASCR should be configured to connect
* analog switch of gpio lines to the ADC.
*/
if (mode == STM32_MODER_ANALOG_MODE) {
LL_GPIO_EnablePinAnalogControl(gpio, pin_ll);
}
#endif

LL_GPIO_SetPinOutputType(gpio, pin_ll, otype >> STM32_OTYPER_SHIFT);

LL_GPIO_SetPinSpeed(gpio, pin_ll, ospeed >> STM32_OSPEEDR_SHIFT);

0 comments on commit 3751275

Please sign in to comment.
You can’t perform that action at this time.