Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(boards): Add Corne-ish Zen v1 #1593

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/boards/arm/corneish_zen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(CONFIG_ZMK_DISPLAY)
target_sources_ifdef(CONFIG_CUSTOM_WIDGET_LAYER_STATUS app PRIVATE widgets/layer_status.c)
target_sources_ifdef(CONFIG_CUSTOM_WIDGET_PERIPHERAL_STATUS app PRIVATE widgets/peripheral_status.c)

add_subdirectory_ifdef(CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM widgets/icons)
add_subdirectory_ifdef(CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM widgets/icons)
endif()

zephyr_library()
Expand Down Expand Up @@ -47,7 +47,7 @@ if(CONFIG_ZMK_DISPLAY)
zephyr_library_sources(widgets/icons/layers.c)
zephyr_library_sources(widgets/icons/layers2.c)
endif()
if(CONFIG_BOARD_CORNEISH_ZEN_V2_RIGHT)
if(NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
zephyr_library_sources(widgets/icons/zenlogo.c)
endif()
endif()
Expand All @@ -57,4 +57,4 @@ zephyr_library_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl/)
zephyr_library_sources_ifdef(CONFIG_ZMK_DISPLAY custom_status_screen.c)
zephyr_library_sources(${ZEPHYR_BASE}/misc/empty_file.c)
zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
10 changes: 10 additions & 0 deletions app/boards/arm/corneish_zen/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
#

config BOARD_CORNEISH_ZEN_LEFT
bool

config BOARD_CORNEISH_ZEN_RIGHT
bool
14 changes: 13 additions & 1 deletion app/boards/arm/corneish_zen/Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
# SPDX-License-Identifier: MIT
#

config BOARD_CORNEISH_ZEN_V1_LEFT
bool "corneish zen left v1"
depends on SOC_NRF52840_QIAA
select BOARD_CORNEISH_ZEN_LEFT

config BOARD_CORNEISH_ZEN_V1_RIGHT
bool "corneish zen right v1"
depends on SOC_NRF52840_QIAA
select BOARD_CORNEISH_ZEN_RIGHT

config BOARD_CORNEISH_ZEN_V2_LEFT
bool "corneish zen left v2"
depends on SOC_NRF52840_QIAA
select BOARD_CORNEISH_ZEN_LEFT

config BOARD_CORNEISH_ZEN_V2_RIGHT
bool "corneish zen right v2"
depends on SOC_NRF52840_QIAA
depends on SOC_NRF52840_QIAA
select BOARD_CORNEISH_ZEN_RIGHT
16 changes: 11 additions & 5 deletions app/boards/arm/corneish_zen/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# SPDX-License-Identifier: MIT
#

if BOARD_CORNEISH_ZEN_V2_LEFT
if BOARD_CORNEISH_ZEN_LEFT

config ZMK_KEYBOARD_NAME
default "Corne-ish Zen"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif # BOARD_CORNEISH_ZEN_V2_LEFT
endif # BOARD_CORNEISH_ZEN_LEFT


if BOARD_CORNEISH_ZEN_V2_LEFT || BOARD_CORNEISH_ZEN_V2_RIGHT
if BOARD_CORNEISH_ZEN_LEFT || BOARD_CORNEISH_ZEN_RIGHT

config BOARD
default "corneish_zen"
Expand Down Expand Up @@ -44,7 +44,6 @@ endif # USB
config ZMK_DISPLAY
select LV_USE_CONT
select LV_FONT_MONTSERRAT_26
select LV_FONT_MONTSERRAT_20
select LV_FONT_MONTSERRAT_16
select LV_USE_LABEL
select LV_USE_IMG
Expand Down Expand Up @@ -78,4 +77,11 @@ menuconfig CUSTOM_WIDGET_LAYER_STATUS
menuconfig CUSTOM_WIDGET_PERIPHERAL_STATUS
bool "custom peripheral status widget"

endif # BOARD_CORNEISH_ZEN_V2_LEFT || BOARD_CORNEISH_ZEN_V2_RIGHT
endif # BOARD_CORNEISH_ZEN_LEFT || BOARD_CORNEISH_ZEN_RIGHT

if BOARD_CORNEISH_ZEN_V1_LEFT || BOARD_CORNEISH_ZEN_V1_RIGHT

config BQ274XX
default y

endif # BOARD_CORNEISH_ZEN_V1_LEFT || BOARD_CORNEISH_ZEN_V1_RIGHT
11 changes: 5 additions & 6 deletions app/boards/arm/corneish_zen/corneish_zen.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
model = "corneish_zen_v2";
compatible = "corneish_zen_v2";
model = "Corne-ish Zen";
compatible = "corneish_zen";

chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,display = &epd;
zmk,battery = &vbatt;
zephyr,console = &cdc_acm_uart;
zmk,matrix_transform = &default_transform;
};

default_transform: keymap_transform_0 {
Expand Down Expand Up @@ -50,7 +50,7 @@
// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 |
// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 |
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
map = <
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(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(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)
Expand All @@ -60,7 +60,6 @@

};


&adc {
status = "okay";
};
Expand Down Expand Up @@ -123,4 +122,4 @@
reg = <0x000f4000 0x0000c000>;
};
};
};
};
71 changes: 36 additions & 35 deletions app/boards/arm/corneish_zen/corneish_zen.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,59 @@
#include <dt-bindings/zmk/bt.h>

/ {
chosen {
zmk,matrix_transform = &default_transform;
//zmk,matrix_transform = &five_column_transform;
};
chosen {
zmk,matrix_transform = &default_transform;
// zmk,matrix_transform = &five_column_transform;
};
};

/ {
keymap {
compatible = "zmk,keymap";
keymap {
compatible = "zmk,keymap";

default_layer {
label = "QWERTY";
// -----------------------------------------------------------------------------------------
default_layer {
label = "QWERTY";
// --------------------------------------------------------------------------------
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHFT | Z | X | C | V | B | | N | M | , | . | / | ESC |
// | GUI | LWR | SPC | | ENT | RSE | ALT |
bindings = <
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC
&kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT
>;
};
lower_layer {
label = "NUMBER";
bindings = <
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC
&kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT
>;
};

lower_layer {
label = "NUMBER";
// -----------------------------------------------------------------------------------------
// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | |
// | SHFT | | | | | | | | | | | | |
// | GUI | | SPC | | ENT | | ALT |
bindings = <
&kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans
&kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>;
};
bindings = <
&kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans
&kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>;
};

raise_layer {
label = "SYMBOL";
raise_layer {
label = "SYMBOL";
// -----------------------------------------------------------------------------------------
// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP |
// | CTRL | | | | | | | - | = | [ | ] | \ | ` |
// | SHFT | | | | | | | _ | + | { | } | "|" | ~ |
// | GUI | | SPC | | ENT | | ALT |
bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>;
};
bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>;
};
};
};
};
15 changes: 15 additions & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v1.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
file_format: "1"
id: corneish_zen_v1
name: Corneish Zen v1
url: https://lowprokb.ca/collections/keyboards/products/corne-ish-zen
type: board
arch: arm
features:
- keys
- display
outputs:
- usb
- ble
siblings:
- corneish_zen_v1_left
- corneish_zen_v1_right
123 changes: 123 additions & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v1_left.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
*
* Copyright (c) 2021 Darryl deHaan
* SPDX-License-Identifier: MIT
*
*/

#include "corneish_zen.dtsi"

/{
chosen {
zephyr,display = &epd;
zmk,battery = &fuelgauge;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 31 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 30 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

col-gpios
= <&gpio0 21 GPIO_ACTIVE_HIGH>
, <&gpio0 23 GPIO_ACTIVE_HIGH>
, <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 7 GPIO_ACTIVE_HIGH>
, <&gpio0 5 GPIO_ACTIVE_HIGH>
;
};

leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
};

&pinctrl {
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 8)>,
<NRF_PSEL(SPIM_MISO, 0, 22)>;
};
};

spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 8)>,
<NRF_PSEL(SPIM_MISO, 0, 22)>;
low-power-enable;
};
};

i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 6)>,
<NRF_PSEL(TWIM_SCL, 0, 26)>;
};
};

i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 6)>,
<NRF_PSEL(TWIM_SCL, 0, 26)>;
low-power-enable;
};
};
};

&i2c0 {
status = "okay";
compatible = "nordic,nrf-twim";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
clock-frequency = <100000>;

fuelgauge: bq274xx@55 {
compatible = "ti,bq274xx";
label = "BATTERY";
reg = <0x55>;
design-voltage = <3700>; //Battery Design Volatge in mV
design-capacity = <180>; //Battery Design Capacity in mAh
taper-current = <2>; //Battery Taper current in mAh
terminate-voltage = <2750>; //Battery Terminate Voltage in mV
int-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
};
};

&spi2 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;

epd: il0323@0 {
compatible = "gooddisplay,il0323";
reg = <0>;
label = "DISPLAY";
width = <80>;
height = <128>;
spi-max-frequency = <4000000>;
dc-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
busy-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
pwr = [03 00 26 26];
cdi = <0xd2>;
tcon = <0x22>;
};
};
Loading