Share via


I2cSharingMode Enum

Definition

Describes the modes in which you can connect to an inter-integrated circuit (I2 C) bus address. These modes determine whether other connections to the I2 C bus address can be opened while you are connected to the I2 C bus address.

public enum class I2cSharingMode
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.DevicesLowLevelContract, 65536)]
enum class I2cSharingMode
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.DevicesLowLevelContract), 65536)]
public enum I2cSharingMode
var value = Windows.Devices.I2c.I2cSharingMode.exclusive
Public Enum I2cSharingMode
Inheritance
I2cSharingMode
Attributes

Windows requirements

Device family
Windows IoT Extension SDK (introduced in 10.0.10240.0)
API contract
Windows.Devices.DevicesLowLevelContract (introduced in v1.0)

Fields

Name Value Description
Exclusive 0

Connects to the I2 C bus address exclusively, so that no other connection to the I2 C bus address can be made while you remain connected. This mode is the default mode.

Shared 1

Connects to the I2 C bus address in shared mode, so that other connections to the I2 C bus address can be made while you remain connected.

You can perform all operations on shared connections, but use such connections with care. When multiple client apps change the global state of the I2 C device, race conditions can result.

An example use case for using a shared connection is a sensor that obtains readings without changing the state of the device.

Applies to

See also