I2cDevice I2cDevice I2cDevice I2cDevice I2cDevice Class

Definition

Represents a communications channel to a device on an inter-integrated circuit (I2 C) bus.

public : sealed class I2cDevice : II2cDevice, IClosable
struct winrt::Windows::Devices::I2c::I2cDevice : II2cDevice, IClosable
public sealed class I2cDevice : II2cDevice, IDisposable
Public NotInheritable Class I2cDevice Implements II2cDevice, IDisposable
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows IoT Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Devices.DevicesLowLevelContract (introduced v1)

Remarks

To get an instance of I2cDevice, use the I2cDevice.FromIdAsync method.

Properties

ConnectionSettings ConnectionSettings ConnectionSettings ConnectionSettings ConnectionSettings

Gets the connection settings used for communication with the inter-integrated circuit (I2 C) device.

DeviceId DeviceId DeviceId DeviceId DeviceId

Gets the plug and play device identifier of the inter-integrated circuit (I2 C) bus controller for the device.

Methods

Close() Close() Close() Close() Close()

Closes the connection to the inter-integrated circuit (I2 C) device.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FromIdAsync(String, I2cConnectionSettings) FromIdAsync(String, I2cConnectionSettings) FromIdAsync(String, I2cConnectionSettings) FromIdAsync(String, I2cConnectionSettings) FromIdAsync(String, I2cConnectionSettings)

Retrieves an I2cDevice object asynchronously for the inter-integrated circuit (I2 C) bus controller that has the specified plug and play device identifier, using the specified connection settings.

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Retrieves an Advanced Query Syntax (AQS) string for all of the inter-integrated circuit (I2 C) bus controllers on the system. You can use this string with the DeviceInformation.FindAllAsync method to get DeviceInformation objects for those bus controllers.

GetDeviceSelector(String) GetDeviceSelector(String) GetDeviceSelector(String) GetDeviceSelector(String) GetDeviceSelector(String)

Retrieves an Advanced Query Syntax (AQS) string for the inter-integrated circuit (I2 C) bus that has the specified friendly name. You can use this string with the DeviceInformation.FindAllAsync method to get a DeviceInformation object for that bus.

Read(Byte[]) Read(Byte[]) Read(Byte[]) Read(Byte[]) Read(Byte[])

Reads data from the inter-integrated circuit (I2 C) bus on which the device is connected into the specified buffer.

ReadPartial(Byte[]) ReadPartial(Byte[]) ReadPartial(Byte[]) ReadPartial(Byte[]) ReadPartial(Byte[])

Reads data from the inter-integrated circuit (I2 C) bus on which the device is connected into the specified buffer, and returns information about the success of the operation that you can use for error handling.

Write(Byte[]) Write(Byte[]) Write(Byte[]) Write(Byte[]) Write(Byte[])

Writes data to the inter-integrated circuit (I2 C) bus on which the device is connected, based on the bus address specified in the I2cConnectionSetting s object that you used to create the I2cDevice object.

WritePartial(Byte[]) WritePartial(Byte[]) WritePartial(Byte[]) WritePartial(Byte[]) WritePartial(Byte[])

Writes data to the inter-integrated circuit (I2 C) bus on which the device is connected, and returns information about the success of the operation that you can use for error handling.

WriteRead(Byte[], Byte[]) WriteRead(Byte[], Byte[]) WriteRead(Byte[], Byte[]) WriteRead(Byte[], Byte[]) WriteRead(Byte[], Byte[])

Performs an atomic operation to write data to and then read data from the inter-integrated circuit (I2 C) bus on which the device is connected, and sends a restart condition between the write and read operations.

WriteReadPartial(Byte[], Byte[]) WriteReadPartial(Byte[], Byte[]) WriteReadPartial(Byte[], Byte[]) WriteReadPartial(Byte[], Byte[]) WriteReadPartial(Byte[], Byte[])

Performs an atomic operation to write data to and then read data from the inter-integrated circuit (I2 C) bus on which the device is connected, and returns information about the success of the operation that you can use for error handling.

See Also