GPIOIRQ(4) Device Drivers Manual GPIOIRQ(4)

gpioirq
Install an interrupt handler on a GPIO pin

gpioirq* at gpio? offset 0 mask 0x1 flag 0x00

The gpioirq driver attaches an interrupt handler to a single GPIO pin.

The pin number is specified in the kernel configuration file with the offset locator. The mask locator should always be 0x1.

The flag locator specifies the interrupt mode to use:

Interrupt on the positive (rising) edge of the pin.
Interrupt on the negative (falling) edge of the pin.
Interrupt on both edges of the pin.
Assert the intrerrupt as long as the pin is high.
Assert the interrupt as long as the pin is low.

Note that the interrupts modes are mutually-exclusive, and exactly one interrupt mode must be specified. These flags correspond to the GPIO_INTR mode bits defined in sys/gpio.h. In addition to the interrupt mode, setting 0x1000 in flags will enable the printing of a message to the console whenever the interrupt handler is called.

The offset, mask, and flag locators can also be specified when gpioirq is attached at runtime using the GPIOATTACH ioctl(2) on the gpio(4) device.

gpio(4), drvctl(8), gpioctl(8)

The gpioirq driver first appeared in NetBSD 9.0.

The gpioirq driver was written by Brad Spencer <brad@anduin.eldar.org>.
May 11, 2018 NetBSD 9.4