使用 C++ 处理 GPIO 按钮事件
大家好,我需要一些帮助.我正在 ARM 中制作一个 C++ 嵌入式应用程序.我需要获得一个按钮事件,我一直在互联网上寻找,我发现最好的方法是中断.我知道我可以像这样通过终端设置一个引脚echo raise >/sys/.../gpio/gpio81/edge".但是我需要知道如何在发生中断时从我的 C++ 应用程序中获取中断,我只需要一些示例,因为我不知道是否必须使用某些特殊库.
Hi guys I need some help. I am making a c++ embedded application in an ARM. I need to get a push button event, I was looking for in internet and I find that the best way to do it is with interruptions. I know that I can set one pin through terminal like this "echo raise > /sys/.../gpio/gpio81/edge". But I need to know how can I get the interrupt from my C++ application when it happend, I just need some example, because I do not know if I have to use some special library.
谢谢你们,我希望有人能帮助我.
Thank you guys I hope someone can help me.
大家好,我找到了我想要的解决方案:
Hi guys I find the solution what I just wanted is here:
https://developer.ridgerun.com/wiki/index.php/Gpio-int-test.c
还是谢谢你