GPIO as Keyboard on Linux
The Linux kernel provides the gpio-keys driver (CONFIG_KEYBOARD_GPIO) that can map GPIO pins to keyboard keys and expose them to userspace as input devices. Minimal device tree overlay fragment example: &{/} { gpio_keys { compatible = "gpio-keys"; #address-cells = <1>; #size-cells = <0>; enter_button { label = "enter"; linux,code = <KEY_ENTER>; gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; }; }; }; Check your board documentation and device tree for GPIO controller names, indexes, and mapping to physical pins. You might also need to adjust pinctrl for multiplexing and pin configuration. ...