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

Whkb pro2 rev b #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion config/boards/arm/whkb_pro2/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if BOARD_WHKB_PRO2

config ZMK_KEYBOARD_NAME
default "WHKB Pro2 Rev A"
default "WHKB Pro2"

config BOARD
default "whkb_pro2"
Expand Down
1 change: 1 addition & 0 deletions config/boards/arm/whkb_pro2/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
3 changes: 3 additions & 0 deletions config/boards/arm/whkb_pro2/revision.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
board_check_revision(FORMAT LETTER
DEFAULT_REVISION B
)
31 changes: 5 additions & 26 deletions config/boards/arm/whkb_pro2/whkb_pro2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,16 @@
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt0;
};

vbatt0: vbatt0 {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 1>; // P0.03
output-ohms = <2000000>;
full-ohms = <(1000000 + 2000000)>;
power-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; // P0.02
};

hhkb_pro2_connector: hhkb_pro2_connector {
compatible = "zmk,hhkb-pro2-header";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 31 NRF_GPIO_DRIVE_S0H1>,
<1 0 &gpio0 4 0>,
<2 0 &gpio0 5 0>,
<3 0 &gpio0 22 0>,
<4 0 &gpio0 7 0>,
<5 0 &gpio1 9 0>,
<6 0 &gpio0 12 0>,
<7 0 &gpio0 23 0>,
<8 0 &gpio0 21 0>,
<9 0 &gpio0 19 0>;
};
};

&adc {
status = "okay";
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand All @@ -58,7 +37,7 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
Expand Down
1 change: 1 addition & 0 deletions config/boards/arm/whkb_pro2/whkb_pro2_A.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ZMK_KEYBOARD_NAME="WHKB Pro2 Rev A"
34 changes: 34 additions & 0 deletions config/boards/arm/whkb_pro2/whkb_pro2_A.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h>

/ {
vbatt0: vbatt0 {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 1>; // P0.03
output-ohms = <2000000>;
full-ohms = <(1000000 + 2000000)>;
power-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; // P0.02
};

hhkb_pro2_connector: hhkb_pro2_connector {
compatible = "zmk,hhkb-pro2-header";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 31 NRF_GPIO_DRIVE_S0H1>,
<1 0 &gpio0 4 0>,
<2 0 &gpio0 5 0>,
<3 0 &gpio0 22 0>,
<4 0 &gpio0 7 0>,
<5 0 &gpio1 9 0>,
<6 0 &gpio0 12 0>,
<7 0 &gpio0 23 0>,
<8 0 &gpio0 21 0>,
<9 0 &gpio0 19 0>;
};
};
1 change: 1 addition & 0 deletions config/boards/arm/whkb_pro2/whkb_pro2_B.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ZMK_KEYBOARD_NAME="WHKB Pro2 Rev B"
30 changes: 30 additions & 0 deletions config/boards/arm/whkb_pro2/whkb_pro2_B.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h>

/ {
vbatt0: vbatt0 {
compatible = "zmk,battery-nrf-vddh";
};

hhkb_pro2_connector: hhkb_pro2_connector {
compatible = "zmk,hhkb-pro2-header";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 29 0>, // LDO_ENABLE
<1 0 &gpio0 13 0>,
<2 0 &gpio0 20 0>,
<3 0 &gpio0 17 0>,
<4 0 &gpio0 15 0>,
<5 0 &gpio0 26 0>,
<6 0 &gpio0 6 0>,
<7 0 &gpio0 8 0>,
<8 0 &gpio0 4 0>,
<9 0 &gpio0 12 0>;
};
};
2 changes: 1 addition & 1 deletion config/zephyr/kscan/kscan_hhkb_pro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static const struct kscan_driver_api kscan_hhkb_pro2_api = {
NULL, \
&kscan_hhkb_pro2_data##inst, \
&kscan_hhkb_pro2_config##inst, \
APPLICATION, \
POST_KERNEL, \
CONFIG_APPLICATION_INIT_PRIORITY, \
&kscan_hhkb_pro2_api);

Expand Down