SPI transfer is based on a simultaneous send and recieve: the received data is returned in receivedVal. In case of buffer transfer the received data is stored in the buffer in-place (the old data is replaced with the data received)
receivedVal = SPI.transfer(val)
the byte to send out over the bus.
the received data
receivedVal16 = SPI.transfer16(val16)
the two bytes variable to send out over the bus.
the received data (two bytes)
the array of data to be transferred.
size of the data to be transferred.