|
AVR-LibC
2.3.0
Standard C library for AVR-GCC
|
AVR-LibC Manual |
![]() ![]() |
AVR-LibC Sources |
|||
Main Page |
User Manual |
Library Reference |
FAQ |
Example Projects |
Index |
Macros | |
| #define | EEMEM __attribute__((__section__(".eeprom"))) |
| #define | eeprom_is_ready() |
| #define | eeprom_busy_wait() do {} while (!eeprom_is_ready()) |
EEPROM Read Functions | |
| uint8_t | eeprom_read_byte (const uint8_t *__p) |
| char | eeprom_read_char (const char *__p) |
| uint8_t | eeprom_read_u8 (const uint8_t *__p) |
| int8_t | eeprom_read_i8 (const int8_t *__p) |
| uint16_t | eeprom_read_word (const uint16_t *__p) |
| uint16_t | eeprom_read_u16 (const uint16_t *__p) |
| int16_t | eeprom_read_i16 (const int16_t *__p) |
| uint24_t | eeprom_read_u24 (const uint24_t *__p) |
| int24_t | eeprom_read_i24 (const int24_t *__p) |
| uint32_t | eeprom_read_dword (const uint32_t *__p) |
| uint32_t | eeprom_read_u32 (const uint32_t *__p) |
| int32_t | eeprom_read_i32 (const int32_t *__p) |
| uint64_t | eeprom_read_qword (const uint64_t *__p) |
| uint64_t | eeprom_read_u64 (const uint64_t *__p) |
| int64_t | eeprom_read_i64 (const int64_t *__p) |
| float | eeprom_read_float (const float *__p) |
| double | eeprom_read_double (const double *__p) |
| long double | eeprom_read_long_double (const long double *__p) |
| void | eeprom_read_block (void *__dst, const void *__src, size_t __n) |
EEPROM Write Functions | |
| void | eeprom_write_byte (uint8_t *__p, uint8_t __value) |
| void | eeprom_write_char (char *__p, char __value) |
| void | eeprom_write_u8 (uint8_t *__p, uint8_t __value) |
| void | eeprom_write_i8 (int8_t *__p, int8_t __value) |
| void | eeprom_write_word (uint16_t *__p, uint16_t __value) |
| void | eeprom_write_u16 (uint16_t *__p, uint16_t __value) |
| void | eeprom_write_i16 (int16_t *__p, int16_t __value) |
| void | eeprom_write_u24 (uint24_t *__p, uint24_t __value) |
| void | eeprom_write_i24 (int24_t *__p, int24_t __value) |
| void | eeprom_write_dword (uint32_t *__p, uint32_t __value) |
| void | eeprom_write_u32 (uint32_t *__p, uint32_t __value) |
| void | eeprom_write_i32 (int32_t *__p, int32_t __value) |
| void | eeprom_write_qword (uint64_t *__p, uint64_t __value) |
| void | eeprom_write_u64 (uint64_t *__p, uint64_t __value) |
| void | eeprom_write_i64 (int64_t *__p, int64_t __value) |
| void | eeprom_write_float (float *__p, float __value) |
| void | eeprom_write_double (double *__p, double __value) |
| void | eeprom_write_long_double (long double *__p, long double __value) |
| void | eeprom_write_block (const void *__src, void *__dst, size_t __n) |
EEPROM Update Functions | |
| void | eeprom_update_byte (uint8_t *__p, uint8_t __value) |
| void | eeprom_update_char (char *__p, char __value) |
| void | eeprom_update_u8 (uint8_t *__p, uint8_t __value) |
| void | eeprom_update_i8 (int8_t *__p, int8_t __value) |
| void | eeprom_update_word (uint16_t *__p, uint16_t __value) |
| void | eeprom_update_u16 (uint16_t *__p, uint16_t __value) |
| void | eeprom_update_i16 (int16_t *__p, int16_t __value) |
| void | eeprom_update_u24 (uint24_t *__p, uint24_t __value) |
| void | eeprom_update_i24 (int24_t *__p, int24_t __value) |
| void | eeprom_update_dword (uint32_t *__p, uint32_t __value) |
| void | eeprom_update_u32 (uint32_t *__p, uint32_t __value) |
| void | eeprom_update_i32 (int32_t *__p, int32_t __value) |
| void | eeprom_update_qword (uint64_t *__p, uint64_t __value) |
| void | eeprom_update_u64 (uint64_t *__p, uint64_t __value) |
| void | eeprom_update_i64 (int64_t *__p, int64_t __value) |
| void | eeprom_update_float (float *__p, float __value) |
| void | eeprom_update_double (double *__p, double __value) |
| void | eeprom_update_long_double (long double *__p, long double __value) |
| void | eeprom_update_block (const void *__src, void *__dst, size_t __n) |
IAR C Compatibility Defines | |
| #define | _EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val)) |
| #define | __EEPUT(addr, val) eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val)) |
| #define | _EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr)) |
| #define | __EEGET(var, addr) (var) = eeprom_read_byte ((const uint8_t *)(addr)) |
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.
Notes:
| #define __EEGET | ( | var, | |
| addr | |||
| ) | (var) = eeprom_read_byte ((const uint8_t *)(addr)) |
Read a byte from EEPROM. Compatibility define for IAR C.
| #define __EEPUT | ( | addr, | |
| val | |||
| ) | eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val)) |
Write a byte to EEPROM. Compatibility define for IAR C.
| #define _EEGET | ( | var, | |
| addr | |||
| ) | (var) = eeprom_read_byte ((const uint8_t *)(addr)) |
Read a byte from EEPROM. Compatibility define for IAR C.
| #define _EEPUT | ( | addr, | |
| val | |||
| ) | eeprom_write_byte ((uint8_t *)(addr), (uint8_t)(val)) |
Write a byte to EEPROM. Compatibility define for IAR C.
| #define EEMEM __attribute__((__section__(".eeprom"))) |
Attribute expression causing a variable to be allocated within the .eeprom section.
| #define eeprom_busy_wait | ( | ) | do {} while (!eeprom_is_ready()) |
Loops until the eeprom is no longer busy.
| #define eeprom_is_ready | ( | ) |
| void eeprom_read_block | ( | void * | __dst, |
| const void * | __src, | ||
| size_t | __n | ||
| ) |
Read a block of __n bytes from EEPROM address __src to SRAM __dst.
| char eeprom_read_char | ( | const char * | __p | ) |
Read a char from EEPROM address __p.
| double eeprom_read_double | ( | const double * | __p | ) |
Read one double value from EEPROM address __p.
Read one 32-bit double word from EEPROM address __p.
| float eeprom_read_float | ( | const float * | __p | ) |
Read one float value from EEPROM address __p.
Read a signed 16-bit integer from EEPROM address __p.
Read a signed 24-bit integer from EEPROM address __p.
Read a signed 32-bit integer from EEPROM address __p.
Read a signed 64-bit integer from EEPROM address __p.
Read a signed 8-bit integer from EEPROM address __p.
| long double eeprom_read_long_double | ( | const long double * | __p | ) |
Read one long double value from EEPROM address __p.
Read one 64-bit quad word from EEPROM address __p.
Read an unsigned 16-bit integer from EEPROM address __p.
Read an unsigned 24-bit integer from EEPROM address __p.
Read an unsigned 32-bit integer from EEPROM address __p.
Read an unsigned 64-bit integer from EEPROM address __p.
Read an unsigned 8-bit integer from EEPROM address __p.
| void eeprom_update_block | ( | const void * | __src, |
| void * | __dst, | ||
| size_t | __n | ||
| ) |
Update a block of __n bytes at EEPROM address __dst from __src.
Update a byte __value at EEPROM address __p.
| void eeprom_update_char | ( | char * | __p, |
| char | __value | ||
| ) |
Update a char at EEPROM address __p.
| void eeprom_update_double | ( | double * | __p, |
| double | __value | ||
| ) |
Update a double __value at EEPROM address __p.
Update a 32-bit double word __value at EEPROM address __p.
| void eeprom_update_float | ( | float * | __p, |
| float | __value | ||
| ) |
Update a float __value at EEPROM address __p.
Update a signed 16-bit integer at EEPROM address __p.
Update a signed 24-bit integer at EEPROM address __p.
Update a signed 32-bit integer at EEPROM address __p.
Update a signed 64-bit integer at EEPROM address __p.
Update a signed 8-bit integer at EEPROM address __p.
| void eeprom_update_long_double | ( | long double * | __p, |
| long double | __value | ||
| ) |
Update a long double __value at EEPROM address __p.
Update a 64-bit quad word __value at EEPROM address __p.
Update an unsigned 16-bit integer at EEPROM address __p.
Update an unsigned 24-bit integer at EEPROM address __p.
Update an unsigned 32-bit integer at EEPROM address __p.
Update an unsigned 64-bit integer at EEPROM address __p.
Update an unsigned 8-bit integer at EEPROM address __p.
Update a word __value at EEPROM address __p.
| void eeprom_write_block | ( | const void * | __src, |
| void * | __dst, | ||
| size_t | __n | ||
| ) |
Write a block of __n bytes to EEPROM address __dst from __src.
Write a byte __value to EEPROM address __p.
| void eeprom_write_char | ( | char * | __p, |
| char | __value | ||
| ) |
Write a char to EEPROM address __p.
| void eeprom_write_double | ( | double * | __p, |
| double | __value | ||
| ) |
Write a double __value to EEPROM address __p.
Write a 32-bit double word __value to EEPROM address __p.
| void eeprom_write_float | ( | float * | __p, |
| float | __value | ||
| ) |
Write a float __value to EEPROM address __p.
Write a signed 16-bit integer to EEPROM address __p.
Write a signed 24-bit integer to EEPROM address __p.
Write a signed 32-bit integer to EEPROM address __p.
Write a signed 64-bit integer to EEPROM address __p.
Write a signed 8-bit integer to EEPROM address __p.
| void eeprom_write_long_double | ( | long double * | __p, |
| long double | __value | ||
| ) |
Write a long double __value to EEPROM address __p.
Write a 64-bit quad word __value to EEPROM address __p.
Write an unsigned 16-bit integer to EEPROM address __p.
Write an unsigned 24-bit integer to EEPROM address __p.
Write an unsigned 32-bit integer to EEPROM address __p.
Write an unsigned 64-bit integer to EEPROM address __p.
Write an unsigned 8-bit integer to EEPROM address __p.
1.9.6