aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorhonorless <[email protected]>2024-07-07 21:37:52 -0400
committerPete Johanson <[email protected]>2024-09-06 13:02:15 -0600
commita2f32cc12ced6e06c84c3dffd63d7caa22175966 (patch)
tree9c98be43a379b9da2eaaba51c3dfc8829fca8afd /app
parent2a137bb675619db4869de83ac28c97990be1b63b (diff)
downloadzmk-a2f32cc12ced6e06c84c3dffd63d7caa22175966.tar.gz
zmk-a2f32cc12ced6e06c84c3dffd63d7caa22175966.zip
refactor(shield): tidbit
* Implement alternative matrix-transform. * Add missing wakeup-source attribute. * Revise README to provide more appropriate information. * Remove unnecessary files (partially-functional shield).
Diffstat (limited to 'app')
-rw-r--r--app/boards/shields/tidbit/README.md45
-rw-r--r--app/boards/shields/tidbit/boards/nice_nano.conf4
-rw-r--r--app/boards/shields/tidbit/boards/proton_c.conf0
-rw-r--r--app/boards/shields/tidbit/tidbit.conf6
-rw-r--r--app/boards/shields/tidbit/tidbit.dtsi111
-rw-r--r--app/boards/shields/tidbit/tidbit.keymap44
-rw-r--r--app/boards/shields/tidbit/tidbit.overlay125
-rw-r--r--app/boards/shields/tidbit/tidbit_19key.conf11
-rw-r--r--app/boards/shields/tidbit/tidbit_19key.keymap50
-rw-r--r--app/boards/shields/tidbit/tidbit_19key.overlay8
10 files changed, 166 insertions, 238 deletions
diff --git a/app/boards/shields/tidbit/README.md b/app/boards/shields/tidbit/README.md
index c68d38b9f1..b5500e1208 100644
--- a/app/boards/shields/tidbit/README.md
+++ b/app/boards/shields/tidbit/README.md
@@ -1,41 +1,6 @@
-# Building ZMK for the Tidbit
+# TIDBIT Compatibility Notes
-Some general notes/commands for building standard tidbit layouts from the assembly documentation.
-
-## Standard "Non Dense" Build
-
-```
-west build -p -d build/tidbit/default --board nice_nano -- -DSHIELD=tidbit
-```
-
-## Dense "19 keys" Build
-
-```
-west build -p -d build/tidbit/19_key --board nice_nano -- -DSHIELD=tidbit_19key
-```
-
-## LED Notes
-
-If you built your tidbit without the LEDs _and_ are using a nice!nano board, you'll need to change the following in your local tidbit config or add them to the end of the file.
-
-```
-CONFIG_ZMK_RGB_UNDERGLOW=n
-CONFIG_WS2812_STRIP=n
-```
-
-## Encoder Notes
-
-If you built your tidbit without encoders, you'll need to change the following in your local tidbit config or add them to the end of the file.
-
-```
-CONFIG_EC11=n
-CONFIG_EC11_TRIGGER_GLOBAL_THREAD=n
-```
-
-## OLED Builds
-
-If using an OLED screen, you'll need to change the following in your local tidbit config or add them to the end of the file.
-
-```
-CONFIG_ZMK_DISPLAY=y
-```
+- The top-left and top-right encoders share the same pins. Install only one, and enable/include EITHER `encoder_1` OR `encoder_1_top_row` in your keymap; not both.
+- `encoder_3` cannot be used at the same time as the OLED and/or HT16K33 modules, as it is wired to the same pins.
+ - While the HT16K33 hardware is supported by Zephyr, functionality may not have been implemented in ZMK for it.
+- `encoder_4` cannot be used at the same time as the TRRS jack, as it is wired to the same pins.
diff --git a/app/boards/shields/tidbit/boards/nice_nano.conf b/app/boards/shields/tidbit/boards/nice_nano.conf
deleted file mode 100644
index 14bed3d0fa..0000000000
--- a/app/boards/shields/tidbit/boards/nice_nano.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-# Enable underglow
-CONFIG_ZMK_RGB_UNDERGLOW=y
-# Use the STRIP config specific to the LEDs you're using
-CONFIG_WS2812_STRIP=y \ No newline at end of file
diff --git a/app/boards/shields/tidbit/boards/proton_c.conf b/app/boards/shields/tidbit/boards/proton_c.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/app/boards/shields/tidbit/boards/proton_c.conf
+++ /dev/null
diff --git a/app/boards/shields/tidbit/tidbit.conf b/app/boards/shields/tidbit/tidbit.conf
index 2909a855b0..82bd3477ea 100644
--- a/app/boards/shields/tidbit/tidbit.conf
+++ b/app/boards/shields/tidbit/tidbit.conf
@@ -5,7 +5,11 @@
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
-# Enable underglow
+# Uncomment to enable underglow
#CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
#CONFIG_WS2812_STRIP=y
+
+# Uncomment to enable the display
+# Note that an I2C OLED cannot be used at the same time as encoder 3.
+#CONFIG_ZMK_DISPLAY=y
diff --git a/app/boards/shields/tidbit/tidbit.dtsi b/app/boards/shields/tidbit/tidbit.dtsi
deleted file mode 100644
index 44fc919275..0000000000
--- a/app/boards/shields/tidbit/tidbit.dtsi
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2020 The ZMK Contributors
- *
- * SPDX-License-Identifier: MIT
- */
-
-#include <dt-bindings/zmk/matrix_transform.h>
-
-/ {
- kscan0: kscan {
- compatible = "zmk,kscan-gpio-matrix";
-
- diode-direction = "row2col";
-
- row-gpios
- = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- ;
-
- col-gpios
- = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- , <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
- ;
-
- };
-
- default_transform: keymap_transform_0 {
- compatible = "zmk,matrix-transform";
- columns = <4>;
- rows = <5>;
-
- map = <
- RC(0,1) RC(0,2) RC(0,3)
- RC(1,0) RC(1,1) RC(1,2) RC(1,3)
- RC(2,0) RC(2,1) RC(2,2) RC(2,3)
- RC(3,0) RC(3,1) RC(3,2) RC(3,3)
- RC(4,0) RC(4,1) RC(4,2) RC(4,3)
- >;
- };
-
- encoder_1_top_row: encoder_1_top_row {
- compatible = "alps,ec11";
- a-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- b-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- steps = <80>;
- status = "disabled";
- };
-
- encoder_1: encoder_1 {
- compatible = "alps,ec11";
- a-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- b-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- steps = <80>;
- status = "disabled";
- };
-
- encoder_2: encoder_2 {
- compatible = "alps,ec11";
- a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- b-gpios = <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- steps = <80>;
- status = "disabled";
- };
-
- encoder_3: encoder_3 {
- compatible = "alps,ec11";
- a-gpios = <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- b-gpios = <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- steps = <80>;
- status = "disabled";
- };
-
- encoder_4: encoder_4 {
- compatible = "alps,ec11";
- a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- b-gpios = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
- steps = <80>;
- status = "disabled";
- };
-
- chosen {
- zephyr,display = &oled;
- zmk,kscan = &kscan0;
- zmk,matrix-transform = &default_transform;
- };
-};
-
-&pro_micro_i2c {
- status = "okay";
-
- oled: ssd1306@3c {
- compatible = "solomon,ssd1306fb";
- reg = <0x3c>;
- width = <128>;
- height = <32>;
- segment-offset = <0>;
- page-offset = <0>;
- display-offset = <0>;
- multiplex-ratio = <31>;
- segment-remap;
- com-invdir;
- com-sequential;
- inversion-on;
- prechargep = <0x22>;
- };
-};
diff --git a/app/boards/shields/tidbit/tidbit.keymap b/app/boards/shields/tidbit/tidbit.keymap
index f212bfe353..2a31136519 100644
--- a/app/boards/shields/tidbit/tidbit.keymap
+++ b/app/boards/shields/tidbit/tidbit.keymap
@@ -6,20 +6,40 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
-#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/keys.h>
+#include <dt-bindings/zmk/outputs.h>
+
-&encoder_1_top_row {
+/* Enable ONLY ONE of the &encoder_1 nodes. They are wired to the same pins.*/
+/*
+&encoder_1 {
+ status = "okay";
+};
+&encoder_1_top_left {
status = "okay";
};
+*/
-/ {
- sensors: sensors {
- compatible = "zmk,keymap-sensors";
- sensors = <&encoder_1_top_row>;
- triggers-per-rotation = <20>;
- };
+/*
+&encoder_2 {
+ status = "okay";
+};
+
+&encoder_3 {
+ status = "okay";
+};
+*/
+
+&encoder_4 {
+ status = "okay";
+};
+/* Add any encoder(s) you have enabled to the sensors node, separated by spaces. */
+&sensors {
+ sensors = <&encoder_4>;
+};
+
+/ {
keymap {
compatible = "zmk,keymap";
@@ -27,9 +47,9 @@
bindings = <
&kp KP_NUMLOCK &kp KP_ASTERISK &kp KP_MINUS
&kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9 &kp KP_PLUS
- &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &none
+ &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &kp KP_SLASH
&kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &lt 1 KP_ENTER
- &none &kp KP_NUMBER_0 &kp KP_DOT &none
+ &kp C_MUTE &kp KP_NUMBER_0 &kp KP_DOT &kp KP_ENTER
>;
sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
@@ -37,10 +57,10 @@
func_layer {
bindings = <
- &none &sys_reset &bootloader
+ &none &sys_reset &bootloader
&out OUT_TOG &out OUT_USB &out OUT_BLE &none
&bt BT_SEL 0 &bt BT_PRV &bt BT_NXT &bt BT_CLR
- &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &tog 0
+ &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &trans
&kp C_MUTE &none &none &none
>;
diff --git a/app/boards/shields/tidbit/tidbit.overlay b/app/boards/shields/tidbit/tidbit.overlay
index dc425618ca..0f4e07b87b 100644
--- a/app/boards/shields/tidbit/tidbit.overlay
+++ b/app/boards/shields/tidbit/tidbit.overlay
@@ -4,4 +4,127 @@
* SPDX-License-Identifier: MIT
*/
-#include "tidbit.dtsi"
+#include <dt-bindings/zmk/matrix_transform.h>
+
+/ {
+ kscan0: kscan {
+ compatible = "zmk,kscan-gpio-matrix";
+ diode-direction = "row2col";
+ wakeup-source;
+
+ row-gpios
+ = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ ;
+
+ col-gpios
+ = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ , <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
+ ;
+
+ };
+
+ default_transform: keymap_transform_0 {
+ compatible = "zmk,matrix-transform";
+ columns = <4>;
+ rows = <5>;
+
+ map = <
+ RC(0,1) RC(0,2) RC(0,3)
+ RC(1,0) RC(1,1) RC(1,2) RC(1,3)
+ RC(2,0) RC(2,1) RC(2,2) RC(2,3)
+ RC(3,0) RC(3,1) RC(3,2) RC(3,3)
+ RC(4,0) RC(4,1) RC(4,2) RC(4,3)
+ >;
+ };
+
+ numpad_transform: keymap_transform_1 {
+ compatible = "zmk,matrix-transform";
+ columns = <4>;
+ rows = <5>;
+
+ map = <
+ RC(0,1) RC(0,2) RC(0,3)
+ RC(1,0) RC(1,1) RC(1,2) RC(1,3)
+ RC(2,0) RC(2,1) RC(2,2)
+ RC(3,0) RC(3,1) RC(3,2) RC(3,3)
+ RC(4,0) RC(4,1) RC(4,2)
+ >;
+ };
+
+ encoder_1_top_row: encoder_1_top_row {
+ compatible = "alps,ec11";
+ a-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ encoder_1: encoder_1 {
+ compatible = "alps,ec11";
+ a-gpios = <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ encoder_2: encoder_2 {
+ compatible = "alps,ec11";
+ a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ encoder_3: encoder_3 {
+ compatible = "alps,ec11";
+ a-gpios = <&pro_micro 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ encoder_4: encoder_4 {
+ compatible = "alps,ec11";
+ a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ b-gpios = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ steps = <80>;
+ status = "disabled";
+ };
+
+ sensors: sensors {
+ compatible = "zmk,keymap-sensors";
+ triggers-per-rotation = <20>;
+ };
+
+ chosen {
+ zephyr,display = &oled;
+ zmk,kscan = &kscan0;
+ zmk,matrix-transform = &default_transform;
+ };
+};
+
+&pro_micro_i2c {
+ status = "okay";
+
+ oled: ssd1306@3c {
+ compatible = "solomon,ssd1306fb";
+ reg = <0x3c>;
+ width = <128>;
+ height = <32>;
+ segment-offset = <0>;
+ page-offset = <0>;
+ display-offset = <0>;
+ multiplex-ratio = <31>;
+ segment-remap;
+ com-invdir;
+ com-sequential;
+ inversion-on;
+ prechargep = <0x22>;
+ };
+};
diff --git a/app/boards/shields/tidbit/tidbit_19key.conf b/app/boards/shields/tidbit/tidbit_19key.conf
deleted file mode 100644
index 2909a855b0..0000000000
--- a/app/boards/shields/tidbit/tidbit_19key.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2020 The ZMK Contributors
-# SPDX-License-Identifier: MIT
-
-# Enable Encoders
-CONFIG_EC11=y
-CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
-
-# Enable underglow
-#CONFIG_ZMK_RGB_UNDERGLOW=y
-# Use the STRIP config specific to the LEDs you're using
-#CONFIG_WS2812_STRIP=y
diff --git a/app/boards/shields/tidbit/tidbit_19key.keymap b/app/boards/shields/tidbit/tidbit_19key.keymap
deleted file mode 100644
index a2991a3f4c..0000000000
--- a/app/boards/shields/tidbit/tidbit_19key.keymap
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2020 The ZMK Contributors
- *
- * SPDX-License-Identifier: MIT
- */
-
-#include "tidbit.dtsi"
-#include <behaviors.dtsi>
-#include <dt-bindings/zmk/keys.h>
-#include <dt-bindings/zmk/bt.h>
-#include <dt-bindings/zmk/outputs.h>
-
-&encoder_4 {
- status = "okay";
-};
-
-/ {
- sensors: sensors {
- compatible = "zmk,keymap-sensors";
- sensors = <&encoder_4>;
- };
-
- keymap {
- compatible = "zmk,keymap";
-
- default_layer {
- bindings = <
- &tog 1 &kp KP_NUMLOCK &kp KP_SLASH
- &kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9 &kp KP_ASTERISK
- &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &kp KP_MINUS
- &kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &kp KP_PLUS
- &kp C_MUTE &kp KP_NUMBER_0 &kp KP_DOT &kp KP_ENTER
- >;
-
- sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
- };
-
- func_layer {
- bindings = <
- &tog 0 &sys_reset &bootloader
- &out OUT_TOG &out OUT_USB &out OUT_BLE &none
- &bt BT_SEL 0 &bt BT_PRV &bt BT_NXT &bt BT_CLR
- &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none
- &kp C_MUTE &none &none &none
- >;
-
- sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
- };
- };
-};
diff --git a/app/boards/shields/tidbit/tidbit_19key.overlay b/app/boards/shields/tidbit/tidbit_19key.overlay
deleted file mode 100644
index dc46233ed7..0000000000
--- a/app/boards/shields/tidbit/tidbit_19key.overlay
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (c) 2020 The ZMK Contributors
- *
- * SPDX-License-Identifier: MIT
- */
-
-#include "tidbit.dtsi"
-#include "tidbit_19key.keymap"