-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
206 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if SHIELD_REGRET | ||
|
||
config ZMK_KEYBOARD_NAME | ||
default "Re-gret" | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config SHIELD_REGRET | ||
def_bool $(shields_list_contains,regret) | ||
select SPI |
2 changes: 2 additions & 0 deletions
2
firmware/zmk/config/boards/shields/regret/boards/seeeduino_xiao.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_SPI=y | ||
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y |
1 change: 1 addition & 0 deletions
1
firmware/zmk/config/boards/shields/regret/boards/seeeduino_xiao_ble.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_SPI=y |
66 changes: 66 additions & 0 deletions
66
firmware/zmk/config/boards/shields/regret/boards/seeeduino_xiao_ble.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* Shift register */ | ||
|
||
&spi2_default { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, | ||
<NRF_PSEL(SPIM_MOSI, 1, 15)>; | ||
}; | ||
}; | ||
|
||
&spi2_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, | ||
<NRF_PSEL(SPIM_MOSI, 1, 15)>; | ||
}; | ||
}; | ||
|
||
|
||
/* LED underglow */ | ||
|
||
#include <dt-bindings/led/led.h> | ||
|
||
&pinctrl { | ||
spi3_default: spi3_default { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_MOSI, 0, 2)>; | ||
}; | ||
}; | ||
|
||
spi3_sleep: spi3_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_MOSI, 0, 2)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&spi3 { | ||
compatible = "nordic,nrf-spim"; | ||
status = "okay"; | ||
|
||
pinctrl-0 = <&spi3_default>; | ||
pinctrl-1 = <&spi3_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
|
||
led_strip: ws2812@0 { | ||
compatible = "worldsemi,ws2812-spi"; | ||
|
||
/* SPI */ | ||
reg = <0>; /* ignored, but necessary for SPI bindings */ | ||
spi-max-frequency = <4000000>; | ||
|
||
/* WS2812 */ | ||
chain-length = <11>; /* number of LEDs */ | ||
spi-one-frame = <0x70>; | ||
spi-zero-frame = <0x40>; | ||
color-mapping = <LED_COLOR_ID_GREEN | ||
LED_COLOR_ID_RED | ||
LED_COLOR_ID_BLUE>; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zmk,underglow = &led_strip; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Uncomment the following lines to enable RGB underglow | ||
# CONFIG_ZMK_RGB_UNDERGLOW=y | ||
CONFIG_WS2812_STRIP=y | ||
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n | ||
CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_USB=y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/keys.h> | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
// ------------------------------------------------------------------------------------------------------ | ||
// | Q | W | E | R | T | Y | U | I | O | P | | ||
// | A | S | D | F | G | H | J | K | L | ; | | ||
// | Z | X | C | V | B | N | M | , | . | / | | ||
// | ESC | SPACE | RETURN | BSPC | | ||
bindings = < | ||
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P | ||
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI | ||
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH | ||
&kp ESC &kp SPACE &kp RET &kp BSPC | ||
>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include <dt-bindings/zmk/matrix_transform.h> | ||
|
||
&xiao_serial { status = "disabled"; }; | ||
|
||
&xiao_spi { | ||
status = "okay"; | ||
cs-gpios = <&xiao_d 9 GPIO_ACTIVE_LOW>; | ||
shifter: 595@0 { | ||
compatible = "zmk,gpio-595"; | ||
status = "okay"; | ||
gpio-controller; | ||
spi-max-frequency = <200000>; | ||
reg = <0>; | ||
#gpio-cells = <2>; | ||
ngpios = <8>; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zmk,kscan = &kscan0; | ||
zmk,matrix_transform = &default_transform; | ||
}; | ||
|
||
default_transform: keymap_transform_0 { | ||
compatible = "zmk,matrix-transform"; | ||
columns = <5>; | ||
rows = <8>; | ||
map = < | ||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(4,4) RC(4,3) RC(4,2) RC(4,1) RC(4,0) | ||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(5,4) RC(5,3) RC(5,2) RC(5,1) RC(5,0) | ||
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(6,4) RC(6,3) RC(6,2) RC(6,1) RC(6,0) | ||
RC(3,3) RC(3,4) RC(7,4) RC(7,3) | ||
>; | ||
}; | ||
|
||
kscan0: kscan_0 { | ||
compatible = "zmk,kscan-gpio-matrix"; | ||
diode-direction = "row2col"; | ||
wakeup-source; | ||
|
||
col-gpios | ||
= <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&xiao_d 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&xiao_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&xiao_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
; | ||
|
||
row-gpios | ||
= <&shifter 7 GPIO_ACTIVE_HIGH> | ||
, <&shifter 6 GPIO_ACTIVE_HIGH> | ||
, <&shifter 5 GPIO_ACTIVE_HIGH> | ||
, <&shifter 4 GPIO_ACTIVE_HIGH> | ||
, <&shifter 0 GPIO_ACTIVE_HIGH> | ||
, <&shifter 1 GPIO_ACTIVE_HIGH> | ||
, <&shifter 2 GPIO_ACTIVE_HIGH> | ||
, <&shifter 3 GPIO_ACTIVE_HIGH> | ||
; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
file_format: "1" | ||
id: regret | ||
name: Re-gret | ||
type: shield | ||
url: https://github.com/rschenk/regret | ||
requires: [seeed_xiao] | ||
features: | ||
- keys |