Class MpsseI2cBus
Represents an I2C bus implementation using the MPSSE mode of the FT232 device.
Assembly: Ft232h.dll
View Source
public sealed class MpsseI2cBus : II2cBus, IDisposable
Implements:
Meadow.Hardware.II2cBus
, System.IDisposable
Properties
Handle
Gets the handle to the FT232 device.
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; }
BusSpeed
Gets or sets the bus clock speed.
View Source
public I2cBusSpeed BusSpeed { get; set; }
Methods
~MpsseI2cBus()
Finalizer for the MpsseI2cBus class, used to release unmanaged resources.
View Source
protected ~MpsseI2cBus()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
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
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
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. |
Write(byte, Span<byte>)
Writes a number of bytes to the bus.
View Source
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. |
Implements
Meadow.Hardware.II2cBus
System.IDisposable