8.5.11 pgm_read_ptr Macro

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

Include

<avr/pgmspace.h>

Prototype

void * pgm_read_ptr(unsigned int);

Remarks

Read a 16-bit generic pointer from the program space with a 16-bit (near) address.

Example

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