#ifndef __SPI_H
#define __SPI_H

#include "./SYSTEM/sys/sys.h"
#include "./SYSTEM/delay/delay.h"  

#define SPI2_SPI_CLK_ENABLE()                     do{__HAL_RCC_SPI2_CLK_ENABLE();}while(0)


#define SPI_MOSI_GPIO_PIN                         GPIO_PIN_15
#define SPI_MOSI_GPIO_PORT                        GPIOB
#define SPI_MOSI_GPIO_CLK_ENABLE()                do{__HAL_RCC_GPIOB_CLK_ENABLE();}while(0)

//#define SPI_MISO_GPIO_PIN                GPIO_PIN_14
//#define SPI_MISO_GPIO_PORT                  GPIOB
//#define SPI_MISO_GPIO_CLK_ENABLE()               do{    __HAL_RCC_GPIOB_CLK_ENABLE();}while(0)

#define SPI_CLK_GPIO_PIN                          GPIO_PIN_13
#define SPI_CLK_GPIO_PORT                         GPIOB
#define SPI_CLK_GPIO_CLK_ENABLE()                 do{__HAL_RCC_GPIOB_CLK_ENABLE();}while(0)



                  
void SPI_Init(void);
void Hard_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint8_t dir);

extern SPI_HandleTypeDef SPI2_Handle;
#endif
