Start Back Next End
  
ZBasic System Library
301
ZBasic Microcontrollers
SPIPutByte
Type
Function returning Byte
Invocation
SPIPutByte(channel, data)
Parameter
Method
Type
Description
channel
ByVal
Byte
The SPI channel number (1-4).
data
ByVal
Byte
The variable containing the data to write to the slave.
Discussion
This function sends a byte of data to an SPI slave and returns the value sent back by the SPI slave.  If the
channel number is invalid or the channel is not properly prepared, the return value is zero.   Note that this
is a low level function that must be used in concert with other low level routines to effect an SPI bus
transaction.
Example
Dim b as Byte
Call OpenSPI(1, 0, 12)
Call SPIStart(1, &H03)
b = SPIPutByte(1, &H23)
Compatibility
This routine is not available in BasicX compatibility mode nor it is available for VM devices.
See Also
Previous page Top Next page