Ubuntu Manpages

avr_pgmspace

<avr/pgmspace.h>: Program Space Utilities


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


char * strtok_P (char *s, PGM_P delim)

#include <avr/io.h>
#include <avr/pgmspace.h>

The functions in this module provide interfaces for a program to access data stored in program space (flash memory) of the device. In order to use these functions, the target device must support either the LPM or ELPM instructions.

Note:

These functions are an attempt to provide some compatibility with header files that come with IAR C, to make porting applications between different compilers easier. This is not 100% compatibility though (GCC does not have full support for multiple address spaces yet).

If you are working with strings which are completely based in ram, use the standard string functions described in <string.h>: Strings.

If possible, put your constant tables in the lower 64 KB and use pgm_read_byte_near() or pgm_read_word_near() instead of pgm_read_byte_far() or pgm_read_word_far() since it is more efficient that way, and you can still use the upper 64K for executable code. All functions that are suffixed with a _P require their arguments to be in the lower 64 KB of the flash ROM, as they do not use ELPM instructions. This is normally not a big concern as the linker setup arranges any program space constants declared using the macros from this header file so they are placed right after the interrupt vectors, and in front of any executable code. However, it can become a problem if there are too many of these constants, or for bootloaders on devices with more than 64 KB of ROM. All these functions will not work in that situation.

For Xmega devices, make sure the NVM controller command register (NVM.CMD or NVM_CMD) is set to 0x00 (NOP) before using any of these functions.

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

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.

Read a byte from the program space with a 32-bit (far) address.

Note:

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

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.

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.

Read a double word from the program space with a 32-bit (far) address.

Note:

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

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.

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.

Read a float from the program space with a 32-bit (far) address.

Note:

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

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.

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

Note:

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

Read a pointer from the program space with a 32-bit (far) address.

Note:

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

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

Note:

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

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.

Read a word from the program space with a 32-bit (far) address.

Note:

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

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.

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

Attribute to use in order to declare an object being located in flash ROM.

Used to declare a static pointer to a string in program space.

prog_char

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of a 'char' object located in flash ROM.

prog_int16_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'int16_t' object located in flash ROM.

prog_int32_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'int32_t' object located in flash ROM.

prog_int64_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'int64_t' object located in flash ROM.

Note:

This type is not available when the compiler option -mint8 is in effect.

prog_int8_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'int8_t' object located in flash ROM.

prog_uchar

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'unsigned char' object located in flash ROM.

prog_uint16_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'uint16_t' object located in flash ROM.

prog_uint32_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'uint32_t' object located in flash ROM.

prog_uint64_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'uint64_t' object located in flash ROM.

Note:

This type is not available when the compiler option -mint8 is in effect.

prog_uint8_t

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of an 'uint8_t' object located in flash ROM.

prog_void

Note:

DEPRECATED

This typedef is now deprecated because the usage of the progmem attribute on a type is not supported in GCC. However, the use of the progmem attribute on a variable declaration is supported, and this is now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)

Type of a 'void' object located in flash ROM. Does not make much sense by itself, but can be used to declare a 'void *' object in flash ROM.

Parses the string into tokens. strtok_P() parses the string s into tokens. The first call to strtok_P() should have s as its first argument. Subsequent calls should have the first argument set to NULL. If a token ends with a delimiter, this delimiting character is overwritten with a '\0' and a pointer to the next character is saved for the next call to strtok_P(). The delimiter string delim may be different for each call.

The strtok_P() function is similar to strtok() except that delim is pointer to a string in program space.

Returns:

The strtok_P() function returns a pointer to the next token or NULL when no more tokens are found.

Note:

strtok_P() is NOT reentrant. For a reentrant version of this function see strtok_rP().

Generated automatically by Doxygen for avr-libc from the source code.