ZBasic System Library
The SPI channel number (1-4).
The number of bytes to write (0 65535).
If the specified channel is valid and is open, this subroutine modifies the state of the SPI interface
according to the bits that are on in the flags parameter as described below. If multiple bits are on in the
flags parameter they are processed in order from most significant to least significant.
Flag Parameter Action Bits
xx xx xx x1
Deinitialize the SPI controller associated with the channel (ignored for
a software channel).
xx xx xx 1x
Deassert the chip select pin associated with the channel.
For compatiblility with future enhancements the unused bits in the flags parameter should always be zero.
Note that this is a low level routine that must be used in concert with other low level routines to effect an
SPI bus transaction.
Call OpenSPI(1, 0, 12)
Call SPIStop(1, &H03)
In this example idata is not initialized before calling SPICmd(). If your SPI device needs specific data
written to it during the read phase, idata would need to be initialized before the call.
This routine is not available in BasicX compatibility mode nor it is available for VM devices.