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

import enum
import datetime
import sys
import types
import typing

import winsdk._winrt as _winrt
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: _winrt.UInt32
    def __new__(cls: typing.Type[I2cTransferResult], status: I2cTransferStatus, bytes_transferred: _winrt.UInt32) -> I2cTransferResult: ...

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

class I2cController(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.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(_winrt.Object):
    connection_settings: typing.Optional[I2cConnectionSettings]
    device_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: _winrt.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_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def read_partial(self, buffer_size: _winrt.UInt32) -> typing.Tuple[I2cTransferResult, typing.List[_winrt.UInt8]]: ...
    def write(self, buffer: typing.Sequence[_winrt.UInt8]) -> None: ...
    def write_partial(self, buffer: typing.Sequence[_winrt.UInt8]) -> I2cTransferResult: ...
    def write_read(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def write_read_partial(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.Tuple[I2cTransferResult, typing.List[_winrt.UInt8]]: ...

class II2cDeviceStatics(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.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: ...

