How do I access GPIO, I²C, SPI, PWM, etc. in the Windows environment?
Currently I have two Intel NUC5i5MYBE motherboards. One board has WindRiver Linux and another one has Windows 10 Enterprise.
On Linux, I don't have any trouble while accessing all of the above, but problem with Windows environment.
In Windows, my target is to use the CreateFile
function of Windows to open such interfaces.
But before I call this function I need to supply a device path to this function. For that, my target is to use the following functions as well as a data structure to find out the device path.
SetupDiGetClassDevs()
SetupDiEnumDeviceInterfaces()
SetupDiGetDeviceInterfaceDetail()
HDEVINFO
SP_DEVINFO_DATA
PSP_DEVICE_INTERFACE_DETAIL_DATA
But the major problem and unknown thing is how to supply a GUID to SetupDiGetClassDevs as the first argument?
The Windows prototype for SetupDiGetClassDevs is as follows.
HDEVINFO SetupDiGetClassDevs(
_In_opt_ const GUID *ClassGuid,
_In_opt_ PCTSTR Enumerator,
_In_opt_ HWND hwndParent,
_In_ DWORD Flags
);