RTEMS CPU Kit with SuperCore  4.11.3
Macros | Typedefs | Functions
Program Space Utilities

Macros

#define __need_size_t
 
#define __ATTR_CONST__   __attribute__((__const__))
 
#define __ATTR_PROGMEM__   __attribute__((__progmem__))
 
#define __ATTR_PURE__   __attribute__((__pure__))
 
#define PROGMEM   __ATTR_PROGMEM__
 Attribute to use in order to declare an object being located in flash ROM.
 
#define PSTR(s)   (__extension__({static char __c[] PROGMEM = (s); &__c[0];}))
 
#define __LPM_classic__(addr)
 
#define __LPM_enhanced__(addr)
 
#define __LPM_word_classic__(addr)
 
#define __LPM_word_enhanced__(addr)
 
#define __LPM_dword_classic__(addr)
 
#define __LPM_dword_enhanced__(addr)
 
#define __LPM_float_classic__(addr)
 
#define __LPM_float_enhanced__(addr)
 
#define __LPM(addr)   __LPM_classic__(addr)
 
#define __LPM_word(addr)   __LPM_word_classic__(addr)
 
#define __LPM_dword(addr)   __LPM_dword_classic__(addr)
 
#define __LPM_float(addr)   __LPM_float_classic__(addr)
 
#define pgm_read_byte_near(address_short)   __LPM((uint16_t)(address_short))
 Read a byte from the program space with a 16-bit (near) address. More...
 
#define pgm_read_word_near(address_short)   __LPM_word((uint16_t)(address_short))
 Read a word from the program space with a 16-bit (near) address. More...
 
#define pgm_read_dword_near(address_short)   __LPM_dword((uint16_t)(address_short))
 Read a double word from the program space with a 16-bit (near) address. More...
 
#define pgm_read_float_near(address_short)   __LPM_float((uint16_t)(address_short))
 Read a float from the program space with a 16-bit (near) address. More...
 
#define pgm_read_byte(address_short)   pgm_read_byte_near(address_short)
 Read a byte from the program space with a 16-bit (near) address. More...
 
#define pgm_read_word(address_short)   pgm_read_word_near(address_short)
 Read a word from the program space with a 16-bit (near) address. More...
 
#define pgm_read_dword(address_short)   pgm_read_dword_near(address_short)
 Read a double word from the program space with a 16-bit (near) address. More...
 
#define pgm_read_float(address_short)   pgm_read_float_near(address_short)
 Read a float from the program space with a 16-bit (near) address. More...
 
#define PGM_P   const prog_char *
 Used to declare a variable that is a pointer to a string in program space. More...
 
#define PGM_VOID_P   const prog_void *
 Used to declare a generic pointer to an object in program space. More...
 

Typedefs

typedef void prog_void PROGMEM
 

Functions

PGM_VOID_P memchr_P (PGM_VOID_P, int __val, size_t __len) __ATTR_CONST__
 
int memcmp_P (const void *, PGM_VOID_P, size_t) __ATTR_PURE__
 
void * memccpy_P (void *, PGM_VOID_P, int __val, size_t)
 
void * memcpy_P (void *, PGM_VOID_P, size_t)
 
void * memmem_P (const void *, size_t, PGM_VOID_P, size_t) __ATTR_PURE__
 
PGM_VOID_P memrchr_P (PGM_VOID_P, int __val, size_t __len) __ATTR_CONST__
 
char * strcat_P (char *, PGM_P)
 
PGM_P strchr_P (PGM_P, int __val) __ATTR_CONST__
 
PGM_P strchrnul_P (PGM_P, int __val) __ATTR_CONST__
 
int strcmp_P (const char *, PGM_P) __ATTR_PURE__
 
char * strcpy_P (char *, PGM_P)
 
int strcasecmp_P (const char *, PGM_P) __ATTR_PURE__
 
char * strcasestr_P (const char *, PGM_P) __ATTR_PURE__
 
size_t strcspn_P (const char *__s, PGM_P __reject) __ATTR_PURE__
 
size_t strlcat_P (char *, PGM_P, size_t)
 
size_t strlcpy_P (char *, PGM_P, size_t)
 
size_t strlen_P (PGM_P) __ATTR_CONST__
 
size_t strnlen_P (PGM_P, size_t) __ATTR_CONST__
 
int strncmp_P (const char *, PGM_P, size_t) __ATTR_PURE__
 
int strncasecmp_P (const char *, PGM_P, size_t) __ATTR_PURE__
 
char * strncat_P (char *, PGM_P, size_t)
 
char * strncpy_P (char *, PGM_P, size_t)
 
char * strpbrk_P (const char *__s, PGM_P __accept) __ATTR_PURE__
 
PGM_P strrchr_P (PGM_P, int __val) __ATTR_CONST__
 
char * strsep_P (char **__sp, PGM_P __delim)
 
size_t strspn_P (const char *__s, PGM_P __accept) __ATTR_PURE__
 
char * strstr_P (const char *, PGM_P) __ATTR_PURE__
 
char * strtok_P (char *__s, PGM_P __delim)
 
char * strtok_rP (char *__s, PGM_P __delim, char **__last)
 

Detailed Description

Macro Definition Documentation

◆ __LPM_classic__

#define __LPM_classic__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint8_t __result; \
__asm__ \
( \
"lpm" "\n\t" \
"mov %0, r0" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
: "r0" \
); \
__result; \
}))

◆ __LPM_dword_classic__

#define __LPM_dword_classic__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint32_t __result; \
__asm__ \
( \
"lpm" "\n\t" \
"mov %A0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %B0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %C0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %D0, r0" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
: "r0" \
); \
__result; \
}))

◆ __LPM_dword_enhanced__

#define __LPM_dword_enhanced__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint32_t __result; \
__asm__ \
( \
"lpm %A0, Z+" "\n\t" \
"lpm %B0, Z+" "\n\t" \
"lpm %C0, Z+" "\n\t" \
"lpm %D0, Z" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
); \
__result; \
}))

◆ __LPM_enhanced__

#define __LPM_enhanced__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint8_t __result; \
__asm__ \
( \
"lpm %0, Z" "\n\t" \
: "=r" (__result) \
: "z" (__addr16) \
); \
__result; \
}))

◆ __LPM_float_classic__

#define __LPM_float_classic__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
float __result; \
__asm__ \
( \
"lpm" "\n\t" \
"mov %A0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %B0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %C0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %D0, r0" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
: "r0" \
); \
__result; \
}))

◆ __LPM_float_enhanced__

#define __LPM_float_enhanced__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
float __result; \
__asm__ \
( \
"lpm %A0, Z+" "\n\t" \
"lpm %B0, Z+" "\n\t" \
"lpm %C0, Z+" "\n\t" \
"lpm %D0, Z" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
); \
__result; \
}))

◆ __LPM_word_classic__

#define __LPM_word_classic__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint16_t __result; \
__asm__ \
( \
"lpm" "\n\t" \
"mov %A0, r0" "\n\t" \
"adiw r30, 1" "\n\t" \
"lpm" "\n\t" \
"mov %B0, r0" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
: "r0" \
); \
__result; \
}))

◆ __LPM_word_enhanced__

#define __LPM_word_enhanced__ (   addr)
Value:
(__extension__({ \
uint16_t __addr16 = (uint16_t)(addr); \
uint16_t __result; \
__asm__ \
( \
"lpm %A0, Z+" "\n\t" \
"lpm %B0, Z" "\n\t" \
: "=r" (__result), "=z" (__addr16) \
: "1" (__addr16) \
); \
__result; \
}))

◆ PGM_P

#define PGM_P   const prog_char *

Used to declare a variable that is a pointer to a string in program space.

◆ pgm_read_byte

#define pgm_read_byte (   address_short)    pgm_read_byte_near(address_short)

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_byte_near

#define pgm_read_byte_near (   address_short)    __LPM((uint16_t)(address_short))

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_dword

#define pgm_read_dword (   address_short)    pgm_read_dword_near(address_short)

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_dword_near

#define pgm_read_dword_near (   address_short)    __LPM_dword((uint16_t)(address_short))

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_float

#define pgm_read_float (   address_short)    pgm_read_float_near(address_short)

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_float_near

#define pgm_read_float_near (   address_short)    __LPM_float((uint16_t)(address_short))

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_word

#define pgm_read_word (   address_short)    pgm_read_word_near(address_short)

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

Note
The address is a byte address. The address is in the program space.

◆ pgm_read_word_near

#define pgm_read_word_near (   address_short)    __LPM_word((uint16_t)(address_short))

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

Note
The address is a byte address. The address is in the program space.

◆ PGM_VOID_P

#define PGM_VOID_P   const prog_void *

Used to declare a generic pointer to an object in program space.