Data in Program Space
[Utility Library]

Collaboration diagram for Data in Program Space:

Modules

 Progmem Implementation for 8-bit AVR

Defines

#define __progmem   __attribute__((__progmem__))
 Attribute for indicating that a data object is stored in program memory.
#define __progmem_arg
 Attribute for indicating that a pointer argument points into program memory rather than data memory.
#define DECLARE_PROGMEM(type, name)   const type name __progmem
 Declare a variable stored in program memory.
#define DEFINE_PROGMEM(type, name)   const type name __progmem
 Define a variable stored in program memory.

Functions

static uint8_t progmem_read8 (const uint8_t __progmem *p)
 Read a byte stored at address p in program memory.
static uint16_t progmem_read16 (const uint16_t __progmem *p)
 Read a 16-bit word stored at address p in program memory.
static uint32_t progmem_read32 (const uint32_t __progmem *p)
 Read a 32-bit word stored at address p in program memory.

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.

#define __progmem_arg

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

uint16_t progmem_read16 ( const uint16_t __progmem *  p  )  [inline, static]

Read a 16-bit word stored at address p in program memory.

Definition at line 143 of file progmem.h.

uint32_t progmem_read32 ( const uint32_t __progmem *  p  )  [inline, static]

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.

Generated on Thu Apr 29 14:09:43 2010 for uart-loopback by  doxygen 1.6.3