GPIO output Interrupt handlers in linux (arm)

Can someone point me to some sample code to enable and handle IO input interrupts for user (C language) for ARM9 on Linux?

I know that a low-level driver may be needed, I just want to get some ideas on how to initialize it, and then process messages at the user level, etc.

I am familiar with ARM interrupts and device drivers (on Windows), but I'm new to Linux programming.

thank

+3
source share
1 answer

BSP, . AFAIK " ARM9 gpio" Linux, . . PCA100:

static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
                void *data)
{
        int ret;

        ret = request_irq(IRQ_GPIOC(29), detect_irq,
                          IRQF_DISABLED | IRQF_TRIGGER_FALLING,
                          "imx-mmc-detect", data);
        if (ret)
                printk(KERN_ERR
                        "pca100: Failed to reuest irq for sd/mmc detection\n");

        return ret;
}

static void pca100_sdhc2_exit(struct device *dev, void *data)
{
        free_irq(IRQ_GPIOC(29), data);
}
+3

Source: https://habr.com/ru/post/1778968/


All Articles