[Overview][Resource strings][Constants][Types][Classes][Index] Reference for unit 'fpspi' (#pascalio)

TSPIDevice.ReadAndWrite

Bidirectional read and write

Declaration

Source position: fpspi.pas line 78

public procedure TSPIDevice.ReadAndWrite(

  const aWriteBuffer;

  aWriteCount: LongInt;

  var aReadBuffer;

  aReadCount: LongInt

); virtual; abstract;

Arguments

aWriteBuffer

  

Data written to the bus

aWriteCount

  

Count of bytes in buffer

aReadBuffer

  

Data received from the bus

aReadCount

  

Maximum bytes read

Description

This method allows simultanous read and write acces to the SPI bus.

The buffer sizes may not be equal. If the write buffer is the smaller one, all futher bytes will be filled with zeroes. If the read buffer is the smaller one, more bytes may be read from the device but will not be reported back to the caller.

Remark: Please check your SPI device's manual, if this behaviour is supported. Otherwise provide read and write buffers with the same length and handle them in your application's code.

Documentation generated on: 2020-05-22