28 #ifndef SPIRIT_SDK_EEPROM_H_ 29 #define SPIRIT_SDK_EEPROM_H_ 57 #define EEPROM_CMD_WREN 0x06 // Write Enable 58 #define EEPROM_CMD_WRDI 0x04 // Write Disable 59 #define EEPROM_CMD_RDSR 0x05 // Read Status Register 60 #define EEPROM_CMD_WRSR 0x01 // Write Status Register 61 #define EEPROM_CMD_READ 0x03 // Read from Memory Array 62 #define EEPROM_CMD_WRITE 0x02 // Write to Memory Array 65 #define EEPROM_STATUS_SRWD 0x80 // Status Register Write Disable 66 #define EEPROM_STATUS_BP 0x0C // Block Protect 67 #define EEPROM_STATUS_WEL 0x02 // Write Enable 68 #define EEPROM_STATUS_WIP 0x01 // Write in Progress 76 void EepromRead(uint16_t nAddress, uint8_t cNbBytes, uint8_t* pcBuffer);
77 void EepromWrite(uint16_t nAddress, uint8_t cNbBytes, uint8_t* pcBuffer);
void EepromSpiInitialization(void)
Initializes the SPI for the EEPROM. SPI, MISO, MOSI and SCLK are the same used for the SPIRIT1....
void EepromCsPinInitialization(void)
Initialization of the CSn pin of the EEPROM. This function is called internally by EepromCsPinInitial...
uint8_t EepromResetSrwd(void)
Reset the ERSR status bit.
uint8_t SdkEvalGetHasEeprom(void)
This function is to query if EEPROM is present or not.
void SdkEvalSetHasEeprom(uint8_t eeprom)
This function is to set if EEPROM is present or not.
void EepromRead(uint16_t nAddress, uint8_t cNbBytes, uint8_t *pcBuffer)
Read a page of the EEPROM. A page size is 32 bytes. The pages are 256. Page 0 address: 0x0000 Page 1 ...
void EepromWrite(uint16_t nAddress, uint8_t cNbBytes, uint8_t *pcBuffer)
Write a page of the EEPROM. A page size is 32 bytes. The pages are 256. Page 0 address: 0x0000 Page 1...
uint8_t EepromStatus(void)
Read the status register.
void EepromCsXnucleoPinInitialization(void)
Initialization of the CSn pin of the EEPROM for XNUCLEO boards.
uint8_t EepromSetSrwd(void)
Set the ERSR status bit.
void EepromWriteEnable(void)
Set the internal WEL flag to allow write operation.