//
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
//
// File generated by WinMDIDL version 8.00.0021
//

import "inspectable.idl";
import "AsyncInfo.idl";
import "EventToken.idl";
import "windowscontracts.idl";
import "Windows.Foundation.idl";
import "Windows.Devices.idl";

// Forward Declare
namespace Windows
{
    namespace Devices
    {
        apicontract DevicesLowLevelContract;
    }
}
namespace Windows
{
    namespace Foundation
    {
        interface IClosable;
    }
}
namespace Windows
{
    namespace Devices
    {
        namespace Spi
        {
            namespace Provider
            {
                typedef enum ProviderSpiMode ProviderSpiMode;

                typedef enum ProviderSpiSharingMode ProviderSpiSharingMode;

                interface IProviderSpiConnectionSettings;

                interface IProviderSpiConnectionSettingsFactory;

                interface ISpiControllerProvider;

                interface ISpiDeviceProvider;

                interface ISpiProvider;

                runtimeclass ProviderSpiConnectionSettings;
            }
        }
    }
}

// Generic instantiations
namespace Windows
{
    namespace Devices
    {
        namespace Spi
        {
            namespace Provider
            {
                declare
                {
                    interface Windows.Foundation.Collections.IIterable<Windows.Devices.Spi.Provider.ISpiControllerProvider*>;

                    interface Windows.Foundation.Collections.IIterator<Windows.Devices.Spi.Provider.ISpiControllerProvider*>;

                    interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Spi.Provider.ISpiControllerProvider*>;

                    interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Devices.Spi.Provider.ISpiControllerProvider*>*>;
                }
            }
        }
    }
}

// Type definition
namespace Windows
{
    namespace Devices
    {
        namespace Spi
        {
            namespace Provider
            {
                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                enum ProviderSpiMode
                {
                    Mode0 = 0,
                    Mode1 = 1,
                    Mode2 = 2,
                    Mode3 = 3
                };

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                enum ProviderSpiSharingMode
                {
                    Exclusive = 0,
                    Shared    = 1
                };

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [exclusiveto(Windows.Devices.Spi.Provider.ProviderSpiConnectionSettings)]
                [uuid(F6034550-A542-4EC0-9601-A4DD68F8697B)]
                interface IProviderSpiConnectionSettings : IInspectable
                {
                    [propget] HRESULT ChipSelectLine([out] [retval] INT32* value);
                    [propput] HRESULT ChipSelectLine([in] INT32 value);
                    [propget] HRESULT Mode([out] [retval] Windows.Devices.Spi.Provider.ProviderSpiMode* value);
                    [propput] HRESULT Mode([in] Windows.Devices.Spi.Provider.ProviderSpiMode value);
                    [propget] HRESULT DataBitLength([out] [retval] INT32* value);
                    [propput] HRESULT DataBitLength([in] INT32 value);
                    [propget] HRESULT ClockFrequency([out] [retval] INT32* value);
                    [propput] HRESULT ClockFrequency([in] INT32 value);
                    [propget] HRESULT SharingMode([out] [retval] Windows.Devices.Spi.Provider.ProviderSpiSharingMode* value);
                    [propput] HRESULT SharingMode([in] Windows.Devices.Spi.Provider.ProviderSpiSharingMode value);
                }

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [exclusiveto(Windows.Devices.Spi.Provider.ProviderSpiConnectionSettings)]
                [uuid(66456B5A-0C79-43E3-9F3C-E59780AC18FA)]
                interface IProviderSpiConnectionSettingsFactory : IInspectable
                {
                    HRESULT Create([in] INT32 chipSelectLine, [out] [retval] Windows.Devices.Spi.Provider.ProviderSpiConnectionSettings** value);
                }

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [uuid(C1686504-02CE-4226-A385-4F11FB04B41B)]
                interface ISpiControllerProvider : IInspectable
                {
                    HRESULT GetDeviceProvider([in] Windows.Devices.Spi.Provider.ProviderSpiConnectionSettings* settings, [out] [retval] Windows.Devices.Spi.Provider.ISpiDeviceProvider** result);
                }

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [uuid(0D1C3443-304B-405C-B4F7-F5AB1074461E)]
                interface ISpiDeviceProvider : IInspectable
                    requires
                        Windows.Foundation.IClosable
                {
                    [propget] HRESULT DeviceId([out] [retval] HSTRING* value);
                    [propget] HRESULT ConnectionSettings([out] [retval] Windows.Devices.Spi.Provider.ProviderSpiConnectionSettings** value);
                    HRESULT Write([in] UINT32 __bufferSize, [in] [size_is(__bufferSize)] BYTE* buffer);
                    HRESULT Read([range(0x00000000, 0x7FFFFFFF)] [in] UINT32 __bufferSize, [out] [size_is(__bufferSize)] BYTE* buffer);
                    HRESULT TransferSequential([in] UINT32 __writeBufferSize, [in] [size_is(__writeBufferSize)] BYTE* writeBuffer, [range(0x00000000, 0x7FFFFFFF)] [in] UINT32 __readBufferSize, [out] [size_is(__readBufferSize)] BYTE* readBuffer);
                    HRESULT TransferFullDuplex([in] UINT32 __writeBufferSize, [in] [size_is(__writeBufferSize)] BYTE* writeBuffer, [range(0x00000000, 0x7FFFFFFF)] [in] UINT32 __readBufferSize, [out] [size_is(__readBufferSize)] BYTE* readBuffer);
                }

                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [uuid(96B461E2-77D4-48CE-AAA0-75715A8362CF)]
                interface ISpiProvider : IInspectable
                {
                    HRESULT GetControllersAsync([out] [retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Devices.Spi.Provider.ISpiControllerProvider*>*>** result);
                }

                [activatable(Windows.Devices.Spi.Provider.IProviderSpiConnectionSettingsFactory, Windows.Devices.DevicesLowLevelContract, 2.0)]
                [contract(Windows.Devices.DevicesLowLevelContract, 2.0)]
                [marshaling_behavior(agile)]
                runtimeclass ProviderSpiConnectionSettings
                {
                    [default] interface Windows.Devices.Spi.Provider.IProviderSpiConnectionSettings;
                }
            }
        }
    }
}
