diff --git a/boards/nucleo-f091/board.c b/boards/nucleo-f091/board.c index 74cb8797af..78fb5f7164 100644 --- a/boards/nucleo-f091/board.c +++ b/boards/nucleo-f091/board.c @@ -19,40 +19,13 @@ */ #include "board.h" -#include "cpu.h" - -static void leds_init(void); +#include "periph/gpio.h" void board_init(void) { - /* initialize the boards LEDs */ - leds_init(); /* initialize the CPU */ cpu_init(); -} -/** - * @brief Initialize the boards on-board LEDs - * - * The LED initialization is hard-coded in this function. - * As the LED is soldered onto the board it is fixed to - * its CPU pins. - * - * The green LED is connected to pin PA5 - */ -static void leds_init(void) -{ - /* enable clock for port GPIOA */ - RCC->AHBENR |= RCC_AHBENR_GPIOAEN; - /* set output speed to 50MHz */ - LED_GREEN_PORT->OSPEEDR |= 0x00000c00; - /* set output type to push-pull */ - LED_GREEN_PORT->OTYPER &= ~(0x00000020); - /* configure pin as general output */ - LED_GREEN_PORT->MODER &= ~(0x00000c00); - LED_GREEN_PORT->MODER |= 0x00000400; - /* disable pull resistors */ - LED_GREEN_PORT->PUPDR &= ~(0x00000c00); - /* turn all LEDs off */ - LED_GREEN_PORT->BRR = 0x00c0; + /* initialize the boards LEDs */ + gpio_init(LED0_PIN, GPIO_DIR_OUT, GPIO_NOPULL); }