Skip to content
Snippets Groups Projects
Commit b2c3df33 authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

cpu/stm32/gpio: power up port G with L4

parent e07ea98b
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,13 @@ int gpio_init(gpio_t pin, gpio_mode_t mode) ...@@ -85,6 +85,13 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
periph_clk_en(IOP, (RCC_IOPENR_GPIOAEN << _port_num(pin))); periph_clk_en(IOP, (RCC_IOPENR_GPIOAEN << _port_num(pin)));
#elif defined (CPU_FAM_STM32L4) #elif defined (CPU_FAM_STM32L4)
periph_clk_en(AHB2, (RCC_AHB2ENR_GPIOAEN << _port_num(pin))); periph_clk_en(AHB2, (RCC_AHB2ENR_GPIOAEN << _port_num(pin)));
#ifdef PWR_CR2_IOSV
if (port == GPIOG) {
/* Port G requires external power supply */
periph_clk_en(APB1, RCC_APB1ENR1_PWREN);
PWR->CR2 |= PWR_CR2_IOSV;
}
#endif /* PWR_CR2_IOSV */
#else #else
periph_clk_en(AHB1, (RCC_AHB1ENR_GPIOAEN << _port_num(pin))); periph_clk_en(AHB1, (RCC_AHB1ENR_GPIOAEN << _port_num(pin)));
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment