8.5.12 pgm_read_ptr_far Macro

Read a pointer from the program space with a far address.

Include

<avr/pgmspace.h>

Prototype

void * pgm_read_byte_far(unsigned long int);

Remarks

Read a 16-bit generic pointer from the program space with a 32-bit (far) address. These functions use the elpm instruction, and so can access any address in program memory

Example

#include <avr/pgmspace.h>
unsigned int input;
const unsigned int PROGMEM * romPtr = &input;
int main(void)
{
  unsigned int * val;
  val = pgm_read_ptr_far(&romPtr);
}