How to use the external interrupt of pcDuino
This article is about how to use pcDuino external interrupts to share with you, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.
Key interrupt-poll mechanism
We try to make the keystroke have such a function that if no one presses the button within a certain period of time, the kernel alerts us, and then our application is reminded to print time out.
Driver program
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
/ / # include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# define GPIO_IRQ 28
# define GPIO_TEST_BASE 0xf1c20800
# define PH_CFG2 (GPIO_TEST_BASE + 0x104)
# define PIO_INT_CFG2 (GPIO_TEST_BASE+ 0x208)
# define PIO_INT_CTL (GPIO_TEST_BASE+ 0x210)
# define PH17_SELECT (6