/* * FILE : spi.h * DESCRIPTION : This file is iHMI43 spi header. * Author : XiaomaGee@Gmail.com * Copyright : * * History * -------------------- * Rev : 0.00 * Date : 03/05/2012 * * create. * -------------------- */ #ifndef __SPI1_H__ #define __SPI1_H__ #include "stm32f4xx_rcc.h" #include "stm32f4xx_spi.h" #include "stm32f4xx_gpio.h" #include //-----------------Include files-------------------------// //------------------- Define ----------------------------// #define SPI1_CS_OFF GPIO_ResetBits(GPIOA,GPIO_Pin_4) #define SPI1_CS_ON GPIO_SetBits(GPIOA,GPIO_Pin_4) //------------------- Typedef --------------------------// typedef struct{ int (* initialize)(void); int (* write)(int /* number */,uint8_t * /* buffer */); uint8_t (* send_data)(uint8_t ); }SPI1_T; //------------------- Extern --------------------------// extern SPI1_T spi1; #endif //__SPI6_H__