diff --git a/zmk/app/boards/shields/tidbit/Kconfig.defconfig b/zmk/app/boards/shields/tidbit/Kconfig.defconfig index 11ea5bb6..1d177b1a 100644 --- a/zmk/app/boards/shields/tidbit/Kconfig.defconfig +++ b/zmk/app/boards/shields/tidbit/Kconfig.defconfig @@ -4,9 +4,13 @@ if SHIELD_TIDBIT config ZMK_KEYBOARD_NAME - default "TIDBIT" - -config ZMK_USB - default y + default "TIDBIT_DEFAULT" + +endif + +if SHIELD_TIDBIT_19 + +config ZMK_KEYBOARD_NAME + default "TIDBIT_19" endif diff --git a/zmk/app/boards/shields/tidbit/Kconfig.shield b/zmk/app/boards/shields/tidbit/Kconfig.shield index c1e8ecca..506756de 100644 --- a/zmk/app/boards/shields/tidbit/Kconfig.shield +++ b/zmk/app/boards/shields/tidbit/Kconfig.shield @@ -2,4 +2,7 @@ # SPDX-License-Identifier: MIT config SHIELD_TIDBIT - def_bool $(shields_list_contains,tidbit) + def_bool $(shields_list_contains,tidbit_default) + +config SHIELD_TIDBIT_19 + def_bool $(shields_list_contains,tidbit_19keys) diff --git a/zmk/app/boards/shields/tidbit/boards/nice_nano.overlay b/zmk/app/boards/shields/tidbit/boards/nice_nano.overlay index 01fea2eb..d26ca265 100644 --- a/zmk/app/boards/shields/tidbit/boards/nice_nano.overlay +++ b/zmk/app/boards/shields/tidbit/boards/nice_nano.overlay @@ -1,28 +1,28 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + &spi1 { - compatible = "nordic,nrf-spim"; - status = "okay"; - mosi-pin = <10>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <9>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; - /* SPI */ - reg = <0>; /* ignored, but necessary for SPI bindings */ - spi-max-frequency = <4000000>; + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; - /* WS2812 */ - chain-length = <8>; /* arbitrary; change at will */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; - }; -}; - -/ { - chosen { - zmk,underglow = &led_strip; - }; + /* WS2812 */ + chain-length = <10>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; }; diff --git a/zmk/app/boards/shields/tidbit/tidbit.conf b/zmk/app/boards/shields/tidbit/tidbit.conf index 10b1d959..2f3ab141 100644 --- a/zmk/app/boards/shields/tidbit/tidbit.conf +++ b/zmk/app/boards/shields/tidbit/tidbit.conf @@ -1,6 +1,11 @@ # Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT -# Uncomment to enable encoder +# 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/zmk/app/boards/shields/tidbit/tidbit.dtsi b/zmk/app/boards/shields/tidbit/tidbit.dtsi index 5fba8727..d2e621c1 100644 --- a/zmk/app/boards/shields/tidbit/tidbit.dtsi +++ b/zmk/app/boards/shields/tidbit/tidbit.dtsi @@ -92,5 +92,6 @@ chosen { zmk,kscan = &kscan0; zmk,matrix_transform = &default_transform; + zmk,underglow = &led_strip; }; }; diff --git a/zmk/app/boards/shields/tidbit/tidbit.keymap b/zmk/app/boards/shields/tidbit/tidbit.keymap index 4d443c5a..9826fe3d 100644 --- a/zmk/app/boards/shields/tidbit/tidbit.keymap +++ b/zmk/app/boards/shields/tidbit/tidbit.keymap @@ -7,21 +7,15 @@ #include #include #include -#include #include / { - sensors { - compatible = "zmk,keymap-sensors"; - sensors = <&encoder_1_top_row>; - }; - keymap { compatible = "zmk,keymap"; default_layer { bindings = < - &kp KP_NUMLOCK &kp KP_ASTERISK &kp KP_MINUS + &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 &kp &none &kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 < 1 KP_ENTER @@ -33,11 +27,11 @@ func_layer { bindings = < - &none &rgb_ug RGB_TOG &none - &none &bt BT_CLR_CMD &rgb_ug RGB_EFF &out OUT_TOG - &none &bt BT_NXT_CMD &rgb_ug RGB_HUI &out OUT_BLE - &reset &bt BT_PRV_CMD &rgb_ug RGB_SAI &out OUT_USB - &bootloader &bt BT_SEL_CMD &rgb_ug RGB_BRI &tog 0 + &none &none &none + &none &bt BT_CLR_CMD &none &out OUT_TOG + &none &bt BT_NXT_CMD &none &out OUT_BLE + &reset &bt BT_PRV_CMD &none &out OUT_USB + &bootloader &bt BT_SEL_CMD &none &tog 0 >; sensor-bindings = <&inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; diff --git a/zmk/app/boards/shields/tidbit/tidbit_19key.keymap b/zmk/app/boards/shields/tidbit/tidbit_19key.keymap index 565c1d42..75c6ccf9 100644 --- a/zmk/app/boards/shields/tidbit/tidbit_19key.keymap +++ b/zmk/app/boards/shields/tidbit/tidbit_19key.keymap @@ -16,26 +16,26 @@ default_layer { bindings = < - &tog 1 &kp KP_NUMLOCK &kp KP_SLASH - &kp KP_NUBMER_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 - &none &kp KP_NUMBER_0 &kp KP_DOT &kp KP_ENTER + &tog 1 &kp KP_NUMLOCK &kp KP_SLASH + &kp KP_NUBMER_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 + &none &kp KP_NUMBER_0 &kp KP_DOT &kp KP_ENTER >; - sensor-bindings = <&inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; + sensor-bindings = <&inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; }; func_layer { bindings = < - &tog 0 &bootloader &reset - &none &bt BT_CLR_CMD &kp RGB_EFF &out OUT_TOG - &none &bt BT_NEXT_CMD &kp RGB_HUI &out OUT_BLE - &none &bt BT_PRV_CMD &kp RGB_SAI &out OUT_USB - &none &bt BT_SEL_CMD &kp RGB_BRI &none + &tog 0 &bootloader &reset + &none &bt BT_CLR_CMD &none &out OUT_TOG + &none &bt BT_NEXT_CMD &none &out OUT_BLE + &none &bt BT_PRV_CMD &none &out OUT_USB + &none &bt BT_SEL_CMD &none &none >; - sensor-bindings = <&inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp &none &none &inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; + sensor-bindings = <&inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; }; }; }; diff --git a/zmk/app/boards/shields/tidbit/tidbit_19key.overlay b/zmk/app/boards/shields/tidbit/tidbit_19key.overlay new file mode 100644 index 00000000..5738d837 --- /dev/null +++ b/zmk/app/boards/shields/tidbit/tidbit_19key.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "tidbit.dtsi" + +&encoder_4 { + status = "okay"; +};