Created
July 13, 2019 16:28
-
-
Save surinoel/4c8758db59d070baca56f3193f74c31b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define EEPROM_PAGE_SIZE 16 | |
#define EEPROM_TOTAL_BYTE 128 | |
void EEPROM_eraseALL(void) | |
{ | |
uint8_t i; | |
uint16_t pageAddress = 0; | |
while(pageAddress < EEPROM_TOTAL_BYTE) { | |
EEPROM_writeEnable(); | |
EEPROM_Select(); | |
EEPROM_changeByte(EERPOM_WRITE); | |
EEPROM_sendAddress(pageAddress); | |
for(i=0; i<EEPROM_PAGE_SIZE; i++) { | |
EEPROM_changeByte(0); | |
} | |
EEPROM_DeSelect(); | |
pageAddress += EEPROM_PAGE_SIZE; | |
while(EEPROM_readStatus() & _BV(0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment