Skip to content

TMiletusRaspberryMemoryBuffer

TMiletusRaspberryMemoryBuffer is a class to read from and write to a memory buffer at shell application level. Large amounts of data that would be unnecessary to transfer between the web application and the native shell application can be stored here and used with SPI directly.

Property Description
LoadFromFile(AFileName: string) Load a file from the local file system into the memory buffer.
SaveToFile(AFileName: string) Save the contents of the memory buffer into a file on the local file system.
ReadBuffer(var ABuffer: TBytes; ALength: Integer; APosition: Integer = 0) Read from the memory buffer.
WriteBuffer(ABuffer: TBytes; ALength: Integer; APosition: Integer = 0) Write ABuffer to the memory buffer.
Clear Clear the contents of the memory buffer.

GPIO Methods

GPIO stands for General Purpose Input/Output. It's a standard interface used to connect microcontrollers to other electronic devices. With the following methods the GPIO pins on the Raspberry PI can be configured as input or output, read from and written to.

Property Description
GPIOConfig(AGPIOPin: Integer; AMode: TMiletusRaspberryGPIOMode): TJSPromise Configure a pin to a read or write pin. Resolves to an Integer
GPIOWrite(AGPIOPin: Integer; AValue: Integer): TJSPromise Write a value (0 or 1) to the given pin. Resolves to an Integer
GPIORead(AGPIOPin: Integer): TJSPromise Read the value from the given pin. Resolves to an Integer