SPI Packet/buffer interface for sending data over an SPI bus. This interface provides a split-phase send command which can be used for sending, receiving or both. It is a "send" command because reading from the SPI requires writing bytes. The send call allows NULL parameters for receive or send only operations. This interface is for buffer based transfers where the microcontroller is the master (clocking) device. Often, an SPI bus must first be acquired using a Resource interface before sending commands with SPIPacket. In the case of multiple devices attached to a single SPI bus, chip select pins are often also used.
txBuf
- A pointer to the buffer to send over the bus. If this
parameter is NULL, then the SPI will send zeroes.
rxBuf
- A pointer to the buffer where received data should
be stored. If this parameter is NULL, then the SPI will
discard incoming bytes.
len
- Length of the message. Note that non-NULL rxBuf and txBuf
parameters must be AT LEAST as large as len, or the SPI
will overflow a buffer.
txBuf
- The buffer used for transmission
rxBuf
- The buffer used for reception
len
- The request length of the transfer, but not necessarily
the number of bytes that were actually transferred
error
- SUCCESS if the operation completed successfully, FAIL
otherwise