Hi
I've been using the direct implementation of the eeprom_read_* and eeprom_write_* functions.
However, the functions have a strange design/declaration that seems to limit the addresses on which you can read/write, depending on the size of the variable you're reading.
For example, to read a byte:
uint8_t eeprom_read_byte(const uint8_t *addr) __attribute__ ((pure));
With this declaration it seems I can only read bytes up to address 255 (???)
The full declaration of all functions is below:
uint8_t eeprom_read_byte(const uint8_t *addr) __attribute__ ((pure));
uint16_t eeprom_read_word(const uint16_t *addr) __attribute__ ((pure));
uint32_t eeprom_read_dword(const uint32_t *addr) __attribute__ ((pure));
void eeprom_write_byte(uint8_t *addr, uint8_t value);
void eeprom_write_word(uint16_t *addr, uint16_t value);
void eeprom_write_dword(uint32_t *addr, uint32_t value);
(the issue/question applies to read and write functions).
Since the Teensy has 2K of EEPROM, it would make sense that in all declarations the *addr parameter would be declared as uint16_t *addr for all functions.
Do you know why this is not the case? Is it a bug or a limitation??
Thank you in advance for your clarification.
Pedro
I've been using the direct implementation of the eeprom_read_* and eeprom_write_* functions.
However, the functions have a strange design/declaration that seems to limit the addresses on which you can read/write, depending on the size of the variable you're reading.
For example, to read a byte:
uint8_t eeprom_read_byte(const uint8_t *addr) __attribute__ ((pure));
With this declaration it seems I can only read bytes up to address 255 (???)
The full declaration of all functions is below:
uint8_t eeprom_read_byte(const uint8_t *addr) __attribute__ ((pure));
uint16_t eeprom_read_word(const uint16_t *addr) __attribute__ ((pure));
uint32_t eeprom_read_dword(const uint32_t *addr) __attribute__ ((pure));
void eeprom_write_byte(uint8_t *addr, uint8_t value);
void eeprom_write_word(uint16_t *addr, uint16_t value);
void eeprom_write_dword(uint32_t *addr, uint32_t value);
(the issue/question applies to read and write functions).
Since the Teensy has 2K of EEPROM, it would make sense that in all declarations the *addr parameter would be declared as uint16_t *addr for all functions.
Do you know why this is not the case? Is it a bug or a limitation??
Thank you in advance for your clarification.
Pedro