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,7 +1,13 @@
/*
* 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>;
@ -15,14 +21,8 @@
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,15 +7,9 @@
#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";
@ -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

@ -23,19 +23,19 @@
&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";
};