EEPROM handling

This header file declares the interface to some simple library routines suitable for handling the data EEPROM contained in the AVR microcontrollers. The implementation uses a simple polled mode interface. Applications that require interrupt-controlled EEPROM access to ensure that no time will be wasted in spinloops will have to deploy their own implementation.

Note: All of the read/write functions first make sure the EEPROM is ready to be accessed. Since this may cause long delays if a write operation is still pending, time-critical applications should first poll the EEPROM e. g. using eeprom_is_ready() before attempting any actual I/O.

This header file declares inline functions that call the assembler subroutines directly. This prevents that the compiler generates push/pops for the call-clobbered registers. This way also a specific calling convention could be used for the eeprom routines e.g. by passing values in __tmp_reg__, eeprom addresses in X and memory addresses in Z registers. Method is optimized for code size.

Presently supported are two locations of the EEPROM register set: 0x1F,0x20,0x21 and 0x1C,0x1D,0x1E (see __EEPROM_REG_LOCATIONS__).

avr-libc declarations

IAR C compatibility defines

Defines

Define Documentation

#define __EEPROM_REG_LOCATIONS__ 1C1D1E