8.5.14 pgm_read_word Macro

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

Include

<avr/pgmspace.h>

Prototype

unsigned int pgm_read_word(unsigned int);

Remarks

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

Example

#include <avr/pgmspace.h>
const unsigned int PROGMEM romObj = 0x55;
int main(void)
{
  unsigned int val;
  val = pgm_read_word(&romObj);
}