-
Notifications
You must be signed in to change notification settings - Fork 18
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
21 changed files
with
297 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/.vscode/ | ||
/.west/ | ||
/build/ | ||
/modules/ | ||
/zephyr/ | ||
/zmk/ |
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,7 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
config BOARD_ENABLE_DCDC | ||
bool "Enable DCDC mode" | ||
select SOC_DCDC_NRF52X | ||
default y | ||
depends on BOARD_WHKB_PRO2 |
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,6 @@ | ||
# Copyright (c) 2023 Kan-Ru Chen | ||
# SPDX-License-Identifier: MIT | ||
|
||
config BOARD_WHKB_PRO2 | ||
bool "WHKB Pro2" | ||
depends on SOC_NRF52840_QIAA |
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,28 @@ | ||
# Copyright (c) 2023 Kan-Ru Chen | ||
# SPDX-License-Identifier: MIT | ||
|
||
if BOARD_WHKB_PRO2 | ||
|
||
config ZMK_KEYBOARD_NAME | ||
default "WHKB Pro2 Rev A" | ||
|
||
config BOARD | ||
default "whkb_pro2" | ||
|
||
if USB_DEVICE_STACK | ||
|
||
config USB_NRFX | ||
default y | ||
|
||
endif # USB_DEVICE_STACK | ||
|
||
config BT_CTLR | ||
default BT | ||
|
||
config ZMK_BLE | ||
default y | ||
|
||
config ZMK_USB | ||
default y | ||
|
||
endif # BOARD_WHKB_PRO2 |
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,152 @@ | ||
/* | ||
* Copyright (c) 2021 The ZMK Contributors | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf52840_qiaa.dtsi> | ||
#include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h> | ||
#include <dt-bindings/zmk/matrix_transform.h> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
/ { | ||
model = "whkb_pro2"; | ||
compatible = "applet,whkb_pro2"; | ||
|
||
chosen { | ||
zephyr,code-partition = &code_partition; | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
zephyr,console = &cdc_acm_uart; | ||
zmk,battery = &vbatt0; | ||
zmk,kscan = &kscan0; | ||
zmk,matrix_transform = &default_transform; | ||
}; | ||
|
||
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 | ||
}; | ||
|
||
vbatt1: vbatt1 { | ||
compatible = "zmk,battery-nrf-vddh"; | ||
label = "BATTERY"; | ||
}; | ||
|
||
kscan0: kscan_0 { | ||
compatible = "zmk,kscan-gpio-topre"; | ||
label = "KSCAN"; | ||
gpios = <&gpio0 31 (GPIO_OPEN_SOURCE|NRF_GPIO_DRIVE_H1)>, /* 0: POWER */ | ||
<&gpio0 4 (GPIO_ACTIVE_LOW|GPIO_PULL_UP)>, /* 1: KEY */ | ||
<&gpio0 5 GPIO_ACTIVE_HIGH>, /* 2: HYS */ | ||
<&gpio0 22 GPIO_ACTIVE_HIGH>, /* 3: BIT0 */ | ||
<&gpio0 7 GPIO_ACTIVE_HIGH>, /* 4: BIT1 */ | ||
<&gpio1 9 GPIO_ACTIVE_HIGH>, /* 5: BIT2 */ | ||
<&gpio0 12 GPIO_ACTIVE_HIGH>, /* 6: BIT3 */ | ||
<&gpio0 23 GPIO_ACTIVE_HIGH>, /* 7: BIT4 */ | ||
<&gpio0 21 GPIO_ACTIVE_HIGH>, /* 8: BIT5 */ | ||
<&gpio0 19 GPIO_ACTIVE_HIGH>; /* 9: STROBE */ | ||
}; | ||
|
||
default_transform: keymap_transform_0 { | ||
compatible = "zmk,matrix-transform"; | ||
columns = <8>; | ||
rows = <8>; | ||
map = < | ||
RC(3,1) RC(3,0) RC(0,0) RC(1,0) RC(1,1) RC(2,0) RC(2,1) RC(4,0) RC(4,1) RC(6,0) RC(6,1) RC(7,0) RC(7,1) RC(5,0) RC(5,1) | ||
RC(3,2) RC(0,1) RC(0,2) RC(1,3) RC(1,2) RC(2,3) RC(2,2) RC(4,2) RC(4,3) RC(6,2) RC(6,3) RC(7,3) RC(7,2) RC(5,2) | ||
RC(3,3) RC(0,4) RC(0,3) RC(1,4) RC(1,5) RC(2,4) RC(2,5) RC(4,5) RC(4,4) RC(6,5) RC(6,4) RC(7,4) RC(5,3) | ||
RC(3,4) RC(0,5) RC(0,6) RC(0,7) RC(1,6) RC(1,7) RC(2,6) RC(4,6) RC(6,6) RC(7,6) RC(7,5) RC(5,5) RC(5,4) | ||
RC(3,5) RC(3,6) RC(3,7) RC(5,7) RC(5,6) | ||
>; | ||
}; | ||
}; | ||
|
||
&adc { | ||
status = "okay"; | ||
}; | ||
|
||
/* | ||
&gpiote { | ||
status = "okay"; | ||
}; | ||
*/ | ||
|
||
&gpio0 { | ||
status = "okay"; | ||
}; | ||
|
||
&gpio1 { | ||
status = "okay"; | ||
}; | ||
|
||
|
||
/* | ||
&i2c0 { | ||
compatible = "nordic,nrf-twi"; | ||
pinctrl-0 = <&i2c0_default>; | ||
pinctrl-1 = <&i2c0_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
|
||
&uart0 { | ||
compatible = "nordic,nrf-uarte"; | ||
current-speed = <115200>; | ||
pinctrl-0 = <&uart0_default>; | ||
pinctrl-1 = <&uart0_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
*/ | ||
|
||
&usbd { | ||
status = "okay"; | ||
cdc_acm_uart: cdc_acm_uart { | ||
compatible = "zephyr,cdc-acm-uart"; | ||
label = "CDC_ACM_0"; | ||
}; | ||
}; | ||
|
||
|
||
&flash0 { | ||
/* | ||
* For more information, see: | ||
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html | ||
*/ | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
sd_partition: partition@0 { | ||
label = "softdevice"; | ||
reg = <0x00000000 0x00026000>; | ||
}; | ||
code_partition: partition@26000 { | ||
label = "code_partition"; | ||
reg = <0x00026000 0x000c6000>; | ||
}; | ||
|
||
/* | ||
* The flash starting at 0x000ec000 and ending at | ||
* 0x000f3fff is reserved for use by the application. | ||
*/ | ||
|
||
/* | ||
* Storage partition will be used by FCB/LittleFS/NVS | ||
* if enabled. | ||
*/ | ||
storage_partition: partition@ec000 { | ||
label = "storage"; | ||
reg = <0x000ec000 0x00008000>; | ||
}; | ||
|
||
boot_partition: partition@f4000 { | ||
label = "adafruit_boot"; | ||
reg = <0x000f4000 0x0000c000>; | ||
}; | ||
}; | ||
}; |
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,43 @@ | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <dt-bindings/zmk/bt.h> | ||
|
||
#define DEFAULT 0 | ||
#define FN 1 | ||
#define BT 2 | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSLH &kp GRAVE | ||
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &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 ENTER | ||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp RSHFT &mo FN | ||
&kp LALT &kp LGUI &kp SPACE &kp RGUI &kp RALT | ||
>; | ||
}; | ||
|
||
fn_layer { | ||
bindings = < | ||
&kp K_POWER &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp INS &kp DEL | ||
&kp CAPS &trans &trans &trans &sys_reset &trans &trans &bootloader &kp PSCRN &kp SLCK &kp PAUSE_BREAK &kp UP &trans &kp BSPC | ||
&trans &kp K_VOL_DN &kp K_VOL_UP &kp K_MUTE &kp K_EJECT &trans &kp KP_MULTIPLY &kp KP_DIVIDE &kp HOME &kp PG_UP &kp LEFT &kp RIGHT &trans | ||
&trans &trans &trans &trans &trans &to BT &kp KP_PLUS &kp KP_MINUS &kp END &kp PG_DN &kp DOWN &trans &trans | ||
&trans &trans &trans &trans &trans | ||
>; | ||
}; | ||
|
||
bt_layer { | ||
bindings =< | ||
&to DEFAULT &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none &none &none &none | ||
&none &none &none &none &none &none &none &none &none &none &none &none &none &none | ||
&none &none &none &none &none &none &none &none &none &none &none &none &none | ||
&none &none &none &bt BT_CLR &none &none &none &none &none &none &none &none &none | ||
&none &none &none &none &none | ||
>; | ||
}; | ||
}; | ||
}; |
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,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
CONFIG_SOC_SERIES_NRF52X=y | ||
CONFIG_SOC_NRF52840_QIAA=y | ||
CONFIG_BOARD_WHKB_PRO2=y | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Use pinctrl | ||
CONFIG_PINCTRL=y | ||
|
||
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 |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
name: hhkb-drivers | ||
build: | ||
cmake: . | ||
kconfig: Kconfig | ||
depends: | ||
- module |
File renamed without changes
File renamed without changes
File renamed without changes