Skip to content

Commit afb389f

Browse files
committed
new pcb rev
1 parent 4f920f6 commit afb389f

15 files changed

Lines changed: 552 additions & 2 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) 2020 Ryan Cross
2+
# SPDX-License-Identifier: MIT
3+
4+
if SHIELD_SOFLE_LEFT
5+
6+
config ZMK_KEYBOARD_NAME
7+
default "Sofle"
8+
9+
config ZMK_SPLIT_ROLE_CENTRAL
10+
default y
11+
12+
endif
13+
14+
if SHIELD_SOFLE_LEFT || SHIELD_SOFLE_RIGHT
15+
16+
config ZMK_SPLIT
17+
default y
18+
19+
if ZMK_DISPLAY
20+
21+
config I2C
22+
default y
23+
24+
config SSD1306
25+
default y
26+
27+
endif # ZMK_DISPLAY
28+
29+
if LVGL
30+
31+
config LV_Z_VDB_SIZE
32+
default 64
33+
34+
config LV_DPI_DEF
35+
default 148
36+
37+
config LV_Z_BITS_PER_PIXEL
38+
default 1
39+
40+
choice LV_COLOR_DEPTH
41+
default LV_COLOR_DEPTH_1
42+
endchoice
43+
44+
endif # LVGL
45+
46+
if ZMK_RGB_UNDERGLOW
47+
48+
config WS2812_STRIP
49+
default y
50+
endif
51+
52+
endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2020 Ryan Cross
2+
# SPDX-License-Identifier: MIT
3+
4+
config SHIELD_SOFLE_LEFT
5+
def_bool $(shields_list_contains,sofle_left)
6+
7+
config SHIELD_SOFLE_RIGHT
8+
def_bool $(shields_list_contains,sofle_right)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include <dt-bindings/led/led.h>
2+
3+
&pinctrl {
4+
spi3_default: spi3_default {
5+
group1 {
6+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
7+
};
8+
};
9+
10+
spi3_sleep: spi3_sleep {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
13+
low-power-enable;
14+
};
15+
};
16+
};
17+
18+
&spi3 {
19+
compatible = "nordic,nrf-spim";
20+
status = "okay";
21+
22+
pinctrl-0 = <&spi3_default>;
23+
pinctrl-1 = <&spi3_sleep>;
24+
pinctrl-names = "default", "sleep";
25+
26+
led_strip: ws2812@0 {
27+
compatible = "worldsemi,ws2812-spi";
28+
29+
/* SPI */
30+
reg = <0>; /* ignored, but necessary for SPI bindings */
31+
spi-max-frequency = <4000000>;
32+
33+
/* WS2812 */
34+
chain-length = <36>; /* arbitrary; change at will */
35+
spi-one-frame = <0x70>;
36+
spi-zero-frame = <0x40>;
37+
38+
color-mapping = <
39+
LED_COLOR_ID_GREEN
40+
LED_COLOR_ID_RED
41+
LED_COLOR_ID_BLUE
42+
>;
43+
};
44+
};
45+
46+
/ {
47+
chosen {
48+
zmk,underglow = &led_strip;
49+
};
50+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include <dt-bindings/led/led.h>
2+
3+
&pinctrl {
4+
spi3_default: spi3_default {
5+
group1 {
6+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
7+
};
8+
};
9+
10+
spi3_sleep: spi3_sleep {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
13+
low-power-enable;
14+
};
15+
};
16+
};
17+
18+
&spi3 {
19+
compatible = "nordic,nrf-spim";
20+
status = "okay";
21+
22+
pinctrl-0 = <&spi3_default>;
23+
pinctrl-1 = <&spi3_sleep>;
24+
pinctrl-names = "default", "sleep";
25+
26+
led_strip: ws2812@0 {
27+
compatible = "worldsemi,ws2812-spi";
28+
29+
/* SPI */
30+
reg = <0>; /* ignored, but necessary for SPI bindings */
31+
spi-max-frequency = <4000000>;
32+
33+
/* WS2812 */
34+
chain-length = <36>; /* arbitrary; change at will */
35+
spi-one-frame = <0x70>;
36+
spi-zero-frame = <0x40>;
37+
38+
color-mapping = <
39+
LED_COLOR_ID_GREEN
40+
LED_COLOR_ID_RED
41+
LED_COLOR_ID_BLUE
42+
>;
43+
};
44+
};
45+
46+
/ {
47+
chosen {
48+
zmk,underglow = &led_strip;
49+
};
50+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include <dt-bindings/led/led.h>
2+
3+
&pinctrl {
4+
spi3_default: spi3_default {
5+
group1 {
6+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
7+
};
8+
};
9+
10+
spi3_sleep: spi3_sleep {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
13+
low-power-enable;
14+
};
15+
};
16+
};
17+
18+
&spi3 {
19+
compatible = "nordic,nrf-spim";
20+
status = "okay";
21+
22+
pinctrl-0 = <&spi3_default>;
23+
pinctrl-1 = <&spi3_sleep>;
24+
pinctrl-names = "default", "sleep";
25+
26+
led_strip: ws2812@0 {
27+
compatible = "worldsemi,ws2812-spi";
28+
29+
/* SPI */
30+
reg = <0>; /* ignored, but necessary for SPI bindings */
31+
spi-max-frequency = <4000000>;
32+
33+
/* WS2812 */
34+
chain-length = <36>; /* arbitrary; change at will */
35+
spi-one-frame = <0x70>;
36+
spi-zero-frame = <0x40>;
37+
38+
color-mapping = <
39+
LED_COLOR_ID_GREEN
40+
LED_COLOR_ID_RED
41+
LED_COLOR_ID_BLUE
42+
>;
43+
};
44+
};
45+
46+
/ {
47+
chosen {
48+
zmk,underglow = &led_strip;
49+
};
50+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include <dt-bindings/led/led.h>
2+
3+
&pinctrl {
4+
spi3_default: spi3_default {
5+
group1 {
6+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
7+
};
8+
};
9+
10+
spi3_sleep: spi3_sleep {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
13+
low-power-enable;
14+
};
15+
};
16+
};
17+
18+
&spi3 {
19+
compatible = "nordic,nrf-spim";
20+
status = "okay";
21+
22+
pinctrl-0 = <&spi3_default>;
23+
pinctrl-1 = <&spi3_sleep>;
24+
pinctrl-names = "default", "sleep";
25+
26+
led_strip: ws2812@0 {
27+
compatible = "worldsemi,ws2812-spi";
28+
29+
/* SPI */
30+
reg = <0>; /* ignored, but necessary for SPI bindings */
31+
spi-max-frequency = <4000000>;
32+
33+
/* WS2812 */
34+
chain-length = <36>; /* arbitrary; change at will */
35+
spi-one-frame = <0x70>;
36+
spi-zero-frame = <0x40>;
37+
38+
color-mapping = <
39+
LED_COLOR_ID_GREEN
40+
LED_COLOR_ID_RED
41+
LED_COLOR_ID_BLUE
42+
>;
43+
};
44+
};
45+
46+
/ {
47+
chosen {
48+
zmk,underglow = &led_strip;
49+
};
50+
};

boards/shields/sofle/sofle.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2020 Ryan Cross
2+
# SPDX-License-Identifier: MIT
3+
4+
# Uncomment the following line to enable the Sofle OLED Display
5+
# CONFIG_ZMK_DISPLAY=y
6+
7+
# Uncomment these two lines to add support for encoders
8+
# CONFIG_EC11=y
9+
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
10+
11+
# Uncomment this line below to add rgb underglow / backlight support
12+
# CONFIG_ZMK_RGB_UNDERGLOW=y
13+
14+
# Uncomment the line below to disable external power toggling by the underglow.
15+
# By default toggling the underglow on and off also toggles external power
16+
# on and off. This also causes the display to turn off.
17+
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n

boards/shields/sofle/sofle.dtsi

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright (c) 2020 Pete Johanson, Ryan Cross
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <dt-bindings/zmk/matrix_transform.h>
8+
#include <layouts/josefadamcik/sofle.dtsi>
9+
10+
&josefadamcik_sofle_layout {
11+
transform = <&default_transform>;
12+
};
13+
14+
/ {
15+
chosen {
16+
zephyr,display = &oled;
17+
zmk,kscan = &kscan0;
18+
};
19+
20+
default_transform: keymap_transform_0 {
21+
compatible = "zmk,matrix-transform";
22+
columns = <16>;
23+
rows = <4>;
24+
// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 |
25+
// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 |
26+
// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 |
27+
// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 |
28+
// | SW30 | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 | SW30 |
29+
map = <
30+
RC(0,0) 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)
31+
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)
32+
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
33+
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,0) RC(4,11) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
34+
RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10)
35+
>;
36+
};
37+
38+
kscan0: kscan {
39+
compatible = "zmk,kscan-gpio-matrix";
40+
wakeup-source;
41+
42+
diode-direction = "col2row";
43+
row-gpios
44+
= <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
45+
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
46+
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
47+
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
48+
, <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
49+
;
50+
};
51+
52+
left_encoder: encoder_left {
53+
compatible = "alps,ec11";
54+
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
55+
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
56+
steps = <80>;
57+
status = "disabled";
58+
};
59+
60+
right_encoder: encoder_right {
61+
compatible = "alps,ec11";
62+
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
63+
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
64+
steps = <80>;
65+
status = "disabled";
66+
};
67+
68+
sensors: sensors {
69+
compatible = "zmk,keymap-sensors";
70+
sensors = <&left_encoder &right_encoder>;
71+
triggers-per-rotation = <20>;
72+
};
73+
};
74+
75+
&pro_micro_i2c {
76+
status = "okay";
77+
78+
oled: ssd1306@3c {
79+
compatible = "solomon,ssd1306fb";
80+
reg = <0x3c>;
81+
width = <128>;
82+
height = <32>;
83+
segment-offset = <0>;
84+
page-offset = <0>;
85+
display-offset = <0>;
86+
multiplex-ratio = <31>;
87+
segment-remap;
88+
com-invdir;
89+
com-sequential;
90+
inversion-on;
91+
prechargep = <0x22>;
92+
};
93+
};

0 commit comments

Comments
 (0)