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
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

View File

@ -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)

View File

@ -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>;
};
};

View File

@ -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

View File

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

View File

@ -7,21 +7,15 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/keys.h>
/ {
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 &lt 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>;

View File

@ -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>;
};
};
};

View File

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