zmk/docs/docs/development/hardware-integration/includes/_gpio-key-direct.md
Nicolas Munnich f4582bdaa7
feat(docs) Adding some additional clarity around low power states (#2330)
* docs(feat): Adding some additional clarity around low power states, with guide portion moved to hardware integration

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-11-02 23:20:31 +01:00

485 B

Here is an example for a keyboard with a dedicated on/off push button that is a direct wire between the GPIO pin and ground:

/ {
    keys {
        compatible = "gpio-keys";
        soft_off_gpio_key: soft_off_gpio_key {
            gpios = <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
        };
    };
};

In the above example the soft on/off would be triggered by pulling the specified pin low, typically by pressing a switch that has the other leg connected to ground.