m95512.h 949 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _SPI_E2PROM_H_
  2. #define _SPI_E2PROM_H_
  3. //512 Kbit (64 Kbytes) of EEPROM
  4. //Page size: 128 bytes
  5. #include "stm32f10x.h"
  6. #define E2PROM_SPI_CS_PORT GPIOB
  7. #define E2PROM_SPI_CS_PIN GPIO_Pin_12
  8. //CSÒý½ÅÅäÖÃ
  9. #define E2PROM_SPI_CS_HIGH GPIO_SetBits(E2PROM_SPI_CS_PORT, E2PROM_SPI_CS_PIN);
  10. #define E2PROM_SPI_CS_LOW GPIO_ResetBits(E2PROM_SPI_CS_PORT, E2PROM_SPI_CS_PIN);
  11. #define RDY 0x02
  12. #define WRSR 0x01
  13. #define WRITE 0x02
  14. #define READ 0x03
  15. #define WRDIS 0x04
  16. #define RDSR 0x05
  17. #define WREN 0x06
  18. void SPI_USER_Init(void);
  19. uint8_t SPI_USER_Send_Byte(uint8_t data);
  20. #endif /* _SPI_E2PROM_H_ */