# 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 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(_winrt.Object):
    sharing_mode: ProviderSpiSharingMode
    mode: ProviderSpiMode
    data_bit_length: _winrt.Int32
    clock_frequency: _winrt.Int32
    chip_select_line: _winrt.Int32
    @staticmethod
    def _from(obj: _winrt.Object) -> ProviderSpiConnectionSettings: ...
    def __new__(cls: typing.Type[ProviderSpiConnectionSettings], chip_select_line: _winrt.Int32) -> ProviderSpiConnectionSettings:...

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

class ISpiDeviceProvider(_winrt.Object):
    connection_settings: typing.Optional[ProviderSpiConnectionSettings]
    device_id: str
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: _winrt.Object) -> ISpiDeviceProvider: ...
    def close(self) -> None: ...
    def read(self, buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def transfer_full_duplex(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def transfer_sequential(self, write_buffer: typing.Sequence[_winrt.UInt8], read_buffer_size: _winrt.UInt32) -> typing.List[_winrt.UInt8]: ...
    def write(self, buffer: typing.Sequence[_winrt.UInt8]) -> None: ...

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

