Skip to content

TMiletusRaspberrySPI

The SPI protocol (Serial peripheral interface) uses a 3-wire connection, a clock and the data-in and data-out signal. Other than this, it is similar to I²C, meaning, it also uses an address and reads and writes data serialized over this 2 data wires. Below is a list of available properties, methods and events for TMiletusRaspberrySPI.

Properties for TMiletusRaspberrySPI

Property Description
PortNum: TMiletusRaspiSPIPortNum Select the SPI port. Possible values are spi0 and spi1

Methods for TMiletusRaspberrySPI

Method Description
Open Open the connection
Close Close the connection
ReadTransfer(var ABuffer: TBytes; AWSize, ARSize: Integer) Read a buffer of data
WriteTransfer(ABuffer: TBytes; AWSize: Integer) Write a buffer of data
WriteTransfer(ACommand: SmallInt; ABuffer: TBytes; ADCPin: Integer = -1; ACSPin: Integer = -1) Write ACommand followed by ABuffer. If ADCPin and/or ACSPin is defined, the corresponding GPIO pin(s) will change to low/high: DC low -> CS low -> ACommand -> CS high -> DC high -> CS low -> ABuffer -> CS high.
WriteMemBuffer Write all data from TMiletusRaspberryMemoryBuffer through SPI.

Events for TMiletusRaspberrySPI

Event Description
OnOpen Event triggered when the connection is opened
OnClose Event triggered when the connection is closed