你好,我在TI81XX PSP GPIO Driver User Guide文档看到:
GPIO pin is also used as a interrupt source, these are the general usage of IRQ handling using GPIO lines.
• Map GPIO number to corresponding IRQ number, GPIO 0 need not use IRQ 0
irq_num = gpio_to_irq(30)
• Request IRQ, make sure that irq_num should be non-error value
request_irq(irq_num, handler, 0, "gpio_test", NULL);
• Set IRQ type Raising/Falling/Level triggered
set_irq_type(irq_num, IRQ_TYPE_EDGE_RISING);
• During the clean-up path free the IRQ and gpio
free_irq(irq_num, NULL);
gpio_free(30);
————》》》》》》》》》》》》》》》》》》是不是这个30,是不是gp号和中断号对应的,还是什么,这里很是不懂,希望大神指点
Chris Meng:
你好,
我觉得只是举例个例子吧。对于A8来说GPIO的中断号是96~99。请参考数据手册或者是TRM。
xing lixing:
回复 Chris Meng:
比如gp0[31][30][29][28]都要中断,中断号怎么给,
还有就是如果gpio输入不用中断,datain是只读的,如果在外面给输入高低电平,我要怎么在datain读出电平的变化,
希望老师帮我指导