FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
flash.h File Reference

Flash memory utilities. More...

#include "boards/io.h"
#include <avr/pgmspace.h>
Include dependency graph for flash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 flash
 Defines API to handle flash memory storage.
 

Macros

#define F(ptr)
 Force string constant to be stored as flash storage. More...
 

Functions

template<typename T >
T & flash::read_flash (uint16_t address, T &item)
 Read flash memory content at given address into item. More...
 
template<typename T >
T & flash::read_flash (const T *address, T &item)
 Read flash memory content at given address into item. More...
 

Detailed Description

Flash memory utilities.

Definition in file flash.h.

Macro Definition Documentation

◆ F

#define F (   ptr)
Value:
(__extension__({ \
static const char __c[] PROGMEM = (ptr); \
(const flash::FlashStorage*) &__c[0]; \
}))

Force string constant to be stored as flash storage.

Here is a classical usage here:

char buffer[64];
streams::ostreambuf out{buffer};
out << F("Hello, world!\n");
Parameters
ptrthe string to be automatically stored on flash
See also
streams::ostreambuf::sputn(const flash::FlashStorage*)

Definition at line 98 of file flash.h.

streams::ostreambuf
Output API based on a ring buffer.
Definition: streambuf.h:46
F
#define F(ptr)
Force string constant to be stored as flash storage.
Definition: flash.h:98