board/progmem
This is documentation for the progmem integration. Please note that this is just documentation for the interface, different boards might have different caveats for the various procedures.
type Progmem[T] = distinct T
- Type for data stored in program memory, accesing this memory should trigger the correct behaviour for reading this data. If this is not a useful distinction on the selected board it will simply behave as the normal type.
type ProgmemString[size] = Progmem[array[size, char]]
- Special type for strings stored in program memory.
proc pgmReadByte[T](address: ptr T): uint8
- Low level procedure for reading a single byte of program memory
proc pgmReadWord[T](address: ptr T): uint16
- Low level procedure for reading a two-byte word of program memory
proc pgmReadDoubleWord[T](address: ptr T): uint32
- Low level procedure for reading a four-byte double word of program memory
proc memcpyPgm[T](dest: ptr T; src: ptr T; size: csize_t): ptr T
- Low level procedure for reading arbitrary amounts of data from program memory
proc `[]`[T](src: ptr Progmem[T]): T
- Dereference operator for program memory, this will read all the memory indendpented of the size of the underlying type.