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
| Type | Name | Description |
|---|---|---|
System.Int32 | spinCount | The 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
| Type | Name | Description |
|---|---|---|
System.Byte | peripheralAddress | The address of the peripheral device. |
System.Span<System.Byte> | writeBuffer | The 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
| Type | Name | Description |
|---|---|---|
System.Byte | peripheralAddress | The address of the peripheral device. |
System.Span<System.Byte> | writeBuffer | The data buffer to write. |
System.Boolean | terminatingStop | Whether 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
| Type | Name | Description |
|---|---|---|
System.Byte | peripheralAddress | The address of the peripheral device. |
System.Span<System.Byte> | writeBuffer | The data buffer to write. |
System.Span<System.Byte> | readBuffer | The 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
| Type | Name | Description |
|---|---|---|
System.Byte | peripheralAddress | The address of the peripheral device. |
System.Span<System.Byte> | readBuffer | The data buffer to read. |
Implements
Meadow.Hardware.II2cBusSystem.IDisposable