From 75792673de62d0a2d82fe0e1cbe98f9b5341729b Mon Sep 17 00:00:00 2001 From: XiNGRZ Date: Mon, 18 Sep 2023 23:30:56 +0800 Subject: [PATCH] dts: dynamic: Split SSD1675B LUT into separated board revision --- .github/workflows/build.yml | 3 ++- config/boards/arm/hw75_dynamic/README.md | 19 +++++++++++--- .../boards/arm/hw75_dynamic/hw75_dynamic.dts | 18 ------------- .../arm/hw75_dynamic/hw75_dynamic_A.conf | 2 ++ .../arm/hw75_dynamic/hw75_dynamic_A.overlay | 4 +++ .../arm/hw75_dynamic/hw75_dynamic_B.conf | 2 ++ .../arm/hw75_dynamic/hw75_dynamic_B.overlay | 26 +++++++++++++++++++ config/boards/arm/hw75_dynamic/revision.cmake | 7 +++++ config/boards/arm/hw75_keyboard/README.md | 2 +- 9 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 config/boards/arm/hw75_dynamic/hw75_dynamic_A.conf create mode 100644 config/boards/arm/hw75_dynamic/hw75_dynamic_A.overlay create mode 100644 config/boards/arm/hw75_dynamic/hw75_dynamic_B.conf create mode 100644 config/boards/arm/hw75_dynamic/hw75_dynamic_B.overlay create mode 100644 config/boards/arm/hw75_dynamic/revision.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d94fb70..72a36f37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,8 @@ jobs: include: - { board: hw75_keyboard@1.1, keymap: hw75_keyboard.keymap } - { board: hw75_keyboard@1.2, keymap: hw75_keyboard.keymap } - - { board: hw75_dynamic, keymap: hw75_dynamic.keymap } + - { board: hw75_dynamic@A, keymap: hw75_dynamic.keymap } + - { board: hw75_dynamic@B, keymap: hw75_dynamic.keymap } steps: - name: Prepare variables diff --git a/config/boards/arm/hw75_dynamic/README.md b/config/boards/arm/hw75_dynamic/README.md index 8b6dee5e..3493dbe0 100644 --- a/config/boards/arm/hw75_dynamic/README.md +++ b/config/boards/arm/hw75_dynamic/README.md @@ -3,9 +3,14 @@ HW-75 Dynamic 本目录是 HW-75 扩展模块的 ZMK 配置。 -## PCB +## 硬件版本 -本配置基于稚晖君在[立创开源](https://oshwhub.com/pengzhihui/b11afae464c54a3e8d0f77e1f92dc7b7)发布的 PCB 适配。 +本配置基于稚晖君在[立创开源](https://oshwhub.com/pengzhihui/b11afae464c54a3e8d0f77e1f92dc7b7)发布的 PCB 适配,但有些许差异: + +| 硬件版本 | 文件前缀 | 备注 | +|--------|--------------------|------| +| A | `hw75_dynamic@A-zmk` | 稚晖君在[立创开源](https://oshwhub.com/pengzhihui/b11afae464c54a3e8d0f77e1f92dc7b7)的原始设计,三叶虫 (wow) 一期、二期团 | +| B | `hw75_dynamic@B-zmk` | 三叶虫 (wow) 三期团 | ## 开发进度 @@ -44,10 +49,16 @@ sudo npm install -g lv_font_conv west init -l config west update west zephyr-export -west build -s zmk/app -b hw75_dynamic -- -DZMK_CONFIG=$PWD/config +west build -p -s zmk/app -b hw75_dynamic -- -DZMK_CONFIG=$PWD/config west flash ``` +默认会构建最新[硬件版本](#硬件版本)的配置。如果你需要构建不同版本,可以使用下面的命令: + +```sh +west build -p -s zmk/app -b hw75_dynamic@A -- -DZMK_CONFIG=$PWD/config -DKEYMAP_FILE=$PWD/config/hw75_dynamic.keymap +``` + ### 日志 日志通过 SWD 口使用 SEGGER RTT 协议输出,默认关闭,可通过如下编译选项开启: @@ -66,4 +77,4 @@ pyocd rtt -t stm32f405rg ## 致谢 -感谢[三叶虫本虫](https://space.bilibili.com/21972064)提供用于开发的硬件。 +感谢[三叶虫](https://space.bilibili.com/21972064)提供用于开发的硬件。 diff --git a/config/boards/arm/hw75_dynamic/hw75_dynamic.dts b/config/boards/arm/hw75_dynamic/hw75_dynamic.dts index 50f2a53c..66ba020c 100644 --- a/config/boards/arm/hw75_dynamic/hw75_dynamic.dts +++ b/config/boards/arm/hw75_dynamic/hw75_dynamic.dts @@ -166,24 +166,6 @@ /* 128x296, 50Hz */ dummy-line = <0x30>; gate-line-width = <0x0a>; - - lut = [ - A0 90 50 00 00 00 00 00 00 00 - 50 90 A0 00 00 00 00 00 00 00 - A0 90 50 00 00 00 00 00 00 00 - 50 90 A0 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 00 00 - 0F 0F 00 00 00 - 0F 0F 00 00 03 - 0F 0F 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - 00 00 00 00 00 - ]; }; }; }; diff --git a/config/boards/arm/hw75_dynamic/hw75_dynamic_A.conf b/config/boards/arm/hw75_dynamic/hw75_dynamic_A.conf new file mode 100644 index 00000000..d90e87f2 --- /dev/null +++ b/config/boards/arm/hw75_dynamic/hw75_dynamic_A.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2023 XiNGRZ +# SPDX-License-Identifier: MIT diff --git a/config/boards/arm/hw75_dynamic/hw75_dynamic_A.overlay b/config/boards/arm/hw75_dynamic/hw75_dynamic_A.overlay new file mode 100644 index 00000000..893ab35b --- /dev/null +++ b/config/boards/arm/hw75_dynamic/hw75_dynamic_A.overlay @@ -0,0 +1,4 @@ +/* + * Copyright (c) 2023 XiNGRZ + * SPDX-License-Identifier: MIT + */ diff --git a/config/boards/arm/hw75_dynamic/hw75_dynamic_B.conf b/config/boards/arm/hw75_dynamic/hw75_dynamic_B.conf new file mode 100644 index 00000000..d90e87f2 --- /dev/null +++ b/config/boards/arm/hw75_dynamic/hw75_dynamic_B.conf @@ -0,0 +1,2 @@ +# Copyright (c) 2023 XiNGRZ +# SPDX-License-Identifier: MIT diff --git a/config/boards/arm/hw75_dynamic/hw75_dynamic_B.overlay b/config/boards/arm/hw75_dynamic/hw75_dynamic_B.overlay new file mode 100644 index 00000000..5af80336 --- /dev/null +++ b/config/boards/arm/hw75_dynamic/hw75_dynamic_B.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 XiNGRZ + * SPDX-License-Identifier: MIT + */ + +&ssd16xx { + full { + lut = [ + A0 90 50 00 00 00 00 00 00 00 + 50 90 A0 00 00 00 00 00 00 00 + A0 90 50 00 00 00 00 00 00 00 + 50 90 A0 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 + 0F 0F 00 00 00 + 0F 0F 00 00 03 + 0F 0F 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + 00 00 00 00 00 + ]; + }; +}; diff --git a/config/boards/arm/hw75_dynamic/revision.cmake b/config/boards/arm/hw75_dynamic/revision.cmake new file mode 100644 index 00000000..c5f86686 --- /dev/null +++ b/config/boards/arm/hw75_dynamic/revision.cmake @@ -0,0 +1,7 @@ +# Copyright (c) 2023 XiNGRZ +# SPDX-License-Identifier: MIT + +board_check_revision( + FORMAT LETTER + DEFAULT_REVISION B +) diff --git a/config/boards/arm/hw75_keyboard/README.md b/config/boards/arm/hw75_keyboard/README.md index 50a8bba6..2531f617 100644 --- a/config/boards/arm/hw75_keyboard/README.md +++ b/config/boards/arm/hw75_keyboard/README.md @@ -46,7 +46,7 @@ ZMK 默认带了几种灯效。可以通过 Fn 组合键切换: west init -l config west update west zephyr-export -west build -s zmk/app -b hw75_keyboard -- -DZMK_CONFIG=$PWD/config +west build -p -s zmk/app -b hw75_keyboard -- -DZMK_CONFIG=$PWD/config west flash ```