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
Type | Name | Description |
---|---|---|
System.Int32 | busNumber | The bus number |
Meadow.Hardware.I2cBusSpeed | busSpeed | The 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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin[] | pins | An array of two pins holding the I2C clock and data pins |
Meadow.Hardware.I2cBusSpeed | busSpeed | The 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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | clock | The I2C clock pin |
Meadow.Hardware.IPin | data | The I2C data pin |
Meadow.Hardware.I2cBusSpeed | busSpeed | The bus speed |