35 #ifndef _AVR_EEPROM_H_
36 #define _AVR_EEPROM_H_ 1
40 #if !E2END && !defined(__DOXYGEN__) && !defined(__COMPILING_AVR_LIBC__)
41 # warning "Device does not have EEPROM available."
44 #if defined (EEAR) && !defined (EEARL) && !defined (EEARH)
97 # define __ATTR_PURE__
99 # define __ATTR_PURE__ __attribute__((__pure__))
107 #define EEMEM __attribute__((section(".eeprom")))
113 #if defined (__DOXYGEN__)
114 # define eeprom_is_ready()
115 #elif defined (__AVR_XMEGA__) && __AVR_XMEGA__
116 # define eeprom_is_ready() bit_is_clear (NVM_STATUS, NVM_NVMBUSY_bp)
117 #elif defined (DEECR)
118 # define eeprom_is_ready() bit_is_clear (DEECR, BSY)
120 # define eeprom_is_ready() bit_is_clear (EECR, EEPE)
122 # define eeprom_is_ready() bit_is_clear (EECR, EEWE)
131 #define eeprom_busy_wait() do {} while (!eeprom_is_ready())
221 #define _EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
226 #define __EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
231 #define _EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
236 #define __EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
void eeprom_update_block(const void *__src, void *__dst, size_t __n)
void eeprom_write_block(const void *__src, void *__dst, size_t __n)
void eeprom_update_word(uint16_t *__p, uint16_t __value)
void eeprom_write_byte(uint8_t *__p, uint8_t __value)
void eeprom_read_block(void *__dst, const void *__src, size_t __n)
void eeprom_write_dword(uint32_t *__p, uint32_t __value)
float eeprom_read_float(const float *__p) __ATTR_PURE__
void eeprom_update_dword(uint32_t *__p, uint32_t __value)
void eeprom_write_float(float *__p, float __value)
void eeprom_update_byte(uint8_t *__p, uint8_t __value)
unsigned char uint8_t
Definition: stdint.h:83
unsigned long int uint32_t
Definition: stdint.h:103
uint32_t eeprom_read_dword(const uint32_t *__p) __ATTR_PURE__
void eeprom_write_word(uint16_t *__p, uint16_t __value)
void eeprom_update_float(float *__p, float __value)
uint8_t eeprom_read_byte(const uint8_t *__p) __ATTR_PURE__
uint16_t eeprom_read_word(const uint16_t *__p) __ATTR_PURE__
unsigned int uint16_t
Definition: stdint.h:93