34#define _AVR_EEPROM_H_ 1
38#if !E2END && !defined(__DOXYGEN__) && !defined(__COMPILING_AVR_LIBC__)
39# warning "Device does not have EEPROM available."
42#if defined (EEAR) && !defined (EEARL) && !defined (EEARH)
100#include <bits/attribs.h>
105#define EEMEM __attribute__((__section__(".eeprom")))
111#if defined (__DOXYGEN__)
112# define eeprom_is_ready()
113#elif defined (NVM_STATUS)
114# define eeprom_is_ready() bit_is_clear (NVM_STATUS, NVM_NVMBUSY_bp)
115#elif defined (NVMCTRL_STATUS)
116# define eeprom_is_ready() bit_is_clear (NVMCTRL_STATUS, NVMCTRL_EEBUSY_bp)
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)
129#define eeprom_busy_wait() do {} while (!eeprom_is_ready())
169#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
176#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
197#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
204#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
211#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
222#if defined(__DOXYGEN__)
224#elif __SIZEOF_DOUBLE__ == 4
226#elif __SIZEOF_DOUBLE__ == 8
233#if defined(__DOXYGEN__)
235#elif __SIZEOF_LONG_DOUBLE__ == 4
237#elif __SIZEOF_LONG_DOUBLE__ == 8
286#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
293#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
314#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
321#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
328#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
339#if defined(__DOXYGEN__)
341#elif __SIZEOF_DOUBLE__ == 4
343#elif __SIZEOF_DOUBLE__ == 8
350#if defined(__DOXYGEN__)
352#elif __SIZEOF_LONG_DOUBLE__ == 4
354#elif __SIZEOF_LONG_DOUBLE__ == 8
402#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
409#if defined(__DOXYGEN__) || defined(__INT24_MAX__)
430#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
437#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
444#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
455#if defined(__DOXYGEN__)
457#elif __SIZEOF_DOUBLE__ == 4
459#elif __SIZEOF_DOUBLE__ == 8
466#if defined(__DOXYGEN__)
468#elif __SIZEOF_LONG_DOUBLE__ == 4
470#elif __SIZEOF_LONG_DOUBLE__ == 8
485#define _EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
489#define __EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
493#define _EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
497#define __EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
void eeprom_write_dword(uint32_t *__p, uint32_t __value)
int8_t eeprom_read_i8(const int8_t *__p)
int16_t eeprom_read_i16(const int16_t *__p)
void eeprom_read_block(void *__dst, const void *__src, size_t __n)
void eeprom_write_i16(int16_t *__p, int16_t __value)
void eeprom_update_float(float *__p, float __value)
void eeprom_update_word(uint16_t *__p, uint16_t __value)
void eeprom_write_long_double(long double *__p, long double __value)
void eeprom_update_i8(int8_t *__p, int8_t __value)
void eeprom_write_u16(uint16_t *__p, uint16_t __value)
void eeprom_update_i32(int32_t *__p, int32_t __value)
void eeprom_write_word(uint16_t *__p, uint16_t __value)
void eeprom_write_u8(uint8_t *__p, uint8_t __value)
void eeprom_update_i64(int64_t *__p, int64_t __value)
char eeprom_read_char(const char *__p)
void eeprom_update_u16(uint16_t *__p, uint16_t __value)
uint8_t eeprom_read_byte(const uint8_t *__p)
void eeprom_update_i24(int24_t *__p, int24_t __value)
double eeprom_read_double(const double *__p)
long double eeprom_read_long_double(const long double *__p)
void eeprom_update_u8(uint8_t *__p, uint8_t __value)
uint16_t eeprom_read_word(const uint16_t *__p)
void eeprom_update_byte(uint8_t *__p, uint8_t __value)
void eeprom_write_byte(uint8_t *__p, uint8_t __value)
void eeprom_write_i24(int24_t *__p, int24_t __value)
uint16_t eeprom_read_u16(const uint16_t *__p)
void eeprom_write_i64(int64_t *__p, int64_t __value)
void eeprom_write_i8(int8_t *__p, int8_t __value)
uint64_t eeprom_read_u64(const uint64_t *__p)
void eeprom_update_double(double *__p, double __value)
uint24_t eeprom_read_u24(const uint24_t *__p)
void eeprom_update_long_double(long double *__p, long double __value)
void eeprom_update_qword(uint64_t *__p, uint64_t __value)
void eeprom_write_char(char *__p, char __value)
void eeprom_update_char(char *__p, char __value)
int32_t eeprom_read_i32(const int32_t *__p)
void eeprom_update_block(const void *__src, void *__dst, size_t __n)
void eeprom_write_u32(uint32_t *__p, uint32_t __value)
void eeprom_update_u64(uint64_t *__p, uint64_t __value)
void eeprom_update_dword(uint32_t *__p, uint32_t __value)
void eeprom_write_qword(uint64_t *__p, uint64_t __value)
void eeprom_update_u24(uint24_t *__p, uint24_t __value)
void eeprom_update_u32(uint32_t *__p, uint32_t __value)
float eeprom_read_float(const float *__p)
void eeprom_write_block(const void *__src, void *__dst, size_t __n)
void eeprom_write_float(float *__p, float __value)
uint8_t eeprom_read_u8(const uint8_t *__p)
void eeprom_write_double(double *__p, double __value)
uint64_t eeprom_read_qword(const uint64_t *__p)
void eeprom_update_i16(int16_t *__p, int16_t __value)
uint32_t eeprom_read_dword(const uint32_t *__p)
uint32_t eeprom_read_u32(const uint32_t *__p)
int64_t eeprom_read_i64(const int64_t *__p)
void eeprom_write_u64(uint64_t *__p, uint64_t __value)
void eeprom_write_u24(uint24_t *__p, uint24_t __value)
int24_t eeprom_read_i24(const int24_t *__p)
void eeprom_write_i32(int32_t *__p, int32_t __value)
unsigned int uint16_t
Definition: stdint.h:96
unsigned long int uint32_t
Definition: stdint.h:114
__int24 int24_t
Definition: stdint.h:101
signed long long int int64_t
Definition: stdint.h:120
signed int int16_t
Definition: stdint.h:92
unsigned char uint8_t
Definition: stdint.h:88
unsigned long long int uint64_t
Definition: stdint.h:126
__uint24 uint24_t
Definition: stdint.h:106
signed long int int32_t
Definition: stdint.h:110
signed char int8_t
Definition: stdint.h:84