Skip to main content

ISpiControllerProvider Interface

Namespace: GHIElectronics.TinyCLR.Devices.Spi.Provider · Assembly: GHIElectronics.TinyCLR.Devices.Spi

Provider contract for an SPI controller.

public interface ISpiControllerProvider : IDisposable

Properties

ChipSelectLineCount

int ChipSelectLineCount { get; }

Number of hardware chip-select lines exposed by this controller.

MinClockFrequency

int MinClockFrequency { get; }

Minimum SCK frequency in Hz.

MaxClockFrequency

int MaxClockFrequency { get; }

Maximum SCK frequency in Hz.

SupportedDataBitLengths

int[] SupportedDataBitLengths { get; }

Supported frame widths in bits.

Methods

SetActiveSettings(SpiConnectionSettings connectionSettings)

void SetActiveSettings(SpiConnectionSettings connectionSettings)

Applies the given settings before the next transfer.

ParameterTypeDescription
connectionSettingsSpiConnectionSettingsPer-device configuration.

Write(byte[] writeBuffer, int xOffset, int yOffset, int width, int height, int originalWidth, int columnMultiplier, int rowMultiplier)

void Write(byte[] writeBuffer, int xOffset, int yOffset, int width, int height, int originalWidth, int columnMultiplier, int rowMultiplier)

Writes a rectangular framebuffer region with optional pixel replication.

ParameterTypeDescription
writeBufferbyte[]
xOffsetint
yOffsetint
widthint
heightint
originalWidthint
columnMultiplierint
rowMultiplierint

WriteRead(byte[] writeBuffer, int writeOffset, int writeLength, byte[] readBuffer, int readOffset, int readLength, bool deselectAfter)

void WriteRead(byte[] writeBuffer, int writeOffset, int writeLength, byte[] readBuffer, int readOffset, int readLength, bool deselectAfter)

Performs a full-duplex transfer.

ParameterTypeDescription
writeBufferbyte[]Bytes to transmit, or null for read-only.
writeOffsetintStarting offset within writeBuffer.
writeLengthintNumber of bytes to transmit.
readBufferbyte[]Destination buffer for received bytes, or null to discard.
readOffsetintStarting offset within readBuffer.
readLengthintNumber of bytes to receive.
deselectAfterboolIf false, leaves chip-select asserted after the transfer (for sequential read-after-write).