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)
94#include <bits/attribs.h>
100#define EEMEM __attribute__((__section__(".eeprom")))
106#if defined (__DOXYGEN__)
107# define eeprom_is_ready()
108#elif defined (NVM_STATUS)
109# define eeprom_is_ready() bit_is_clear (NVM_STATUS, NVM_NVMBUSY_bp)
110#elif defined (NVMCTRL_STATUS)
111# define eeprom_is_ready() bit_is_clear (NVMCTRL_STATUS, NVMCTRL_EEBUSY_bp)
113# define eeprom_is_ready() bit_is_clear (DEECR, BSY)
115# define eeprom_is_ready() bit_is_clear (EECR, EEPE)
117# define eeprom_is_ready() bit_is_clear (EECR, EEWE)
126#define eeprom_busy_wait() do {} while (!eeprom_is_ready())
147#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
159#if defined(__DOXYGEN__)
161#elif __SIZEOF_DOUBLE__ == 4
163#elif __SIZEOF_DOUBLE__ == 8
170#if defined(__DOXYGEN__)
172#elif __SIZEOF_LONG_DOUBLE__ == 4
174#elif __SIZEOF_LONG_DOUBLE__ == 8
203#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
215#if defined(__DOXYGEN__)
217#elif __SIZEOF_DOUBLE__ == 4
219#elif __SIZEOF_DOUBLE__ == 8
226#if defined(__DOXYGEN__)
228#elif __SIZEOF_LONG_DOUBLE__ == 4
230#elif __SIZEOF_LONG_DOUBLE__ == 8
259#if defined(__DOXYGEN__) || __SIZEOF_LONG_LONG__ == 8
271#if defined(__DOXYGEN__)
273#elif __SIZEOF_DOUBLE__ == 4
275#elif __SIZEOF_DOUBLE__ == 8
282#if defined(__DOXYGEN__)
284#elif __SIZEOF_LONG_DOUBLE__ == 4
286#elif __SIZEOF_LONG_DOUBLE__ == 8
303#define _EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
308#define __EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val))
313#define _EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
318#define __EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr))
void eeprom_write_dword(uint32_t *__p, uint32_t __value)
void eeprom_read_block(void *__dst, const void *__src, size_t __n)
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_write_word(uint16_t *__p, uint16_t __value)
uint8_t eeprom_read_byte(const uint8_t *__p)
double eeprom_read_double(const double *__p)
long double eeprom_read_long_double(const long double *__p)
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_update_double(double *__p, double __value)
void eeprom_update_long_double(long double *__p, long double __value)
void eeprom_update_qword(uint64_t *__p, uint64_t __value)
void eeprom_update_block(const void *__src, void *__dst, size_t __n)
void eeprom_update_dword(uint32_t *__p, uint32_t __value)
void eeprom_write_qword(uint64_t *__p, uint64_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)
void eeprom_write_double(double *__p, double __value)
uint64_t eeprom_read_qword(const uint64_t *__p)
uint32_t eeprom_read_dword(const uint32_t *__p)
unsigned int uint16_t
Definition: stdint.h:91
unsigned long int uint32_t
Definition: stdint.h:101
unsigned char uint8_t
Definition: stdint.h:81
unsigned long long int uint64_t
Definition: stdint.h:115