From 3b66b5113219d21944d03b6113ed7d06f58b58dd Mon Sep 17 00:00:00 2001 From: KemoNine Date: Thu, 25 Feb 2021 22:19:24 +0000 Subject: [PATCH] Add 'The Paintbrush' mini keybord to repo --- .github/workflows/build.yml | 2 + .../shields/the_paintbrush/Kconfig.defconfig | 34 +++++++++++++ .../shields/the_paintbrush/Kconfig.shield | 5 ++ .../the_paintbrush/the_paintbrush.conf | 20 ++++++++ .../the_paintbrush/the_paintbrush.keymap | 31 +++++++++++ .../the_paintbrush/the_paintbrush.overlay | 51 +++++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 config/boards/shields/the_paintbrush/Kconfig.defconfig create mode 100755 config/boards/shields/the_paintbrush/Kconfig.shield create mode 100755 config/boards/shields/the_paintbrush/the_paintbrush.conf create mode 100644 config/boards/shields/the_paintbrush/the_paintbrush.keymap create mode 100644 config/boards/shields/the_paintbrush/the_paintbrush.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a59fa9c..509479e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,8 @@ jobs: shield: corne_artsey_left - board: nice_nano shield: corne_artsey_right + - board: nice_nano + shield: the_paintbrush steps: - name: Checkout uses: actions/checkout@v2 diff --git a/config/boards/shields/the_paintbrush/Kconfig.defconfig b/config/boards/shields/the_paintbrush/Kconfig.defconfig new file mode 100644 index 0000000..2147204 --- /dev/null +++ b/config/boards/shields/the_paintbrush/Kconfig.defconfig @@ -0,0 +1,34 @@ +if SHIELD_THE_PAINTBRUSH + +config ZMK_KEYBOARD_NAME + default "The Paintbrush" + +config I2C + default y + +config SSD1306 + default y + +config SSD1306_REVERSE_MODE + default y + +config LVGL_HOR_RES_MAX + default 128 + +config LVGL_VER_RES_MAX + default 32 + +config LVGL_VDB_SIZE + default 64 + +config LVGL_DPI + default 148 + +config LVGL_BITS_PER_PIXEL + default 1 + +choice LVGL_COLOR_DEPTH + default LVGL_COLOR_DEPTH_1 +endchoice + +endif diff --git a/config/boards/shields/the_paintbrush/Kconfig.shield b/config/boards/shields/the_paintbrush/Kconfig.shield new file mode 100755 index 0000000..4104e98 --- /dev/null +++ b/config/boards/shields/the_paintbrush/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# SPDX-License-Identifier: MIT + +config SHIELD_THE_PAINTBRUSH + def_bool $(shields_list_contains,the_paintbrush) diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.conf b/config/boards/shields/the_paintbrush/the_paintbrush.conf new file mode 100755 index 0000000..48b1836 --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush.conf @@ -0,0 +1,20 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# SPDX-License-Identifier: MIT + +# Tune combos to allow proper ARTSEY support +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16 +CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8 +CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8 + +# Enable display (layer in use is helpful) +CONFIG_ZMK_DISPLAY=y + +# Turn on deep sleep +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Set screen blanking to 15s instead of 30s +CONFIG_ZMK_IDLE_TIMEOUT=15000 + +# Add debug logging +#CONFIG_ZMK_USB_LOGGING=y diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.keymap b/config/boards/shields/the_paintbrush/the_paintbrush.keymap new file mode 100644 index 0000000..6af0eba --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush.keymap @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +// THE BOARD IS FLIPPED FOR LEFT BUT STILL WIRED RIGHT! +#define ARTSEY_RIGHT 1 + +// ARTS Row +#define KEY_A 0 +#define KEY_R 1 +#define KEY_T 2 +#define KEY_S 3 +// EYIO Row +#define KEY_E 4 +#define KEY_Y 5 +#define KEY_I 6 +#define KEY_O 7 + +// Define Offsets +#define LEADING_NONES NONE(0,0,0) +#define MIDDLE_NONES NONE(0, 0, 0) +#define TRAILING_NONES NONE(0, 0, 0) + +// Include main artsey.io keymap +#include "../../../artsey.dtsi" diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.overlay b/config/boards/shields/the_paintbrush/the_paintbrush.overlay new file mode 100644 index 0000000..12294a9 --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush.overlay @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-direct"; + + label = "KSCAN"; + + input-gpios + = <&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + + }; +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + label = "DISPLAY"; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + prechargep = <0x22>; + }; +};