-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
9 changed files
with
420 additions
and
6 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,10 @@ | ||
# | ||
# Copyright (c) 2022 The ZMK Contributors | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
config BOARD_CORNEISH_ZEN_LEFT | ||
bool | ||
|
||
config BOARD_CORNEISH_ZEN_RIGHT | ||
bool |
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
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,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 |
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,88 @@ | ||
/* | ||
* | ||
* 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"; | ||
}; | ||
}; | ||
}; | ||
|
||
&i2c0 { | ||
status = "okay"; | ||
compatible = "nordic,nrf-twim"; | ||
sda-pin = <6>; | ||
scl-pin = <26>; | ||
clock-frequency = <100000>; | ||
|
||
fuelgauge: bq27xx@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"; | ||
sck-pin = <27>; | ||
mosi-pin = <8>; | ||
miso-pin = <22>; | ||
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>; | ||
}; | ||
}; |
92 changes: 92 additions & 0 deletions
92
app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig
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,92 @@ | ||
# | ||
# Copyright (c) 2022 Darryl deHaan | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
CONFIG_SOC_SERIES_NRF52X=y | ||
CONFIG_SOC_NRF52840_QIAA=y | ||
CONFIG_BOARD_CORNEISH_ZEN_V1_LEFT=y | ||
CONFIG_ZMK_SLEEP=y | ||
CONFIG_ZMK_DISPLAY=y | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable I2C | ||
CONFIG_I2C=y | ||
CONFIG_I2C_NRFX=y | ||
|
||
# Enable SPI | ||
CONFIG_SPI_NRFX=y | ||
|
||
# Enable writing to flash | ||
CONFIG_USE_DT_CODE_PARTITION=y | ||
CONFIG_BUILD_OUTPUT_UF2=y | ||
CONFIG_MPU_ALLOW_FLASH_WRITE=y | ||
CONFIG_NVS=y | ||
CONFIG_SETTINGS_NVS=y | ||
CONFIG_FLASH=y | ||
CONFIG_FLASH_PAGE_LAYOUT=y | ||
CONFIG_FLASH_MAP=y | ||
|
||
# Enable 32kHz crystal | ||
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y | ||
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y | ||
|
||
# Enable TI BQ27421 Fuel Gauge | ||
CONFIG_BQ274XX=y | ||
|
||
# enable display drivers | ||
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y | ||
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 | ||
CONFIG_LVGL_BITS_PER_PIXEL=1 | ||
CONFIG_LVGL_COLOR_DEPTH_1=y | ||
CONFIG_LVGL_DPI=145 | ||
CONFIG_LVGL_VDB_SIZE=100 | ||
CONFIG_LVGL_USE_THEME_MONO=y | ||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_RED=n | ||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_RED=n | ||
CONFIG_LVGL_THEME_DEFAULT_COLOR_PRIMARY_BLACK=y | ||
CONFIG_LVGL_THEME_DEFAULT_COLOR_SECONDARY_WHITE=y | ||
CONFIG_LVGL_THEME_DEFAULT_FONT_SMALL_MONTSERRAT_16=y | ||
CONFIG_LVGL_THEME_DEFAULT_FONT_NORMAL_MONTSERRAT_26=y | ||
|
||
# custom status screens | ||
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y | ||
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN=n | ||
CONFIG_CUSTOM_WIDGET_BATTERY_STATUS=y | ||
CONFIG_ZMK_WIDGET_BATTERY_STATUS=n | ||
CONFIG_CUSTOM_WIDGET_OUTPUT_STATUS=y | ||
CONFIG_ZMK_WIDGET_OUTPUT_STATUS=n | ||
CONFIG_CUSTOM_WIDGET_LAYER_STATUS=y | ||
CONFIG_ZMK_WIDGET_LAYER_STATUS=n | ||
|
||
# Turn on logging, and set ZMK logging to debug output | ||
#CONFIG_LOG=y | ||
#CONFIG_ZMK_USB_LOGGING=y | ||
#CONFIG_ZMK_LOG_LEVEL_DBG=y | ||
#CONFIG_LOG_BUFFER_SIZE=65536 | ||
#CONFIG_LOG_STRDUP_BUF_COUNT=160 | ||
#CONFIG_I2C_LOG_LEVEL_DBG=y | ||
#CONFIG_SPI_LOG_LEVEL_DBG=y | ||
#CONFIG_DISPLAY_LOG_LEVEL_DBG=y | ||
#CONFIG_LVGL_LOG_LEVEL_DBG=y | ||
#CONFIG_LVGL_USE_DEBUG=y | ||
#CONFIG_SENSOR_LOG_LEVEL_DBG=y | ||
|
||
# Turn on USB CDC ACM device | ||
CONFIG_USB_DEVICE_STACK=y | ||
CONFIG_USB_CDC_ACM=y | ||
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=1024 | ||
|
||
# Enable serial console | ||
CONFIG_SERIAL=y | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
CONFIG_UART_LINE_CTRL=y | ||
|
||
# Enable USB UART | ||
CONFIG_UART_CONSOLE=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,96 @@ | ||
/* | ||
* | ||
* 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 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
, <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> | ||
; | ||
|
||
col-gpios | ||
= <&gpio0 19 GPIO_ACTIVE_HIGH> | ||
, <&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> | ||
; | ||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
blue_led: led_0 { | ||
gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; | ||
label = "Blue LED"; | ||
}; | ||
}; | ||
}; | ||
|
||
&default_transform { | ||
col-offset = <6>; | ||
}; | ||
|
||
&five_column_transform { | ||
col-offset = <6>; | ||
}; | ||
|
||
&i2c0 { | ||
status = "ok"; | ||
compatible = "nordic,nrf-twim"; | ||
sda-pin = <16>; | ||
scl-pin = <13>; | ||
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 2.1 | ||
terminate-voltage = <2750>; //Battery Terminate Voltage in mV | ||
int-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; | ||
}; | ||
}; | ||
|
||
&spi2 { | ||
status = "okay"; | ||
compatible = "nordic,nrf-spim"; | ||
sck-pin = <20>; | ||
mosi-pin = <24>; | ||
miso-pin = <27>; | ||
cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; | ||
|
||
epd: il0323@0 { | ||
compatible = "gooddisplay,il0323"; | ||
reg = <0>; | ||
label = "DISPLAY"; | ||
width = <80>; | ||
height = <128>; | ||
spi-max-frequency = <4000000>; | ||
dc-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; | ||
busy-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; | ||
reset-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; | ||
pwr = [03 00 26 26]; | ||
cdi = <0xd2>; | ||
tcon = <0x22>; | ||
}; | ||
}; |
Oops, something went wrong.