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)
| Parameter | Type | Description |
|---|---|---|
settings | SpiConnectionSettings |
Returns SpiDevice
Read(byte[] buffer)
public abstract void Read(byte[] buffer)
Read the data from internal buffer (inherited)
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] |
Write(byte[] buffer)
public abstract void Write(byte[] buffer)
Write a fileinfo or directoryinfo to the socket (inherited)
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] |
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)
| Parameter | Type | Description |
|---|---|---|
writeBuffer | byte[] | Bytes to transmit. |
readBuffer | byte[] | Receives the bytes shifted in. |
Dispose()
public abstract void Dispose()
Releases buffered memory (the unmanaged firmware/application buffers). (inherited)