# WARNING: Please don't edit this file. It was generated by Python/WinRT v3.1.0

import datetime
import sys
import types
import typing
import uuid as _uuid
from builtins import property as _property
from abc import abstractmethod

import winrt._winrt
import winrt.system
import winrt.windows.devices.spi.provider as windows_devices_spi_provider
import winrt.windows.foundation as windows_foundation
import winrt.windows.foundation.collections as windows_foundation_collections

from winrt.windows.devices.spi import SpiMode, SpiSharingMode

Self = typing.TypeVar('Self')

@typing.final
class SpiBusInfo(winrt.system.Object):
    # System.Int32 Windows.Devices.Spi.SpiBusInfo::get_ChipSelectLineCount()
    @_property
    def chip_select_line_count(self) -> winrt.system.Int32: ...
    # System.Int32 Windows.Devices.Spi.SpiBusInfo::get_MaxClockFrequency()
    @_property
    def max_clock_frequency(self) -> winrt.system.Int32: ...
    # System.Int32 Windows.Devices.Spi.SpiBusInfo::get_MinClockFrequency()
    @_property
    def min_clock_frequency(self) -> winrt.system.Int32: ...
    # Windows.Foundation.Collections.IVectorView`1<System.Int32> Windows.Devices.Spi.SpiBusInfo::get_SupportedDataBitLengths()
    @_property
    def supported_data_bit_lengths(self) -> typing.Sequence[winrt.system.Int32]: ...

@typing.final
class SpiConnectionSettings(winrt.system.Object):
    def __new__(cls: typing.Type[Self], chip_select_line: winrt.system.Int32) -> Self: ...
    # Windows.Devices.Spi.SpiSharingMode Windows.Devices.Spi.SpiConnectionSettings::get_SharingMode()
    @_property
    def sharing_mode(self) -> SpiSharingMode: ...
    # System.Void Windows.Devices.Spi.SpiConnectionSettings::put_SharingMode(Windows.Devices.Spi.SpiSharingMode)
    @sharing_mode.setter
    def sharing_mode(self, value: SpiSharingMode) -> None: ...
    # Windows.Devices.Spi.SpiMode Windows.Devices.Spi.SpiConnectionSettings::get_Mode()
    @_property
    def mode(self) -> SpiMode: ...
    # System.Void Windows.Devices.Spi.SpiConnectionSettings::put_Mode(Windows.Devices.Spi.SpiMode)
    @mode.setter
    def mode(self, value: SpiMode) -> None: ...
    # System.Int32 Windows.Devices.Spi.SpiConnectionSettings::get_DataBitLength()
    @_property
    def data_bit_length(self) -> winrt.system.Int32: ...
    # System.Void Windows.Devices.Spi.SpiConnectionSettings::put_DataBitLength(System.Int32)
    @data_bit_length.setter
    def data_bit_length(self, value: winrt.system.Int32) -> None: ...
    # System.Int32 Windows.Devices.Spi.SpiConnectionSettings::get_ClockFrequency()
    @_property
    def clock_frequency(self) -> winrt.system.Int32: ...
    # System.Void Windows.Devices.Spi.SpiConnectionSettings::put_ClockFrequency(System.Int32)
    @clock_frequency.setter
    def clock_frequency(self, value: winrt.system.Int32) -> None: ...
    # System.Int32 Windows.Devices.Spi.SpiConnectionSettings::get_ChipSelectLine()
    @_property
    def chip_select_line(self) -> winrt.system.Int32: ...
    # System.Void Windows.Devices.Spi.SpiConnectionSettings::put_ChipSelectLine(System.Int32)
    @chip_select_line.setter
    def chip_select_line(self, value: winrt.system.Int32) -> None: ...

@typing.final
class SpiController_Static(winrt._winrt.IInspectable_Static):
    # Windows.Foundation.IAsyncOperation`1<Windows.Foundation.Collections.IVectorView`1<Windows.Devices.Spi.SpiController>> Windows.Devices.Spi.SpiController::GetControllersAsync(Windows.Devices.Spi.Provider.ISpiProvider)
    def get_controllers_async(cls, provider: windows_devices_spi_provider.ISpiProvider, /) -> windows_foundation.IAsyncOperation[typing.Sequence[SpiController]]: ...
    # Windows.Foundation.IAsyncOperation`1<Windows.Devices.Spi.SpiController> Windows.Devices.Spi.SpiController::GetDefaultAsync()
    def get_default_async(cls) -> windows_foundation.IAsyncOperation[SpiController]: ...

@typing.final
class SpiController(winrt.system.Object, metaclass=SpiController_Static):
    # Windows.Devices.Spi.SpiDevice Windows.Devices.Spi.SpiController::GetDevice(Windows.Devices.Spi.SpiConnectionSettings)
    def get_device(self, settings: SpiConnectionSettings, /) -> SpiDevice: ...

@typing.final
class SpiDevice_Static(winrt._winrt.IInspectable_Static):
    # Windows.Foundation.IAsyncOperation`1<Windows.Devices.Spi.SpiDevice> Windows.Devices.Spi.SpiDevice::FromIdAsync(System.String,Windows.Devices.Spi.SpiConnectionSettings)
    def from_id_async(cls, bus_id: str, settings: SpiConnectionSettings, /) -> windows_foundation.IAsyncOperation[SpiDevice]: ...
    # Windows.Devices.Spi.SpiBusInfo Windows.Devices.Spi.SpiDevice::GetBusInfo(System.String)
    def get_bus_info(cls, bus_id: str, /) -> SpiBusInfo: ...
    # System.String Windows.Devices.Spi.SpiDevice::GetDeviceSelector()
    def get_device_selector(cls) -> str: ...
    # System.String Windows.Devices.Spi.SpiDevice::GetDeviceSelector(System.String)
    def get_device_selector_from_friendly_name(cls, friendly_name: str, /) -> str: ...

@typing.final
class SpiDevice(winrt.system.Object, windows_foundation.IClosable, metaclass=SpiDevice_Static):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None: ...
    # System.Void Windows.Devices.Spi.SpiDevice::Close()
    def close(self) -> None: ...
    # System.Void Windows.Devices.Spi.SpiDevice::Read(System.Byte[])
    def read(self, buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.WriteableBuffer], /) -> None: ...
    # System.Void Windows.Devices.Spi.SpiDevice::TransferFullDuplex(System.Byte[],System.Byte[])
    def transfer_full_duplex(self, write_buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.ReadableBuffer], read_buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.WriteableBuffer], /) -> None: ...
    # System.Void Windows.Devices.Spi.SpiDevice::TransferSequential(System.Byte[],System.Byte[])
    def transfer_sequential(self, write_buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.ReadableBuffer], read_buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.WriteableBuffer], /) -> None: ...
    # System.Void Windows.Devices.Spi.SpiDevice::Write(System.Byte[])
    def write(self, buffer: typing.Union[winrt.system.Array[winrt.system.UInt8], winrt.system.ReadableBuffer], /) -> None: ...
    # Windows.Devices.Spi.SpiConnectionSettings Windows.Devices.Spi.SpiDevice::get_ConnectionSettings()
    @_property
    def connection_settings(self) -> SpiConnectionSettings: ...
    # System.String Windows.Devices.Spi.SpiDevice::get_DeviceId()
    @_property
    def device_id(self) -> str: ...

@typing.final
class _ISpiDeviceStatics: ...

class ISpiDeviceStatics(winrt._winrt.IInspectable):
    # Windows.Foundation.IAsyncOperation`1<Windows.Devices.Spi.SpiDevice> Windows.Devices.Spi.ISpiDeviceStatics::FromIdAsync(System.String,Windows.Devices.Spi.SpiConnectionSettings)
    @abstractmethod
    def from_id_async(self, bus_id: str, settings: SpiConnectionSettings, /) -> windows_foundation.IAsyncOperation[SpiDevice]: ...
    # Windows.Devices.Spi.SpiBusInfo Windows.Devices.Spi.ISpiDeviceStatics::GetBusInfo(System.String)
    @abstractmethod
    def get_bus_info(self, bus_id: str, /) -> SpiBusInfo: ...
    # System.String Windows.Devices.Spi.ISpiDeviceStatics::GetDeviceSelector()
    @abstractmethod
    def get_device_selector(self) -> str: ...
    # System.String Windows.Devices.Spi.ISpiDeviceStatics::GetDeviceSelector(System.String)
    @abstractmethod
    def get_device_selector_from_friendly_name(self, friendly_name: str, /) -> str: ...

