Skip to main content

SpiDevice Class

Namespace: System.Device.Spi · Assembly: GHIElectronics.TinyCLR.System.Device.Spi

.NET-style SPI device. Standard surface (Read / Write / TransferFullDuplex); internally TinyCLR routes calls through GHIElectronics.TinyCLR.Devices.Spi.SpiController.

public abstract class SpiDevice : IDisposable

Properties

ConnectionSettings

public abstract SpiConnectionSettings ConnectionSettings { get; }

The per-device bus settings (clock, mode, chip select, etc.). (inherited)

Methods

Create(SpiConnectionSettings settings)

public static SpiDevice Create(SpiConnectionSettings settings)

Creates a WebRequest . (inherited)

ParameterTypeDescription
settingsSpiConnectionSettings

Returns SpiDevice

Read(byte[] buffer)

public abstract void Read(byte[] buffer)

Read the data from internal buffer (inherited)

ParameterTypeDescription
bufferbyte[]

Write(byte[] buffer)

public abstract void Write(byte[] buffer)

Write a fileinfo or directoryinfo to the socket (inherited)

ParameterTypeDescription
bufferbyte[]

TransferFullDuplex(byte[] writeBuffer, byte[] readBuffer)

public abstract void TransferFullDuplex(byte[] writeBuffer, byte[] readBuffer)

Writes and reads simultaneously; both buffers must be the same length. (inherited)

ParameterTypeDescription
writeBufferbyte[]Bytes to transmit.
readBufferbyte[]Receives the bytes shifted in.

Dispose()

public abstract void Dispose()

Releases buffered memory (the unmanaged firmware/application buffers). (inherited)