NAME
gpiokeys — GPIO keys device driverSYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file:
options
FDT
device gpio
device gpiokeys
Alternatively, to load the driver as a module at boot time, place the following
line in loader.conf(5):
device gpio
device gpiokeys
gpiokeys_load="YES"
DESCRIPTION
The gpiokeys driver provides a way to represent a set of general purpose inputs as a keyboard(4) device. At the moment the driver supports only FDT(4) based systems. The DTS determines what pins are mapped to buttons and what key codes are generated for each virtual button. The keyboard(4) device can be used from userland to monitor for input changes. On an FDT(4) based system the DTS part for a gpiokeys device usually looks like:/ { ... gpio_keys { compatible = "gpio-keys"; btn1 { label = "button1"; linux,code = <KEY_1>; gpios = <&gpio 0 3 GPIO_ACTIVE_LOW> }; btn2 { label = "button2"; linux,code = <KEY_2>; gpios = <&gpio 0 4 GPIO_ACTIVE_LOW> }; }; };
SEE ALSO
fdt(4), gpio(4), keyboard(4), kbdmap(5)HISTORY
The gpiokeys manual page first appeared in FreeBSD 12.2.AUTHORS
The gpiokeys driver was written by Oleksandr Tymoshenko <[email protected]>. This manual page was written byAndriy Gapon <[email protected]>.
August 5, 2020 | Debian |