/* Includes ----------------------------------------------------------------- */ #include "bsp\spi.h" /* Private define ----------------------------------------------------------- */ /* Private macro ------------------------------------------------------------ */ /* Private typedef ---------------------------------------------------------- */ /* Private variables -------------------------------------------------------- */ /* Private function -------------------------------------------------------- */ static BSP_SPI_t SPI_Get(SPI_HandleTypeDef *hspi) { if (hspi->Instance == SPI2) return BSP_SPI_ADC; else return BSP_ERR; } /* Exported functions ------------------------------------------------------- */ SPI_HandleTypeDef *BSP_SPI_GetHandle(BSP_SPI_t spi) { switch (spi) { case BSP_SPI_ADC: return &hspi2; default: return NULL; } }