Specifications
SPI Master Emulation
spiInit(cpol, cpha, isMsbFirst, isFourWire)
setup for SPI, with specified Clock Polarity, Clock Phase, Bit
Order, and Physical Interface
spiRead(byteCount, bitsInLastByte)
receive data in from SPI – returns response string (three wire SPI
only)
spiWrite(byteStr, bitsInLastByte)
send data out SPI – bitsInLastByte defaults to 8, can be less
spiXfer(byteStr, bitsInLastByte)
bidirectional SPI transfer – returns response string (four wire SPI
only)
These functions are discussed in section 6 of this document.
Switchboard
crossConnect(dataSrc1, dataSrc2)
Cross-connect SNAP data-sources
uniConnect(dst, src)
Connect src->dst SNAP data-sources
Use crossConnect() to setup bidirectional transfers. Use uniConnect() to setup a one-way connection.
Note that multiple sources can be uni-connected to the same destination.
System
getMs()
System millisecond tick (16bit)
getInfo(which)
Get specified system info
getStat(which)
Get radio traffic status info
call()
Invoke a user-defined binary function
peek(addr)
Read a memory location
poke(addr, byteVal)
Write a memory location
errno()
Read and reset last error code
imageName()
Name of current SNAPpy image
random()
Returns a random number (0-4095)
reboot()
Reboot the device
sleep(mode, ticks)
Enter sleep mode for specified number of ticks
Resolution, accuracy, and maximum duration vary between
hardware platforms. For example, on an RF100 SNAP Engine:
In mode 0, ticks are 1.024 seconds each, +/- 30%
In mode 1, ticks are 1 second each, and can be 0-1073
On some platforms, negative values for ticks produce times shorter
than one second.
Page 84 of 202 SNAP Reference Manual Document Number 600-0007K