Refactor nibble / update to match build docs (#620)
* feat(nibble): add underglow support for nice_nano builds * feat(nibble): add encoder to top, left most column to match standard assembly documentation * refactor(nibble): add layer labels * feat(nibble): add support for optional display ; off by default * feat(nibble): add README * fix(nibble): adjust oled rotation for easier reading * fix(nibble): add additional note about enabling oled * refactor(nibble): convert keymap to use tabs instead of spaces * refactor(nibble): enable oled in dts/overlay by default * refactor(nibble): cleanup alignment and formatting in nibble keymap * refactor(nibble): re-align top most row of keymap to be sensible * refactor(nibble): cleanup kscan map alignment * refactor(nibble): indent first row of map/transform to properly align with physical columns * fix(nibble): remove dangling code block from readme Co-authored-by: KemoNine <mcrosson@kemonine.info>
This commit is contained in:
parent
e40ca1eb7c
commit
0499e7e8ac
8 changed files with 175 additions and 31 deletions
|
@ -11,3 +11,38 @@ config ZMK_USB
|
|||
|
||||
endif
|
||||
|
||||
if ZMK_DISPLAY
|
||||
|
||||
config I2C
|
||||
default y
|
||||
|
||||
config SSD1306
|
||||
default y
|
||||
|
||||
config SSD1306_REVERSE_MODE
|
||||
default y
|
||||
|
||||
endif # ZMK_DISPLAY
|
||||
|
||||
if LVGL
|
||||
|
||||
config LVGL_HOR_RES_MAX
|
||||
default 128
|
||||
|
||||
config LVGL_VER_RES_MAX
|
||||
default 32
|
||||
|
||||
config LVGL_VDB_SIZE
|
||||
default 64
|
||||
|
||||
config LVGL_DPI
|
||||
default 148
|
||||
|
||||
config LVGL_BITS_PER_PIXEL
|
||||
default 1
|
||||
|
||||
choice LVGL_COLOR_DEPTH
|
||||
default LVGL_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
|
29
app/boards/shields/nibble/README.md
Normal file
29
app/boards/shields/nibble/README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Building ZMK for the Nibble
|
||||
|
||||
Some general notes/commands for building standard nibble layouts from the assembly documentation.
|
||||
|
||||
## LED Notes
|
||||
|
||||
If you built your nibble without the LEDs _and_ are using a nice!nano board, you'll need to change the following in your local nibble 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 nibble without an encoder, you'll need to change the following in your local nibble 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 nibble config or add them to the end of the file.
|
||||
|
||||
```
|
||||
CONFIG_ZMK_DISPLAY=y
|
||||
```
|
4
app/boards/shields/nibble/boards/nice_nano.conf
Normal file
4
app/boards/shields/nibble/boards/nice_nano.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Enable underglow
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
# Use the STRIP config specific to the LEDs you're using
|
||||
CONFIG_WS2812_STRIP=y
|
34
app/boards/shields/nibble/boards/nice_nano.overlay
Normal file
34
app/boards/shields/nibble/boards/nice_nano.overlay
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
mosi-pin = <11>;
|
||||
// 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";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <10>; /* number of LEDs */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,underglow = &led_strip;
|
||||
};
|
||||
};
|
1
app/boards/shields/nibble/boards/proton_c.conf
Normal file
1
app/boards/shields/nibble/boards/proton_c.conf
Normal file
|
@ -0,0 +1 @@
|
|||
CONFIG_SENSOR=y
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) 2020 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Enable Encoders
|
||||
CONFIG_EC11=y
|
||||
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
|
@ -8,27 +8,37 @@
|
|||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
|
||||
#define DEFAULT 0
|
||||
#define FUNC 1
|
||||
|
||||
/ {
|
||||
sensors {
|
||||
compatible = "zmk,keymap-sensors";
|
||||
sensors = <&encoder_1>;
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
label = "Default";
|
||||
|
||||
sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
|
||||
|
||||
bindings = <
|
||||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp HOME
|
||||
&kp C_VOL_UP &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp DEL
|
||||
&kp C_VOL_DN &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP
|
||||
&kp C_MUTE &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp DEL
|
||||
&trans &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP
|
||||
&trans &kp LSHFT &trans &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
|
||||
&trans &kp LCTRL &kp LGUI &kp LALT &kp SPACE &mo FUNC &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT
|
||||
&trans &kp LCTRL &kp LGUI &kp LALT &kp SPACE &mo 1 &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT
|
||||
>;
|
||||
};
|
||||
func {
|
||||
function_layer {
|
||||
label = "Function";
|
||||
|
||||
sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
|
||||
|
||||
bindings = <
|
||||
&kp TILDE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &kp END
|
||||
&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &bootloader
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&kp C_MUTE &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &bootloader
|
||||
&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_PRV &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||
&bt BT_NXT &trans &trans &trans &trans &trans &trans &trans &kp C_PREV &kp C_PP &kp C_NEXT
|
||||
>;
|
||||
|
|
|
@ -12,6 +12,15 @@
|
|||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
encoder_1: encoder_1 {
|
||||
compatible = "alps,ec11";
|
||||
label = "Encoder 1";
|
||||
a-gpios = <&pro_micro_d 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||
b-gpios = <&pro_micro_d 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||
resolution = <4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-demux";
|
||||
label = "KSCAN";
|
||||
|
@ -36,8 +45,6 @@
|
|||
columns = <16>;
|
||||
rows = <5>;
|
||||
|
||||
//TODO: Add a keymap graphic here
|
||||
|
||||
map = <
|
||||
RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,15)
|
||||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) RC(1,14) RC(1,15)
|
||||
|
@ -47,3 +54,21 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,6) RC(4,9)
|
|||
>;
|
||||
};
|
||||
};
|
||||
|
||||
&pro_micro_i2c {
|
||||
status = "okay";
|
||||
|
||||
oled: ssd1306@3c {
|
||||
compatible = "solomon,ssd1306fb";
|
||||
reg = <0x3c>;
|
||||
label = "DISPLAY";
|
||||
width = <128>;
|
||||
height = <32>;
|
||||
segment-offset = <0>;
|
||||
page-offset = <0>;
|
||||
display-offset = <0>;
|
||||
multiplex-ratio = <31>;
|
||||
com-sequential;
|
||||
prechargep = <0x22>;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue