#ifndef __MYSPI_H #define __MYSPI_H #ifdef __cplusplus extern "C" { #endif #include #include "stm32f4xx_spi.h" typedef enum { sSPI1, sSPI2, sSPI3, sSPI4, sSPI5, sSPI6 }SPISelect ; void InitSPI( SPISelect SPS, uint16_t SPI_Direction, uint16_t SPI_Mode, uint16_t SPI_DataSize, uint16_t SPI_CPOL, uint16_t SPI_CPHA, uint16_t SPI_NSS, uint16_t SPI_BaudRatePrescaler, uint16_t SPI_FirstBit, uint16_t SPI_CRCPolynomial); // TODO: Later :) uint16_t ReadSPI(SPI_TypeDef* SPIx); void WriteSPI(SPI_TypeDef* SPIx, uint16_t Data); void SoftwareCSEnable(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); void SoftwareCSDisable(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); #ifdef __cplusplus } #endif //__cplusplus #endif //__MYSPI_H