Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use the external interrupt of pcDuino

Shulou Source: shulou.com Published: 2022-06-01 04:48:04 10月06日 Update

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

Tags: Buttons programs hibernation actions more knowledge articles testing compilation utility events kernels functions variables price that is work meetings applications articles methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Xiaomi NVidia Shulou Information Shulou Technology