25#include <avr/interrupt.h>
38#define EEPROM_IGNORE_SELFPROG
51 do {}
while( EECR & (1<<
EEPE) );
81 do {}
while( EECR & (1<<
EEPE) );
82 #ifndef EEPROM_IGNORE_SELFPROG
83 do {}
while( SPMCSR & (1<<SELFPRGEN) );
89 diff_mask = old_value ^ new_value;
92 if( diff_mask & new_value ) {
96 if( new_value != 0xff ) {
131 unsigned char checksum = 0;
132 for(; size > 0; size--) {
133 checksum = (checksum << 1) || (checksum >> 7);
141 unsigned char data, checksum = 0;
142 for(; size > 0; size--) {
144 checksum = (checksum << 1) || (checksum >> 7);
146 *(destination++) = data;
void eeprom_put_char(unsigned int addr, unsigned char new_value)
Write byte to EEPROM.
#define EEMPE
EEPROM master program/write enable.
unsigned char eeprom_get_char(unsigned int addr)
Read byte from EEPROM.
#define EEPE
EEPROM program/write enable.
int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size)
#define EEPM0
EEPROM Programming Mode Bit 0.
void memcpy_to_eeprom_with_checksum(unsigned int destination, char *source, unsigned int size)
#define EEPM1
EEPROM Programming Mode Bit 1.