Class Tca9548aBus
Tca9548a I2C bus
Assembly: Tca9548a.dll
View Source
public class Tca9548aBus : II2cBus, IDisposable
Implements:
Meadow.Hardware.II2cBus
, System.IDisposable
Properties
BusSpeed
I2C bus frequency
View Source
public I2cBusSpeed BusSpeed { get; set; }
Methods
WriteData(byte, params byte[])
Write data to the bus
View Source
public void WriteData(byte peripheralAddress, params byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Byte[] | data | Data to write |
Write(byte, Span<byte>)
Write data to the bus
View Source
public void Write(byte peripheralAddress, Span<byte> data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Span<System.Byte> | data | Data to write |
Exchange(byte, Span<byte>, Span<byte>)
Exchange data
View Source
public void Exchange(byte peripheralAddress, Span<byte> writeBuffer, Span<byte> readBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Span<System.Byte> | writeBuffer | Buffer with data to write |
System.Span<System.Byte> | readBuffer | Buffer to receive data |
ReadData(byte, int)
Read data from the I2C bus
View Source
public byte[] ReadData(byte peripheralAddress, int numberOfBytes)
Returns
System.Byte[]
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Int32 | numberOfBytes | Number of bytes to read |
WriteData(byte, Span<byte>, int)
Write data to the bus from a span
View Source
public void WriteData(byte peripheralAddress, Span<byte> data, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Span<System.Byte> | data | Data to write |
System.Int32 | length | Length of data to write |
ExchangeData(byte, Span<byte>, int, Span<byte>, int)
Exchange data
View Source
public void ExchangeData(byte peripheralAddress, Span<byte> writeBuffer, int writeCount, Span<byte> readBuffer, int readCount)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Span<System.Byte> | writeBuffer | Buffer with data to write |
System.Int32 | writeCount | Number of bytes to write |
System.Span<System.Byte> | readBuffer | Buffer to receive data |
System.Int32 | readCount | Number of bytes to read |
Dispose()
Dispose
View Source
public void Dispose()
Read(byte, Span<byte>)
Read data from the bus
View Source
public void Read(byte peripheralAddress, Span<byte> readBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | peripheralAddress | Device address |
System.Span<System.Byte> | readBuffer | Buffer to receive data |
Implements
Meadow.Hardware.II2cBus
System.IDisposable