# 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.foundation
import winsdk.windows.foundation.collections

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

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

class ProviderI2cTransferStatus(enum.IntEnum):
    FULL_TRANSFER = 0
    PARTIAL_TRANSFER = 1
    SLAVE_ADDRESS_NOT_ACKNOWLEDGED = 2

Self = typing.TypeVar('Self')

class ProviderI2cTransferResult:
    status: ProviderI2cTransferStatus
    bytes_transferred: _winrt.UInt32
    def __new__(cls: typing.Type[ProviderI2cTransferResult], status: ProviderI2cTransferStatus, bytes_transferred: _winrt.UInt32) -> ProviderI2cTransferResult: ...

class ProviderI2cConnectionSettings(_winrt.Object):
    slave_address: _winrt.Int32
    sharing_mode: ProviderI2cSharingMode
    bus_speed: ProviderI2cBusSpeed
    @staticmethod
    def _from(obj: _winrt.Object) -> ProviderI2cConnectionSettings: ...

class II2cControllerProvider(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> II2cControllerProvider: ...
    def get_device_provider(self, settings: typing.Optional[ProviderI2cConnectionSettings]) -> typing.Optional[II2cDeviceProvider]: ...

class II2cDeviceProvider(_winrt.Object):
    device_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: _winrt.Object) -> II2cDeviceProvider: ...
    def close(self) -> None: ...
    def read(self, buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def read_partial(self, buffer_size: _winrt.UInt32) -> typing.Tuple[ProviderI2cTransferResult, typing.List[_winrt.UInt8]]: ...
    def write(self, buffer: typing.Sequence[_winrt.UInt8]) -> None: ...
    def write_partial(self, buffer: typing.Sequence[_winrt.UInt8]) -> ProviderI2cTransferResult: ...
    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[ProviderI2cTransferResult, typing.List[_winrt.UInt8]]: ...

class II2cProvider(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> II2cProvider: ...
    def get_controllers_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVectorView[II2cControllerProvider]]: ...

