II2cDeviceProvider II2cDeviceProvider II2cDeviceProvider II2cDeviceProvider Interface

Definition

Represents methods common to all I2 C device providers.

public : interface II2cDeviceProviderpublic interface II2cDeviceProviderPublic Interface II2cDeviceProvider// You can use this interface in JavaScript.
Inheritance
IClosableIDisposableIDisposableIDisposable
II2cDeviceProviderII2cDeviceProviderII2cDeviceProviderII2cDeviceProvider
Attributes
Windows 10 requirements
Device family
Windows IoT Extension SDK (introduced v10.0.10586.0) Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Devices.DevicesLowLevelContract (introduced v2)

Inherited Members

Inherited methods

Properties

DeviceId DeviceId DeviceId DeviceId

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

public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

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

Methods

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.

public : void Read(Byte[] buffer)public void Read(Byte[] buffer)Public Function Read(buffer As Byte[]) As void// You can use this method in JavaScript.
Parameters
buffer
Byte[] Byte[] Byte[] Byte[]

The buffer to which you want to read the data from the I2 C bus. The length of the buffer determines how much data to request from the device.

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.

public : ProviderI2cTransferResult ReadPartial(Byte[] buffer)public ProviderI2cTransferResult ReadPartial(Byte[] buffer)Public Function ReadPartial(buffer As Byte[]) As ProviderI2cTransferResult// You can use this method in JavaScript.
Parameters
buffer
Byte[] Byte[] Byte[] Byte[]

The buffer to which you want to read the data from the I2 C bus. The length of the buffer determines how much data to request from the device.

Returns

A structure that contains information about the success of the read operation and the actual number of bytes that the operation read into the buffer.

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

Writes data to the inter-integrated circuit (I2 C) bus on which the device is connected.

public : void Write(Byte[] buffer)public void Write(Byte[] buffer)Public Function Write(buffer As Byte[]) As void// You can use this method in JavaScript.
Parameters
buffer
Byte[] Byte[] Byte[] Byte[]

A buffer that contains the data that you want to write to the I2 C device. This data should not include the bus address.

Remarks

Error Codes

0x80070002

The bus address was not acknowledged.

0x8007045D

The I2 C device negatively acknowledged the data transfer before the entire buffer was read.

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.

public : ProviderI2cTransferResult WritePartial(Byte[] buffer)public ProviderI2cTransferResult WritePartial(Byte[] buffer)Public Function WritePartial(buffer As Byte[]) As ProviderI2cTransferResult// You can use this method in JavaScript.
Parameters
buffer
Byte[] Byte[] Byte[] Byte[]

A buffer that contains the data that you want to write to the I2 C device. This data should not include the bus address.

Returns

A structure that contains information about the success of the write operation and the actual number of bytes that the operation wrote into the buffer.

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.

public : void WriteRead(Byte[] writeBuffer, Byte[] readBuffer)public void WriteRead(Byte[] writeBuffer, Byte[] readBuffer)Public Function WriteRead(writeBuffer As Byte[], readBuffer As Byte[]) As void// You can use this method in JavaScript.
Parameters
writeBuffer
Byte[] Byte[] Byte[] Byte[]

A buffer that contains the data that you want to write to the I2 C device. This data should not include the bus address.

readBuffer
Byte[] Byte[] Byte[] Byte[]

The buffer to which you want to read the data from the I2 C bus. The length of the buffer determines how much data to request from the device.

Remarks

Error Codes

0x80070002

The bus address was not acknowledged.

0x8007045D

The I2 C device negatively acknowledged the data transfer before the entire buffer was read.

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.

public : ProviderI2cTransferResult WriteReadPartial(Byte[] writeBuffer, Byte[] readBuffer)public ProviderI2cTransferResult WriteReadPartial(Byte[] writeBuffer, Byte[] readBuffer)Public Function WriteReadPartial(writeBuffer As Byte[], readBuffer As Byte[]) As ProviderI2cTransferResult// You can use this method in JavaScript.
Parameters
writeBuffer
Byte[] Byte[] Byte[] Byte[]

A buffer that contains the data that you want to write to the I2 C device. This data should not include the bus address.

readBuffer
Byte[] Byte[] Byte[] Byte[]

The buffer to which you want to read the data from the I2 C bus. The length of the buffer determines how much data to request from the device.

Returns

A structure that contains information about whether both the read and write parts of the operation succeeded and the sum of the actual number of bytes that the operation wrote and the actual number of bytes that the operation read.

See Also

  • IClosable IDisposable IDisposable IDisposable