Finalize initial bring up of tidbit on zmk

This commit is contained in:
kemonine 2020-11-21 19:54:26 -05:00
parent dec50b3d3f
commit 78a3e5e752
8 changed files with 71 additions and 53 deletions

View file

@ -4,9 +4,13 @@
if SHIELD_TIDBIT if SHIELD_TIDBIT
config ZMK_KEYBOARD_NAME config ZMK_KEYBOARD_NAME
default "TIDBIT" default "TIDBIT_DEFAULT"
config ZMK_USB endif
default y
if SHIELD_TIDBIT_19
config ZMK_KEYBOARD_NAME
default "TIDBIT_19"
endif endif

View file

@ -2,4 +2,7 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
config SHIELD_TIDBIT 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)

View file

@ -1,28 +1,28 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
&spi1 { &spi1 {
compatible = "nordic,nrf-spim"; compatible = "nordic,nrf-spim";
status = "okay"; status = "okay";
mosi-pin = <10>; mosi-pin = <9>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>; sck-pin = <5>;
miso-pin = <7>; miso-pin = <7>;
led_strip: ws2812@0 { led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi"; compatible = "worldsemi,ws2812-spi";
label = "WS2812"; label = "WS2812";
/* SPI */ /* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */ reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>; spi-max-frequency = <4000000>;
/* WS2812 */ /* WS2812 */
chain-length = <8>; /* arbitrary; change at will */ chain-length = <10>; /* number of LEDs */
spi-one-frame = <0x70>; spi-one-frame = <0x70>;
spi-zero-frame = <0x40>; spi-zero-frame = <0x40>;
}; };
};
/ {
chosen {
zmk,underglow = &led_strip;
};
}; };

View file

@ -1,6 +1,11 @@
# Copyright (c) 2020 The ZMK Contributors # Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# Uncomment to enable encoder # Enable Encoders
CONFIG_EC11=y CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=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

View file

@ -92,5 +92,6 @@
chosen { chosen {
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
zmk,underglow = &led_strip;
}; };
}; };

View file

@ -7,21 +7,15 @@
#include <behaviors.dtsi> #include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h> #include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h> #include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
/ { / {
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1_top_row>;
};
keymap { keymap {
compatible = "zmk,keymap"; compatible = "zmk,keymap";
default_layer { default_layer {
bindings = < 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_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_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &kp &none
&kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &lt 1 KP_ENTER &kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &lt 1 KP_ENTER
@ -33,11 +27,11 @@
func_layer { func_layer {
bindings = < bindings = <
&none &rgb_ug RGB_TOG &none &none &none &none
&none &bt BT_CLR_CMD &rgb_ug RGB_EFF &out OUT_TOG &none &bt BT_CLR_CMD &none &out OUT_TOG
&none &bt BT_NXT_CMD &rgb_ug RGB_HUI &out OUT_BLE &none &bt BT_NXT_CMD &none &out OUT_BLE
&reset &bt BT_PRV_CMD &rgb_ug RGB_SAI &out OUT_USB &reset &bt BT_PRV_CMD &none &out OUT_USB
&bootloader &bt BT_SEL_CMD &rgb_ug RGB_BRI &tog 0 &bootloader &bt BT_SEL_CMD &none &tog 0
>; >;
sensor-bindings = <&inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>; sensor-bindings = <&inc_dec_kp K_VOLUME_UP K_VOLUME_DOWN>;

View file

@ -16,26 +16,26 @@
default_layer { default_layer {
bindings = < bindings = <
&tog 1 &kp KP_NUMLOCK &kp KP_SLASH &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_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_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 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 &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 { func_layer {
bindings = < bindings = <
&tog 0 &bootloader &reset &tog 0 &bootloader &reset
&none &bt BT_CLR_CMD &kp RGB_EFF &out OUT_TOG &none &bt BT_CLR_CMD &none &out OUT_TOG
&none &bt BT_NEXT_CMD &kp RGB_HUI &out OUT_BLE &none &bt BT_NEXT_CMD &none &out OUT_BLE
&none &bt BT_PRV_CMD &kp RGB_SAI &out OUT_USB &none &bt BT_PRV_CMD &none &out OUT_USB
&none &bt BT_SEL_CMD &kp RGB_BRI &none &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>;
}; };
}; };
}; };

View file

@ -0,0 +1,11 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "tidbit.dtsi"
&encoder_4 {
status = "okay";
};