GPIO Interrupts

Aug 12, 2016 at 11:14 AM
Did someone manage to get interrupts fired on GPIOs ?

Here is my code and I don't understand why the interrupts do not fire (although I can see the signal latching on the scope):
dwGPIO_handle = GPIOOpen();
GPIOSetMode(dwGPIO_handle, (DWORD)GPIO1_17, GPIO_DIR_INPUT | GPIO_INT_HIGH_LOW );
bSuccess = ( (GPIO_DIR_INPUT | GPIO_INT_HIGH_LOW) == GPIOGetMode(dwGPIO_handle, (DWORD)GPIO1_17));

if(bSuccess)
{
dwIRq=GPIOGetSystemIrq(dwGPIO_handle, (DWORD)GPIO1_17);
if(dwIRq)
        {
            dwI2C_SysIntr =     (DWORD) SYSINTR_UNDEFINED;
            // Create an event to wait on
            hI2C_Event = CreateEvent(NULL, FALSE, FALSE, NULL);
            if (hI2C_Event!= NULL)
            {
                // Get the SYSINTR that corresponds to dwIrq (non GPIO Irqs correspond to the bit numbers of the PXA27x Interrupt resisters)
                if (!KernelIoControl(
                        IOCTL_HAL_REQUEST_SYSINTR,
                        &dwIRq,
                        sizeof(dwIRq),
                        &dwI2C_SysIntr,
                        sizeof(dwI2C_SysIntr),
                        NULL
                        ) )
                {
                    RETAILMSG(ZONE_ERROR, (TEXT("ERROR: Failed to request the input interrupt gpio's sysintr.\r\n")));
                }
                else
                {
                    if (GPIOInterruptInitialize(dwGPIO_handle, (DWORD)GPIO1_17, &dwI2C_SysIntr, hI2C_Event))
                    {
                        GPIOInterruptDone(dwGPIO_handle, (DWORD)GPIO1_17, dwI2C_SysIntr);
                    }
                    else
                    {
                        RETAILMSG(ZONE_ERROR, (TEXT("ERROR: Failed to initialize the interrupt line.\r\n")));
                    }
                }
            }
}
And then, when I wait on the created event, the interrupt never occurs when my signal latches.

I also tried without calling GPIOGetSystemIrq and KernerlIoControl + IOCTL_HAL_REQUEST_SYSINTR as these are already handled in GPIOInterruptInitialize but the result is the same.

Any advice would be greatly appreciated !!