/*
 * spi.h
 *
 *  Created on: 2021Äê6ÔÂ26ÈÕ
 *      Author: graydon
 */

#ifndef DRV_SPI_H_
#define DRV_SPI_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"

typedef enum {
	SPI_BUSY,  //SPIæ²»ÄÜ·¢ËͺͽÓÊÕ
	SPI_TX,   //SPI´¦ÓÚ·¢ËÍÊý¾Ý״̬
	SPI_RX,   //SPI´¦ÓÚ½ÓÊÕÊý¾Ý״̬
	SPI_TRX,  //SPI´¦ÓÚͬʱ·¢ËͽÓÊÕÊý¾Ý״̬
}SPIStatus;

#define V2

extern volatile unsigned char 	SPI_Tx_BUFFER[SPI_BUFFER_SIZE];
extern volatile unsigned char 	SPI_Rx_BUFFER[SPI_BUFFER_SIZE];
extern volatile short SPIRxDone ;
extern volatile short SPITxDone ;

void SPI2_SetTransMode(SPIStatus status);

int SPI2_Init(void);

#ifdef __cplusplus
}
#endif
#endif /* DRV_SPI_H_ */