Class Ft23xxSpiBus
Represents an SPI bus implementation using the FT23xx device.
Assembly: Ft232h.dll
View Source
public sealed class Ft23xxSpiBus : ISpiBus, IDisposable
Implements:
Meadow.Hardware.ISpiBus
, System.IDisposable
Properties
Handle
Gets the handle to the FT23xx device used by the SPI bus.
View Source
public IntPtr Handle { get; }
GpioDirectionMask
Gets or sets the GPIO direction mask for the FT232 device.
View Source
public byte GpioDirectionMask { get; set; }
GpioState
Gets or sets the state of the GPIO pins on the FT232 device.
View Source
public byte GpioState { get; set; }
SupportedSpeeds
Gets an array of all supported speeds of the SPI bus.
View Source
public Frequency[] SupportedSpeeds { get; }
Configuration
Gets the current SPI clock configuration.
View Source
public SpiClockConfiguration Configuration { get; }
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Exchange(IDigitalOutputPort?, Span<byte>, Span<byte>, ChipSelectMode)
Writes data from the write buffer to a peripheral on the bus while reading return data into the read buffer.
View Source
public void Exchange(IDigitalOutputPort? chipSelect, Span<byte> writeBuffer, Span<byte> readBuffer, ChipSelectMode csMode)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IDigitalOutputPort | chipSelect | The chip select port to activate the peripheral. |
System.Span<System.Byte> | writeBuffer | The buffer containing data to write. |
System.Span<System.Byte> | readBuffer | The buffer to read returning data into. |
Meadow.Hardware.ChipSelectMode | csMode | The chip select mode that activates the peripheral. |
Read(IDigitalOutputPort?, Span<byte>, ChipSelectMode)
Reads data from the SPI bus into the specified buffer.
View Source
public void Read(IDigitalOutputPort? chipSelect, Span<byte> readBuffer, ChipSelectMode csMode)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IDigitalOutputPort | chipSelect | The chip select port to activate the bus. |
System.Span<System.Byte> | readBuffer | The buffer to read data into. |
Meadow.Hardware.ChipSelectMode | csMode | The chip select mode that activates the peripheral. |
Write(IDigitalOutputPort?, Span<byte>, ChipSelectMode)
Writes data to the SPI bus.
View Source
public void Write(IDigitalOutputPort? chipSelect, Span<byte> writeBuffer, ChipSelectMode csMode)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IDigitalOutputPort | chipSelect | The chip select port to activate the peripheral. |
System.Span<System.Byte> | writeBuffer | The buffer containing data to write. |
Meadow.Hardware.ChipSelectMode | csMode | The chip select mode that activates the peripheral. |
Implements
Meadow.Hardware.ISpiBus
System.IDisposable