Skip to main content

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
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Byte[]dataData to write

Write(byte, Span<byte>)

Write data to the bus

View Source
public void Write(byte peripheralAddress, Span<byte> data)
Parameters
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Span<System.Byte>dataData to write

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

Exchange data

View Source
public void Exchange(byte peripheralAddress, Span<byte> writeBuffer, Span<byte> readBuffer)
Parameters
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Span<System.Byte>writeBufferBuffer with data to write
System.Span<System.Byte>readBufferBuffer 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
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Int32numberOfBytesNumber 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
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Span<System.Byte>dataData to write
System.Int32lengthLength 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
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Span<System.Byte>writeBufferBuffer with data to write
System.Int32writeCountNumber of bytes to write
System.Span<System.Byte>readBufferBuffer to receive data
System.Int32readCountNumber 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
TypeNameDescription
System.ByteperipheralAddressDevice address
System.Span<System.Byte>readBufferBuffer to receive data

Implements

  • Meadow.Hardware.II2cBus
  • System.IDisposable