diff options
author | Peter Johanson <[email protected]> | 2023-09-16 11:50:12 -0700 |
---|---|---|
committer | Pete Johanson <[email protected]> | 2024-03-27 20:59:26 -0700 |
commit | d3fffb9e8913105bc732eb9cbfbd380a9b98167e (patch) | |
tree | 79066526ad5129939c8b9e0865d9ae05b46b8bfc | |
parent | b19df0cbf053a88a9389bdf463df431e5b7e70a5 (diff) | |
download | zmk-d3fffb9e8913105bc732eb9cbfbd380a9b98167e.tar.gz zmk-d3fffb9e8913105bc732eb9cbfbd380a9b98167e.zip |
feat(shields): Add soft-off to the nrf52840dk ZMK Uno
* Use Button 1 for soft off on the nrf52840 when using the ZMK Uno
shield.
-rw-r--r-- | app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.overlay | 43 | ||||
-rw-r--r-- | app/boards/shields/zmk_uno/zmk_uno.dtsi | 2 |
2 files changed, 44 insertions, 1 deletions
diff --git a/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.overlay b/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.overlay index 05c7ed9d8e..d08105c688 100644 --- a/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.overlay +++ b/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.overlay @@ -12,6 +12,15 @@ bias-pull-up; }; }; + + qdec_sleep: qdec_sleep { + group1 { + psels = <NRF_PSEL(QDEC_A, 1, 11)>, + <NRF_PSEL(QDEC_B, 1, 10)>; + bias-pull-up; + low-power-enable; + }; + }; }; // Set up the QDEC hardware based driver and give it the same label as the deleted node. @@ -20,6 +29,38 @@ encoder: &qdec0 { led-pre = <0>; steps = <80>; pinctrl-0 = <&qdec_default>; - pinctrl-1 = <&qdec_default>; + pinctrl-1 = <&qdec_sleep>; pinctrl-names = "default", "sleep"; }; + +/ { + behaviors { + soft_off: soft_off { + compatible = "zmk,behavior-soft-off"; + #binding-cells = <0>; + status = "okay"; + }; + }; + + wakeup_source: wakeup_source { + compatible = "zmk,wakeup-trigger-key"; + status = "okay"; + + trigger = <&button0>; + wakeup-source; + }; + + soft_off_wakers { + compatible = "zmk,soft-off-wakeup-sources"; + status = "okay"; + + wakeup-sources = <&wakeup_source>; + }; + + soft_off_behavior_key { + compatible = "zmk,behavior-key"; + status = "okay"; + bindings = <&soft_off>; + key = <&button0>; + }; +};
\ No newline at end of file diff --git a/app/boards/shields/zmk_uno/zmk_uno.dtsi b/app/boards/shields/zmk_uno/zmk_uno.dtsi index 63deb06a4d..196ac8b500 100644 --- a/app/boards/shields/zmk_uno/zmk_uno.dtsi +++ b/app/boards/shields/zmk_uno/zmk_uno.dtsi @@ -124,6 +124,7 @@ nice_view_spi: &arduino_spi { kscan_matrix: kscan_matrix { compatible = "zmk,kscan-gpio-matrix"; + wakeup-source; diode-direction = "col2row"; @@ -141,6 +142,7 @@ nice_view_spi: &arduino_spi { kscan_direct: kscan_direct { compatible = "zmk,kscan-gpio-direct"; + wakeup-source; status = "disabled"; input-gpios |