Detailed Description
On devices with a Harvard architecture, the program memory (typically flash) and data memory are in separate address spaces. In order to allow optimization of constant data storage, these devices often allow accessing data stored in program space through special instructions.
This module provides mechanisms for defining data stored in program space, and for accessing this data. On Von Neumann architecture devices, these attributes and functions have no effect.
Define Documentation
| #define __progmem __attribute__((__progmem__)) |
Attribute for indicating that a data object is stored in program memory.
This is used on pointers that refer to objects stored in program memory. On Von Neumann architectures, this attribute has no effect.
Definition at line 134 of file progmem.h.
Attribute for indicating that a pointer argument points into program memory rather than data memory.
This is used on pointers that refer to objects stored in program memory. On Von Neumann architectures, this attribute has no effect.
Definition at line 135 of file progmem.h.
| #define DECLARE_PROGMEM |
( |
type, |
|
|
name |
|
) |
const type name __progmem |
Declare a variable stored in program memory.
This macro will ensure that the correct pragmas, attributes, extended keywords, etc. are inserted in the correct place, depending on the compiler.
Definition at line 136 of file progmem.h.
| #define DEFINE_PROGMEM |
( |
type, |
|
|
name |
|
) |
const type name __progmem |
Define a variable stored in program memory.
This macro will ensure that the correct pragmas, attributes, extended keywords, etc. are inserted in the correct place, depending on the compiler. The macro invocation may be followed by '=', followed by the initializer, if necessary.
Definition at line 137 of file progmem.h.
Function Documentation
Read a 16-bit word stored at address p in program memory.
Definition at line 143 of file progmem.h.
Read a 32-bit word stored at address p in program memory.
Definition at line 147 of file progmem.h.
| uint8_t progmem_read8 |
( |
const uint8_t __progmem * |
p |
) |
[inline, static] |
Read a byte stored at address p in program memory.
Definition at line 139 of file progmem.h.