#ifndef _SPI_E2PROM_H_
#define _SPI_E2PROM_H_

//512 Kbit (64 Kbytes) of EEPROM
//Page size: 128 bytes

#include "stm32f10x.h"

#define             E2PROM_SPI_CS_PORT                        GPIOB 
#define             E2PROM_SPI_CS_PIN                         GPIO_Pin_12


//CSÒý½ÅÅäÖÃ
#define E2PROM_SPI_CS_HIGH			GPIO_SetBits(E2PROM_SPI_CS_PORT, E2PROM_SPI_CS_PIN);
#define E2PROM_SPI_CS_LOW			GPIO_ResetBits(E2PROM_SPI_CS_PORT, E2PROM_SPI_CS_PIN);


#define RDY                 0x02    

#define WRSR               	0x01        
#define WRITE            	0x02                                                                            
#define READ     			0x03                                                                                  
#define WRDIS             	0x04
#define RDSR               	0x05        
#define WREN             	0x06

void SPI_USER_Init(void);
uint8_t SPI_USER_Send_Byte(uint8_t data);

#endif /* _SPI_E2PROM_H_ */

