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

class ProviderSpiMode(enum.IntEnum):
    MODE0 = 0
    MODE1 = 1
    MODE2 = 2
    MODE3 = 3

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

Self = typing.TypeVar('Self')

class ProviderSpiConnectionSettings(winsdk.system.Object):
    sharing_mode: ProviderSpiSharingMode
    mode: ProviderSpiMode
    data_bit_length: winsdk.system.Int32
    clock_frequency: winsdk.system.Int32
    chip_select_line: winsdk.system.Int32
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> ProviderSpiConnectionSettings: ...
    def __new__(cls: typing.Type[ProviderSpiConnectionSettings], chip_select_line: winsdk.system.Int32) -> ProviderSpiConnectionSettings:...

class ISpiControllerProvider(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> ISpiControllerProvider: ...
    def get_device_provider(self, settings: typing.Optional[ProviderSpiConnectionSettings], /) -> typing.Optional[ISpiDeviceProvider]: ...

class ISpiDeviceProvider(winsdk.system.Object):
    connection_settings: typing.Optional[ProviderSpiConnectionSettings]
    device_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> ISpiDeviceProvider: ...
    def close(self) -> None: ...
    def read(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def transfer_full_duplex(self, write_buffer: winsdk.system.Array[winsdk.system.UInt8], read_buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def transfer_sequential(self, write_buffer: winsdk.system.Array[winsdk.system.UInt8], read_buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...
    def write(self, buffer: winsdk.system.Array[winsdk.system.UInt8], /) -> None: ...

class ISpiProvider(winsdk.system.Object):
    @staticmethod
    def _from(obj: winsdk.system.Object, /) -> ISpiProvider: ...
    def get_controllers_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVectorView[ISpiControllerProvider]]: ...

