Specifications
peekRadio(address) – Read an internal register of the radio
The peekRadio() function allows you to read any location within the radio’s memory space (which on
many SNAP Engines is separate from the processor’s memory space). Parameter address specifies
which memory location to read (0-65535).
This function returns an integer in the range 0-255.
This function is intended for advanced users only.
poke(address, value) or poke(addressHi, addressLow, word, data) or
poke(addressHi, addressLow, word, dataHi, dataLow) – Write to a memory
location
The poke() function allows you to write a byte to a memory location.
On 16-bit platforms, parameter address specifies which memory location to write to, and parameter
value specifies the value (0x00 to 0xFF) to be written.
On 32-bit platforms, the addressLo and addressHigh parameters specify the target memory location.
The word parameter specifies how large the data value is that will be written. For 8- or 16-bit data, a
single data value is required. For 32-bit data, you must provide two data values, each 0x0000 to
0xFFFF:
0 = Poke a single byte (0x00 to 0xFF) into the target memory location.
1 = Poke a 16-bit value (0x0000 to 0xFFFF) into the target memory location.
2 = Poke a 32-bit value (0x00000000 to 0xFFFFFFFF) into the target memory location, with the
data value broken into dataHi and dataLow, each with a range of 0x0000 to 0xFFFF.
On 32-bit systems, you must have a properly aligned address when writing memory larger than one
byte, i.e., when poking a 16-bit value, your address must be even, and when poking a 32-bit value,
your address must be divisible by 4.
This function does not return a value.
On platforms using the 8051 processor, special function registers (SFRs) are available in SNAPpy by
specifying the poke address as -1 * ((SFR_page * 0x100) + SFR_address). For example, if you wanted
to poke value 0x10 to register 0x92 on page 0x0F, you would use:
Poke(-0x0F92, 0x10)
This function is intended for advanced users only.
If you are not careful with this function, you could crash or even “unprogram” your device. Still, if
you know what you are doing, peek() and poke() allow you to take advantage of additional hardware
resources within the device itself (functions not supported by the “core” firmware).
Page 64 of 202 SNAP Reference Manual Document Number 600-0007K