Go to the source code of this file.
Functions | |
unsigned char | eeprom_get_char (unsigned int addr) |
Read byte from EEPROM. More... | |
void | eeprom_put_char (unsigned int addr, unsigned char new_value) |
Write byte to EEPROM. More... | |
void | memcpy_to_eeprom_with_checksum (unsigned int destination, char *source, unsigned int size) |
Extensions added as part of Grbl. More... | |
int | memcpy_from_eeprom_with_checksum (char *destination, unsigned int source, unsigned int size) |
unsigned char eeprom_get_char | ( | unsigned int | addr | ) |
Read byte from EEPROM.
This function reads one byte from a given EEPROM address.
addr | EEPROM address to read from. |
< Wait for completion of previous write.
< Set EEPROM address register.
< Start EEPROM read operation.
< Return the byte read from EEPROM.
void eeprom_put_char | ( | unsigned int | addr, |
unsigned char | new_value | ||
) |
Write byte to EEPROM.
This function writes one byte to a given EEPROM address. The differences between the existing byte and the new value is used to select the most efficient EEPROM programming mode.
addr | EEPROM address to write to. |
new_value | New EEPROM value. |
< Old EEPROM value.
< Difference mask, i.e. old value XOR new value.
< Ensure atomic operation for the write operation.
< Wait for completion of previous write.
< Set EEPROM address register.
< Start EEPROM read operation.
< Get old EEPROM value.
< Get bit differences.
< Set EEPROM data register.
< Set Master Write Enable bit...
< ...and Erase+Write mode.
< Start Erase+Write operation.
< Set Master Write Enable bit...
< ...and Erase-only mode.
< Start Erase-only operation.
< Set EEPROM data register.
< Set Master Write Enable bit...
< ...and Write-only mode.
< Start Write-only operation.
< Restore interrupt flag state.
int memcpy_from_eeprom_with_checksum | ( | char * | destination, |
unsigned int | source, | ||
unsigned int | size | ||
) |