0

I'm currently trying to listen for when a GPIO input pin goes high by using an interrupt on an Intel Atom board with a EG20T platform controller. I'm using intel's driver and have found their programmers guide here: http://www.intel.com/content/www/us/en/intelligent-systems/previous-generation/pch-eg20t-gpio-win-programmers-guide.html

It seems fairly straight forward, make deviceIOControl calls to the specific pin with the macro for the operation you with to perform, but there are still some things I'm confused about.

  1. How do I create the hHandle to pass into the DeviceIOControl call? Or more specifically, if I use CreateFile what do I pass in as the file/device name?
  2. I don't really understand how Notify works, does the code just wait on that method until the pin status changes and then continues with the new data in the output buffer?
Casey Price
  • 768
  • 7
  • 16
  • Question 1 is addressed in section 5.1 of the guide. – Ben Voigt Aug 26 '15 at 22:02
  • 4.1 of the guide indicates that `IOCTL_GPIO_NOTIFY` is intended for use with overlapped I/O.... you should set the `hEvent` of the `OVERLAPPED` structure to a kernel event which will be triggered when the pin status changes. This kernel event is compatible with the usual Win32 wait functions such as `WaitForMultipleObjects` and `MsgWaitForMultipleObjectsEx`. – Ben Voigt Aug 26 '15 at 22:05
  • Thanks! I'm new to C++/WinAPI so I didn't know about Overlapped IO. I think I've gotten that part figured out although I still don't really understand what 5.1.1 is saying. I get that I probably need to do some sequence of SetupDiXxx calls to get the device names available and then pick from those but I'm a but clueless as to what ones to use or where to even start since there are so many. – Casey Price Aug 28 '15 at 19:03
  • That `GUID_DEVINTERFACE_IOHGPIO` is a filter, there's probably only one device path that matches it. – Ben Voigt Aug 28 '15 at 19:07

0 Answers0