Specifications

Built-in function peek():
The STM32W108xB chips use a 32-bit architecture, so the signature for the peek() function has
changed to accommodate the larger address space and the potential for return values of different sizes.
The new function signature is:
peek(addrHi, addrLow, word)
The addrHi and addrLow parameters are 16-bit values. The word parameter determines the size and
character of the return value, with the following options valid:
word = 0: return value is one byte, in the range 0 to 255 (0x00 to 0xFF).
word = 1: return value is one 16-bit signed integer, in the range -32768 to 32767 (0x0000 to
0xFFFF).
word = 2: peeks a 32-bit value, returning the high value and preserving the low value, which
can be subsequently retrieved with a peek of the same address using word = 4, or with a simple
peek() command with no parameters. The return value is in the range -32768 to 32767 (0x0000
to 0xFFFF).
word = 3: peeks a 32-bit value, returning the low value and discarding the high value. The
return value is in the range -32768 to 32767 (0x0000 to 0xFFFF).
word = 4: performs no peek, but returns the value previously stored when a peek with word = 2
was performed. If no peek with word = 2 has been performed, the result of this function is
undefined. Each new peek with word = 2 replaces the previous stored value; there is no
stacking or queueing of results. The return value is in the range -32768 to 32767 (0x0000 to
0xFFFF).
Using peek() with no parameters is a shortcut for performing the peek with word = 4. The return value
is in the range -32768 to 32767 (0x0000 to 0xFFFF).
Peeks that return values larger than one byte must be appropriately word-aligned. In other words, the
addrLow value must be even for a peek of a 16-bit value, and must be a multiple of 4 for any of the
32-bit result peeks. If you are not appropriately word-aligned, the result of your peek is undefined.
Page 190 of 202 SNAP Reference Manual Document Number 600-0007K