Skip to main content

Class FtdiExpander.I2CBus

Represents an I2C bus for the FTDI expander.

Assembly: Ft2xxx.dll
View Source
Declaration
public abstract class FtdiExpander.I2CBus : II2cBus, IDisposable

Derived:
Meadow.Foundation.ICs.IOExpanders.FtdiExpander.Ft232hI2cBus

Implements:
Meadow.Hardware.II2cBus, System.IDisposable

Properties

BusSpeed

Gets or sets the speed of the I2C bus.

View Source
Declaration
public I2cBusSpeed BusSpeed { get; set; }

Fields

_expander

The FTDI expander instance associated with this I2C bus.

View Source
Declaration
protected readonly FtdiExpander _expander

MaskGpio

Mask for GPIO operations.

View Source
Declaration
protected const byte MaskGpio = 248

Methods

Wait(int)

Waits for a specified number of spin counts.

View Source
Declaration
protected void Wait(int spinCount)
Parameters
TypeNameDescription
System.Int32spinCountThe number of spin counts to wait.

Write(byte, Span<byte>)

Writes data to a peripheral device.

View Source
Declaration
public void Write(byte peripheralAddress, Span<byte> writeBuffer)
Parameters
TypeNameDescription
System.ByteperipheralAddressThe address of the peripheral device.
System.Span<System.Byte>writeBufferThe data buffer to write.

Write(byte, Span<byte>, bool)

Writes data to a peripheral device with an option to send a stop condition.

View Source
Declaration
public void Write(byte peripheralAddress, Span<byte> writeBuffer, bool terminatingStop)
Parameters
TypeNameDescription
System.ByteperipheralAddressThe address of the peripheral device.
System.Span<System.Byte>writeBufferThe data buffer to write.
System.BooleanterminatingStopWhether to send a stop condition after writing.

Dispose()

Releases all resources used by the Meadow.Foundation.ICs.IOExpanders.FtdiExpander.I2CBus.

View Source
Declaration
public void Dispose()

Exchange(byte, Span<byte>, Span<byte>)

Exchanges data with a peripheral device.

View Source
Declaration
public void Exchange(byte peripheralAddress, Span<byte> writeBuffer, Span<byte> readBuffer)
Parameters
TypeNameDescription
System.ByteperipheralAddressThe address of the peripheral device.
System.Span<System.Byte>writeBufferThe data buffer to write.
System.Span<System.Byte>readBufferThe data buffer to read.

Read(byte, Span<byte>)

Reads data from a peripheral device.

View Source
Declaration
public void Read(byte peripheralAddress, Span<byte> readBuffer)
Parameters
TypeNameDescription
System.ByteperipheralAddressThe address of the peripheral device.
System.Span<System.Byte>readBufferThe data buffer to read.

Implements

  • Meadow.Hardware.II2cBus
  • System.IDisposable