|
FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Defines API to handle flash memory storage. More...
Classes | |
| class | FlashReader |
| Functor reading items from an address in AVR Flash memory (PROGMEM). More... | |
Functions | |
| template<typename T = uint8_t> | |
| T * | read_flash (uint16_t address, T *buffer, uint8_t size) |
Read flash memory content at given address into buffer. More... | |
| template<typename T > | |
| T & | read_flash (uint16_t address, T &item) |
Read flash memory content at given address into item. More... | |
| template<typename T > | |
| T & | read_flash (const T *address, T &item) |
Read flash memory content at given address into item. More... | |
Defines API to handle flash memory storage.
| T * flash::read_flash | ( | uint16_t | address, |
| T * | buffer, | ||
| uint8_t | size | ||
| ) |
Read flash memory content at given address into buffer.
Note that type T should not have constructors as they will not be properly called by this method.
| T | type of items contained in buffer |
| address | the address to read from flash storage |
| buffer | the array (already allocated by caller) to be copied by flash storage content |
| size | the number of items (of type T) to read from flash storage |
buffer | T & flash::read_flash | ( | uint16_t | address, |
| T & | item | ||
| ) |
Read flash memory content at given address into item.
Note that type T should not have constructors as they will not be properly called by this method.
| T | type of item |
| address | the address to read from flash storage |
| item | the item to read from flash storage |
item | T & flash::read_flash | ( | const T * | address, |
| T & | item | ||
| ) |
Read flash memory content at given address into item.
Note that type T should not have constructors as they will not be properly called by this method. The item should properly be defined in flash storage, as in:
The address of the item in flash storage can then be directly obtained:
| T | type of item |
| address | the address to read from flash storage |
| item | the item to read from flash storage |
item