Class FtdiExpander.I2CBus
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 bus clock speed.
View Source
Declaration
public I2cBusSpeed BusSpeed { get; set; }
Fields
_expander
View Source
Declaration
protected readonly FtdiExpander _expander
MaskGpio
View Source
Declaration
protected const byte MaskGpio = 248
Methods
Wait(int)
View Source
Declaration
protected void Wait(int spinCount)
Parameters
Type | Name |
---|---|
System.Int32 | spinCount |
Write(byte, Span<byte>)
Writes a number of bytes to the bus.
View Source
Declaration
public void Write(byte peripheralAddress, Span<byte> writeBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | The address of the I2C peripheral. |
System.Span<System.Byte> | writeBuffer | The data to be written. |
Write(byte, Span<byte>, bool)
View Source
Declaration
public void Write(byte peripheralAddress, Span<byte> writeBuffer, bool terminatingStop)
Parameters
Type | Name |
---|---|
System.Byte | peripheralAddress |
System.Span<System.Byte> | writeBuffer |
System.Boolean | terminatingStop |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
Declaration
public void Dispose()
Exchange(byte, Span<byte>, Span<byte>)
Writes data from the write buffer to a peripheral on the bus, then resets the bus and reads the return data into the read buffer.
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 I2C peripheral. |
System.Span<System.Byte> | writeBuffer | The buffer to read data from. |
System.Span<System.Byte> | readBuffer | The buffer to read returning data into. |
Read(byte, Span<byte>)
Reads bytes from a peripheral.
View Source
Declaration
public void Read(byte peripheralAddress, Span<byte> readBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | The I2C address to read. |
System.Span<System.Byte> | readBuffer | The buffer used for data reception. |
Implements
Meadow.Hardware.II2cBus
System.IDisposable