diff --git a/spi.c b/spi.c --- a/spi.c +++ b/spi.c @@ -1,9 +1,9 @@ #include "stm32f0xx_hal_conf.h" #include "stm32f0xx_hal_gpio_ex.h" -extern SPI_HandleTypeDef hspi1; +SPI_HandleTypeDef hspi1; -void init_spi() +void spi_init() { hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; @@ -20,4 +20,9 @@ void init_spi() HAL_SPI_Init(&hspi1); } +SPI_HandleTypeDef* spi_get() +{ + return &hspi1; +} + // vim:softtabstop=4 shiftwidth=4 expandtab