Browse Source

Add QAZ shield

xmkb
tominabox1 4 years ago
parent
commit
ac3e4af1ce
  1. 6
      app/boards/shields/qaz/Kconfig.defconfig
  2. 2
      app/boards/shields/qaz/Kconfig.shield
  3. 22
      app/boards/shields/qaz/boards/nice_nano.overlay
  4. 26
      app/boards/shields/qaz/qaz.conf
  5. 75
      app/boards/shields/qaz/qaz.keymap
  6. 48
      app/boards/shields/qaz/qaz.overlay

6
app/boards/shields/qaz/Kconfig.defconfig

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
if SHIELD_QAZ
config ZMK_KEYBOARD_NAME
default "QAZ"
endif

2
app/boards/shields/qaz/Kconfig.shield

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
config SHIELD_MY_BOARD
def_bool $(shields_list_contains,qaz)

22
app/boards/shields/qaz/boards/nice_nano.overlay

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
mosi-pin = <47>;
// 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 = <21>; /* number of LEDs */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};

26
app/boards/shields/qaz/qaz.conf

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
CONFIG_ZMK_RGB_UNDERGLOW=n
# Use the STRIP config specific to the LEDs you're using
CONFIG_WS2812_STRIP=n
# Turn on logging, and set ZMK logging to debug output
CONFIG_LOG=y
CONFIG_ZMK_LOG_LEVEL_DBG=y
# Turn on USB CDC ACM device
CONFIG_USB=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_CDC_ACM=y
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=1024
CONFIG_USB_CDC_ACM_DEVICE_NAME="CDC_ACM"
CONFIG_USB_CDC_ACM_DEVICE_COUNT=1
# Enable serial console
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y
# Enable USB UART, and set the console device
CONFIG_UART_CONSOLE=y
CONFIG_USB_UART_CONSOLE=y
CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0"
CONFIG_USB_UART_DTR_WAIT=n

75
app/boards/shields/qaz/qaz.keymap

@ -0,0 +1,75 @@ @@ -0,0 +1,75 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/rgb.h>
#define DEFAULT 0
#define NUM_SYM 1
#define NAV 2
/ {
behaviors {
rst: behavior_tap_hold1 {
compatible = "zmk,behavior-tap-hold";
label = "Bootloader Tap - Reset Hold";
#binding-cells = <0>;
hold_ms = <200>;
bindings = <&bootloader>, <&reset>, <&kp BKSP>;
};
num_spc: behavior_tap_hold2 {
compatible = "zmk,behavior-tap-hold";
label = "Space Tap - Num/Sym Hold";
#binding-cells = <0>;
hold_ms = <300>;
bindings = <&kp SPC>, <&mo NUM_SYM>;
};
ent_nav: behavior_tap_hold{
compatible = "zmk,behavior-tap-hold";
label = "Return Tap - Nav Hold";
#binding-cells = <0>;
hold_ms = <100>;
bindings = <&kp RET>, <&mo NAV>;
};
com_col: behavior_tap_hold10 {
compatible = "zmk,behavior-tap-hold";
label = ", tap, hold";
#binding-cells = <0>;
hold_ms = <200>;
bindings = <&kp CMMA>, <&kp SCLN>, <&kp BKSP>;
};
};
};
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp QUOT
&kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O
&kp Z &kp X &kp C &kp V &kp B &kp K &kp M &com_col &kp DOT
&kp LSFT &kp LGUI &kp TAB &ent_nav &num_spc &kp LCTL &kp LALT &kp FSLH
>;
};
num_sym {
bindings = <
&kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0
&trans &trans &trans &trans &trans &trans &trans &trans &kp EQL &kp MINUS
&kp DEL &none &none &none &none &none &none &none &kp DOT
&rst &none &none &trans &trans &kp RET &trans &kp FSLH
>;
};
nav {
bindings = <
&none &none &none &none &none &none &none &kp UARW &none &kp BKSP
&trans &trans &trans &trans &none &none &kp LARW &kp DARW &kp RARW &none
&none &none &none &none &none &none &none &none &none
&rgb_ug RGB_TOG &rgb_ug RGB_EFF &none &trans &trans &kp RET &trans &kp FSLH
>;
};
};
};

48
app/boards/shields/qaz/qaz.overlay

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,underglow = &led_strip;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <7>;
rows = <6>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(4,0) RC(4,1) RC(4,2)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(5,0) RC(5,1) RC(5,2)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(4,3) RC(5,3)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(4,4)
>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro_d 8 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 2 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 9 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 6 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
Loading…
Cancel
Save