This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

zephyr,gpio-keys

Vendor: Zephyr-specific binding

Description

Zephyr Input GPIO KEYS parent node

This defines a group of buttons that can generate input events. Each button
is defined in a child node of the zephyr,gpio-keys node and define a specific
key code.

For example:

#include <dt-bindings/input/input-event-codes.h>

/ {
       buttons {
               compatible = "zephyr,gpio-keys";
               button_0 {
                       gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
                       zephyr,code = <INPUT_KEY_0>;
               };
       };
};

Properties

Top level properties

These property descriptions apply to “zephyr,gpio-keys” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

Name

Type

Details

debounce-interval-ms

int

Debouncing interval time in milliseconds.
If not specified defaults to 30.

Default value: 30

Child node properties

Name

Type

Details

zephyr,code

int

Key code to emit.

This property is required.

gpios

phandle-array

This property is required.

label

string

Descriptive name of the key

See Important properties for more information.