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

import enum
import sys
import types
import typing
import uuid

import winsdk._winrt as _winrt

try:
    import winsdk.windows.devices.spi.provider
except Exception:
    pass

try:
    import winsdk.windows.foundation
except Exception:
    pass

try:
    import winsdk.windows.foundation.collections
except Exception:
    pass

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

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

class SpiBusInfo(_winrt.Object):
    chip_select_line_count: _winrt.Int32
    max_clock_frequency: _winrt.Int32
    min_clock_frequency: _winrt.Int32
    supported_data_bit_lengths: winsdk.windows.foundation.collections.IVectorView[_winrt.Int32]
    @staticmethod
    def _from(obj: _winrt.Object) -> SpiBusInfo: ...

class SpiConnectionSettings(_winrt.Object):
    sharing_mode: SpiSharingMode
    mode: SpiMode
    data_bit_length: _winrt.Int32
    clock_frequency: _winrt.Int32
    chip_select_line: _winrt.Int32
    @staticmethod
    def _from(obj: _winrt.Object) -> SpiConnectionSettings: ...
    @typing.overload
    def __init__(self, chip_select_line: _winrt.Int32) -> None: ...

class SpiController(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> SpiController: ...
    @typing.overload
    @staticmethod
    def get_controllers_async(provider: winsdk.windows.devices.spi.provider.ISpiProvider) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.foundation.collections.IVectorView[SpiController]]: ...
    @typing.overload
    @staticmethod
    def get_default_async() -> winsdk.windows.foundation.IAsyncOperation[SpiController]: ...
    @typing.overload
    def get_device(self, settings: SpiConnectionSettings) -> SpiDevice: ...

class SpiDevice(winsdk.windows.foundation.IClosable, _winrt.Object):
    connection_settings: SpiConnectionSettings
    device_id: str
    @staticmethod
    def _from(obj: _winrt.Object) -> SpiDevice: ...
    @typing.overload
    def close(self) -> None: ...
    @typing.overload
    @staticmethod
    def from_id_async(bus_id: str, settings: SpiConnectionSettings) -> winsdk.windows.foundation.IAsyncOperation[SpiDevice]: ...
    @typing.overload
    @staticmethod
    def get_bus_info(bus_id: str) -> SpiBusInfo: ...
    @typing.overload
    @staticmethod
    def get_device_selector() -> str: ...
    @typing.overload
    @staticmethod
    def get_device_selector(friendly_name: str) -> str: ...
    @typing.overload
    def read(self, buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    @typing.overload
    def transfer_full_duplex(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    @typing.overload
    def transfer_sequential(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    @typing.overload
    def write(self, buffer: typing.Sequence[_winrt.UInt8]) -> None: ...

class ISpiDeviceStatics(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> ISpiDeviceStatics: ...
    @typing.overload
    def from_id_async(self, bus_id: str, settings: SpiConnectionSettings) -> winsdk.windows.foundation.IAsyncOperation[SpiDevice]: ...
    @typing.overload
    def get_bus_info(self, bus_id: str) -> SpiBusInfo: ...
    @typing.overload
    def get_device_selector(self) -> str: ...
    @typing.overload
    def get_device_selector(self, friendly_name: str) -> str: ...

