AVR Libc Home Page AVRs AVR Libc Development Pages
Main Page User Manual Library Reference FAQ Alphabetical Index Example Projects

定義 | Typedef | 関数

pgmspace.h File Reference

このファイルのソースコードを参照する

定義

#define __need_size_t
#define __ATTR_PROGMEM__   __attribute__((__progmem__))
#define __ATTR_PURE__   __attribute__((__pure__))
#define PROGMEM   __ATTR_PROGMEM__
#define PSTR(s)   ((const PROGMEM char *)(s))
#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))
#define pgm_read_word_near(address_short)   __LPM_word((uint16_t)(address_short))
#define pgm_read_dword_near(address_short)   __LPM_dword((uint16_t)(address_short))
#define pgm_read_float_near(address_short)   __LPM_float((uint16_t)(address_short))
#define __ELPM_classic__(addr)
#define __ELPM_enhanced__(addr)
#define __ELPM_xmega__(addr)
#define __ELPM_word_classic__(addr)
#define __ELPM_word_enhanced__(addr)
#define __ELPM_word_xmega__(addr)
#define __ELPM_dword_classic__(addr)
#define __ELPM_dword_enhanced__(addr)
#define __ELPM_dword_xmega__(addr)
#define __ELPM_float_classic__(addr)
#define __ELPM_float_enhanced__(addr)
#define __ELPM_float_xmega__(addr)
#define __ELPM(addr)   __ELPM_classic__(addr)
#define __ELPM_word(addr)   __ELPM_word_classic__(addr)
#define __ELPM_dword(addr)   __ELPM_dword_classic__(addr)
#define __ELPM_float(addr)   __ELPM_float_classic__(addr)
#define pgm_read_byte_far(address_long)   __ELPM((uint32_t)(address_long))
#define pgm_read_word_far(address_long)   __ELPM_word((uint32_t)(address_long))
#define pgm_read_dword_far(address_long)   __ELPM_dword((uint32_t)(address_long))
#define pgm_read_float_far(address_long)   __ELPM_float((uint32_t)(address_long))
#define pgm_read_byte(address_short)   pgm_read_byte_near(address_short)
#define pgm_read_word(address_short)   pgm_read_word_near(address_short)
#define pgm_read_dword(address_short)   pgm_read_dword_near(address_short)
#define pgm_read_float(address_short)   pgm_read_float_near(address_short)
#define PGM_P   const prog_char *
#define PGM_VOID_P   const prog_void *
#define pgm_get_far_address(var)

Typedef

typedef void PROGMEM prog_void
typedef char PROGMEM prog_char
typedef unsigned char PROGMEM prog_uchar
typedef int8_t PROGMEM prog_int8_t
typedef uint8_t PROGMEM prog_uint8_t
typedef int16_t PROGMEM prog_int16_t
typedef uint16_t PROGMEM prog_uint16_t
typedef int32_t PROGMEM prog_int32_t
typedef uint32_t PROGMEM prog_uint32_t
typedef int64_t PROGMEM prog_int64_t
typedef uint64_t PROGMEM prog_uint64_t

関数

PGM_VOID_P memchr_P (PGM_VOID_P, int __val, size_t __len)
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)
char * strcat_P (char *, PGM_P)
PGM_P strchr_P (PGM_P, int __val)
PGM_P strchrnul_P (PGM_P, int __val)
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)
size_t strnlen_P (PGM_P, size_t)
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)
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)
size_t strlen_PF (uint_farptr_t src)
size_t strnlen_PF (uint_farptr_t src, size_t len)
void * memcpy_PF (void *dest, uint_farptr_t src, size_t len)
char * strcpy_PF (char *dest, uint_farptr_t src)
char * strncpy_PF (char *dest, uint_farptr_t src, size_t len)
char * strcat_PF (char *dest, uint_farptr_t src)
size_t strlcat_PF (char *dst, uint_farptr_t src, size_t siz)
char * strncat_PF (char *dest, uint_farptr_t src, size_t len)
int strcmp_PF (const char *s1, uint_farptr_t s2) __ATTR_PURE__
int strncmp_PF (const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__
int strcasecmp_PF (const char *s1, uint_farptr_t s2) __ATTR_PURE__
int strncasecmp_PF (const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__
char * strstr_PF (const char *s1, uint_farptr_t s2)
size_t strlcpy_PF (char *dst, uint_farptr_t src, size_t siz)
int memcmp_PF (const void *, uint_farptr_t, size_t) __ATTR_PURE__

詳しい説明


定義ドキュメント

#define __ELPM_classic__ (   addr )
Value:
(__extension__({                    \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint8_t __result;               \
    __asm__                         \
    (                               \
        "out %2, %C1" "\n\t"        \
        "mov r31, %B1" "\n\t"       \
        "mov r30, %A1" "\n\t"       \
        "elpm" "\n\t"               \
        "mov %0, r0" "\n\t"         \
        : "=r" (__result)           \
        : "r" (__addr32),           \
          "I" (_SFR_IO_ADDR(RAMPZ)) \
        : "r0", "r30", "r31"        \
    );                              \
    __result;                       \
}))
#define __ELPM_dword_enhanced__ (   addr )
Value:
(__extension__({                          \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint32_t __result;                    \
    __asm__                               \
    (                                     \
        "out %2, %C1"   "\n\t"            \
        "movw r30, %1"  "\n\t"            \
        "elpm %A0, Z+"  "\n\t"            \
        "elpm %B0, Z+"  "\n\t"            \
        "elpm %C0, Z+"  "\n\t"            \
        "elpm %D0, Z"   "\n\t"            \
        : "=r" (__result)                 \
        : "r" (__addr32),                 \
          "I" (_SFR_IO_ADDR(RAMPZ))       \
        : "r30", "r31"                    \
    );                                    \
    __result;                             \
}))
#define __ELPM_dword_xmega__ (   addr )
Value:
(__extension__({                          \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint32_t __result;                    \
    __asm__                               \
    (                                     \
        "in __tmp_reg__, %2" "\n\t"       \
        "out %2, %C1"   "\n\t"            \
        "movw r30, %1"  "\n\t"            \
        "elpm %A0, Z+"  "\n\t"            \
        "elpm %B0, Z+"  "\n\t"            \
        "elpm %C0, Z+"  "\n\t"            \
        "elpm %D0, Z"   "\n\t"            \
        "out %2, __tmp_reg__"             \
        : "=r" (__result)                 \
        : "r" (__addr32),                 \
          "I" (_SFR_IO_ADDR(RAMPZ))       \
        : "r30", "r31"                    \
    );                                    \
    __result;                             \
}))
#define __ELPM_enhanced__ (   addr )
Value:
(__extension__({                    \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint8_t __result;               \
    __asm__                         \
    (                               \
        "out %2, %C1" "\n\t"        \
        "movw r30, %1" "\n\t"       \
        "elpm %0, Z+" "\n\t"        \
        : "=r" (__result)           \
        : "r" (__addr32),           \
          "I" (_SFR_IO_ADDR(RAMPZ)) \
        : "r30", "r31"              \
    );                              \
    __result;                       \
}))
#define __ELPM_float_enhanced__ (   addr )
Value:
(__extension__({                          \
    uint32_t __addr32 = (uint32_t)(addr); \
    float __result;                       \
    __asm__                               \
    (                                     \
        "out %2, %C1"   "\n\t"            \
        "movw r30, %1"  "\n\t"            \
        "elpm %A0, Z+"  "\n\t"            \
        "elpm %B0, Z+"  "\n\t"            \
        "elpm %C0, Z+"  "\n\t"            \
        "elpm %D0, Z"   "\n\t"            \
        : "=r" (__result)                 \
        : "r" (__addr32),                 \
          "I" (_SFR_IO_ADDR(RAMPZ))       \
        : "r30", "r31"                    \
    );                                    \
    __result;                             \
}))
#define __ELPM_float_xmega__ (   addr )
Value:
(__extension__({                          \
    uint32_t __addr32 = (uint32_t)(addr); \
    float __result;                       \
    __asm__                               \
    (                                     \
        "in __tmp_reg__, %2" "\n\t"       \
        "out %2, %C1"   "\n\t"            \
        "movw r30, %1"  "\n\t"            \
        "elpm %A0, Z+"  "\n\t"            \
        "elpm %B0, Z+"  "\n\t"            \
        "elpm %C0, Z+"  "\n\t"            \
        "elpm %D0, Z"   "\n\t"            \
        "out %2, __tmp_reg__"             \
        : "=r" (__result)                 \
        : "r" (__addr32),                 \
          "I" (_SFR_IO_ADDR(RAMPZ))       \
        : "r30", "r31"                    \
    );                                    \
    __result;                             \
}))
#define __ELPM_word_classic__ (   addr )
Value:
(__extension__({                        \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint16_t __result;                  \
    __asm__                             \
    (                                   \
        "out %2, %C1"   "\n\t"          \
        "mov r31, %B1"  "\n\t"          \
        "mov r30, %A1"  "\n\t"          \
        "elpm"          "\n\t"          \
        "mov %A0, r0"   "\n\t"          \
        "in r0, %2"     "\n\t"          \
        "adiw r30, 1"   "\n\t"          \
        "adc r0, __zero_reg__" "\n\t"   \
        "out %2, r0"    "\n\t"          \
        "elpm"          "\n\t"          \
        "mov %B0, r0"   "\n\t"          \
        : "=r" (__result)               \
        : "r" (__addr32),               \
          "I" (_SFR_IO_ADDR(RAMPZ))     \
        : "r0", "r30", "r31"            \
    );                                  \
    __result;                           \
}))
#define __ELPM_word_enhanced__ (   addr )
Value:
(__extension__({                        \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint16_t __result;                  \
    __asm__                             \
    (                                   \
        "out %2, %C1"   "\n\t"          \
        "movw r30, %1"  "\n\t"          \
        "elpm %A0, Z+"  "\n\t"          \
        "elpm %B0, Z"   "\n\t"          \
        : "=r" (__result)               \
        : "r" (__addr32),               \
          "I" (_SFR_IO_ADDR(RAMPZ))     \
        : "r30", "r31"                  \
    );                                  \
    __result;                           \
}))
#define __ELPM_word_xmega__ (   addr )
Value:
(__extension__({                        \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint16_t __result;                  \
    __asm__                             \
    (                                   \
        "in __tmp_reg__, %2" "\n\t"     \
        "out %2, %C1"   "\n\t"          \
        "movw r30, %1"  "\n\t"          \
        "elpm %A0, Z+"  "\n\t"          \
        "elpm %B0, Z"   "\n\t"          \
        "out %2, __tmp_reg__"           \
        : "=r" (__result)               \
        : "r" (__addr32),               \
          "I" (_SFR_IO_ADDR(RAMPZ))     \
        : "r30", "r31"                  \
    );                                  \
    __result;                           \
}))
#define __ELPM_xmega__ (   addr )
Value:
(__extension__({                    \
    uint32_t __addr32 = (uint32_t)(addr); \
    uint8_t __result;               \
    __asm__                         \
    (                               \
        "in __tmp_reg__, %2" "\n\t" \
        "out %2, %C1" "\n\t"        \
        "movw r30, %1" "\n\t"       \
        "elpm %0, Z+" "\n\t"        \
        "out %2, __tmp_reg__"       \
        : "=r" (__result)           \
        : "r" (__addr32),           \
          "I" (_SFR_IO_ADDR(RAMPZ)) \
        : "r30", "r31"              \
    );                              \
    __result;                       \
}))
#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;                   \
}))
#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;                               \
}))
#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;                               \
}))
#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;                   \
}))
#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;                               \
}))
#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;                               \
}))
#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;                               \
}))
#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;                               \
}))
#define pgm_get_far_address (   var )
Value:
({                                                    \
        uint_farptr_t tmp;                                \
                                                      \
        __asm__ __volatile__(                             \
                                                      \
                        "ldi    %A0, lo8(%1)"           "\n\t"    \
                        "ldi    %B0, hi8(%1)"           "\n\t"    \
                        "ldi    %C0, hh8(%1)"           "\n\t"    \
                        "clr    %D0"                    "\n\t"    \
                :                                             \
                        "=d" (tmp)                                \
                :                                             \
                        "p"  (&(var))                             \
        );                                                \
        tmp;                                              \
})

Automatically generated by Doxygen 1.7.2 on Wed Feb 16 2011.

翻訳更新:2011年10月8日 by cega