Search code examples
c#c++windowsgpio

How to communicate with GPIO on windows (Win 10) for non raspberry device?


I have a motherboard (KINO-DH310) with windows 10, the GPIO controller displays under Device Manager -> System devices -> Interl(R) Serial IO GPIO Host Controller.

How am I supposed to begin simple I/O with this controller? I've tried different strategies, different programming languages, but to no affect. The majority of examples / sample code I see online are for the raspberry pi, and don't seem to work for me. Is there a concept I'm not grasping?

GPIO Controller

I've tried toggling the output pins to low and high using assembly (from C++ application)

KINO-DH310 recommended assembly: Digital Output is 1001b

MOV AX, 6F09H ;setting the digital port as output
MOV BL, 09H   ;digital value is 09H
INT 15H

My C++ Code:

__asm {
mov AX, 6F09H
mov BL, 00H
INT 15H        <--- Generates "Access Violation reading location 0xFFFFFFFF" error
};

This always generates an access violation because you could potentially access memory that would harm the system. Is there a way to suppress this?

My C# Code:

var gpio = GpioController.GetDefault();

if (gpio == null)
    return;      <--- Always returns null

Always generates null. I was hoping since I could see it in device manager, Windows could detect it has access to a GPIO Controller.

Any clarification would be greatly appreciated, even if the answer would be Windows doesn't support it (which I'm hoping is not the case)


Solution

  • Just wanted to give an update if anyone is trying to do something similar. In the end, I needed to get the SDK from the motherboard manufacturer. (IEI)

    There was a small bug in the BIOS, but they were nice enough to give me a patch to the BIOS, and after updating the BIOS version, the SDK worked perfectly.

    Final Result