Characteristic Locus
Inherited Members IDisposable.Dispose()
Namespace Meadow.Hardware
Assembly Meadow.Contracts.dll

Syntax

public interface II2cBus : IDisposable

Properties

BusSpeed

Gets or sets the bus clock speed.

Declaration
I2cBusSpeed BusSpeed { get; set; }

Property Value

Type Description
I2cBusSpeed

Methods

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.

Declaration
void Exchange(byte peripheralAddress, Span<byte> writeBuffer, Span<byte> readBuffer)

Parameters

Type Name Description
byte peripheralAddress

The address of the I2C peripheral.

Span<byte> writeBuffer

The buffer to read data from.

Span<byte> readBuffer

The buffer to read returning data into.

Read(byte, Span<byte>)

Reads bytes from a peripheral.

Declaration
void Read(byte peripheralAddress, Span<byte> readBuffer)

Parameters

Type Name Description
byte peripheralAddress

The I2C address to read.

Span<byte> readBuffer

The buffer used for data reception.

Write(byte, Span<byte>)

Writes a number of bytes to the bus.

Declaration
void Write(byte peripheralAddress, Span<byte> writeBuffer)

Parameters

Type Name Description
byte peripheralAddress

The address of the I2C peripheral.

Span<byte> writeBuffer

The data to be written.