# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.10

import enum
import datetime
import sys
import types
import typing

import winsdk.system
import winsdk.windows.devices.i2c.provider
import winsdk.windows.foundation
import winsdk.windows.foundation.collections

class I2cBusSpeed(enum.IntEnum):
    STANDARD_MODE = 0
    FAST_MODE = 1

class I2cSharingMode(enum.IntEnum):
    EXCLUSIVE = 0
    SHARED = 1

class I2cTransferStatus(enum.IntEnum):
    FULL_TRANSFER = 0
    PARTIAL_TRANSFER = 1
    SLAVE_ADDRESS_NOT_ACKNOWLEDGED = 2
    CLOCK_STRETCH_TIMEOUT = 3
    UNKNOWN_ERROR = 4

Self = typing.TypeVar('Self')

class I2cTransferResult:
    status: I2cTransferStatus
    bytes_transferred: winsdk.system.UInt32
    def __new__(cls: typing.Type[I2cTransferResult], status: I2cTransferStatus, bytes_transferred: winsdk.system.UInt32) -> I2cTransferResult: ...

class I2cConnectionSettings(winsdk.system.Object):
    slave_address: winsdk.system.Int32
    sharing_mode: I2cSharingMode
    bus_speed: I2cBusSpeed
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> I2cConnectionSettings: ...
    def __new__(cls: typing.Type[I2cConnectionSettings], slave_address: winsdk.system.Int32) -> I2cConnectionSettings:...

class I2cController(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> I2cController: ...
    @staticmethod
    def get_controllers_async(provider: typing.Optional[winsdk.windows.devices.i2c.provider.II2cProvider], /) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVectorView[I2cController]]: ...
    @staticmethod
    def get_default_async() -> winsdk.windows.foundation.IAsyncOperation[I2cController]: ...
    def get_device(self, settings: typing.Optional[I2cConnectionSettings], /) -> typing.Optional[I2cDevice]: ...

class I2cDevice(winsdk.system.Object):
    connection_settings: typing.Optional[I2cConnectionSettings]
    device_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> I2cDevice: ...
    def close(self) -> None: ...
    @staticmethod
    def from_id_async(device_id: str, settings: typing.Optional[I2cConnectionSettings], /) -> winsdk.windows.foundation.IAsyncOperation[I2cDevice]: ...
    @typing.overload
    @staticmethod
    def get_device_selector() -> str: ...
    @typing.overload
    @staticmethod
    def get_device_selector(friendly_name: str, /) -> str: ...
    def read(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def read_partial(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> I2cTransferResult: ...
    def write(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def write_partial(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> I2cTransferResult: ...
    def write_read(self, write_buffer: winsdk.system.Array[winsdk.system.UInt8], read_buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def write_read_partial(self, write_buffer: winsdk.system.Array[winsdk.system.UInt8], read_buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> I2cTransferResult: ...

class II2cDeviceStatics(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> II2cDeviceStatics: ...
    def from_id_async(self, device_id: str, settings: typing.Optional[I2cConnectionSettings], /) -> winsdk.windows.foundation.IAsyncOperation[I2cDevice]: ...
    @typing.overload
    def get_device_selector(self) -> str: ...
    @typing.overload
    def get_device_selector(self, friendly_name: str, /) -> str: ...

