diff --git a/zephcore/boards/esp32/ttgo_tbeam/board.overlay b/zephcore/boards/esp32/ttgo_tbeam/board.overlay index 86baa76..7373c1e 100644 --- a/zephcore/boards/esp32/ttgo_tbeam/board.overlay +++ b/zephcore/boards/esp32/ttgo_tbeam/board.overlay @@ -24,6 +24,47 @@ */ #include +#include + +/* + * User button — GPIO38, the middle button on the T-Beam (Arduino PIN_USER_BTN=38, + * Meshtastic BUTTON_PIN=38). The upstream ttgo_tbeam DTS defines no button, so + * declare the full gpio-keys node plus the single-button input chain the UI + * consumes (short press = page/select, long press = action), same scheme as the + * heltec_wifi_lora32_v3 companion. + * + * GPIO38 is input-only on the classic ESP32 (GPIO34-39 have no internal pull + * resistors), so request no pull and rely on the board's external pull-up — the + * button shorts the line to GND when pressed. (Arduino/Meshtastic set a pull-up + * flag here too, but it is a no-op on this pin; the external pull-up is real.) + */ +/ { + buttons: buttons { + compatible = "gpio-keys"; + + user_button: button_0 { + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; /* GPIO38 = gpio1 pin 6 */ + label = "User Button"; + zephyr,code = ; + }; + }; + + user_btn_longpress { + compatible = "zephyr,input-longpress"; + input = <&buttons>; + input-codes = ; + short-codes = ; + long-codes = ; + long-delay-ms = <1000>; + }; + + page_btn_multitap { + compatible = "zephcore,input-multi-tap"; + input-codes = ; + tap-codes = ; + tap-delay-ms = <400>; + }; +}; /* * BT HCI controller. The upstream ttgo_tbeam DTS does not select the ESP32 BT