Skip to main content

Interface II2cController

Contract for devices that expose an II2cBus.

Assembly: Meadow.Contracts.dll
View Source
public interface II2cController : IPinController

Fields

DefaultI2cBusSpeed

The default I2C Bus speed used when speed parameters are not provided

View Source
public static I2cBusSpeed DefaultI2cBusSpeed

Methods

CreateI2cBus(int, I2cBusSpeed)

Creates an I2C bus instance for the default pins and the requested bus speed

View Source
II2cBus CreateI2cBus(int busNumber = 1, I2cBusSpeed busSpeed = I2cBusSpeed.Standard)
Returns

Meadow.Hardware.II2cBus: An instance of an I2cBus

Parameters
TypeNameDescription
System.Int32busNumberThe bus number
Meadow.Hardware.I2cBusSpeedbusSpeedThe bus speed

CreateI2cBus(IPin[], I2cBusSpeed)

Creates an I2C bus instance for the requested pins and bus speed

View Source
II2cBus CreateI2cBus(IPin[] pins, I2cBusSpeed busSpeed)
Returns

Meadow.Hardware.II2cBus: An instance of an I2cBus

Parameters
TypeNameDescription
Meadow.Hardware.IPin[]pinsAn array of two pins holding the I2C clock and data pins
Meadow.Hardware.I2cBusSpeedbusSpeedThe bus speed

CreateI2cBus(IPin, IPin, I2cBusSpeed)

Creates an I2C bus instance for the requested pins and bus speed

View Source
II2cBus CreateI2cBus(IPin clock, IPin data, I2cBusSpeed busSpeed)
Returns

Meadow.Hardware.II2cBus: An instance of an I2cBus

Parameters
TypeNameDescription
Meadow.Hardware.IPinclockThe I2C clock pin
Meadow.Hardware.IPindataThe I2C data pin
Meadow.Hardware.I2cBusSpeedbusSpeedThe bus speed