forked from kofal.net/zmk
feat!: Move to zephyr v4.1 (#3060)
refactor: Move to Zephyr v4.1.0 Move to Zephyr v4.1.0, with various build/compilation fixes needed for basic use. refactor(tests): Move to native_sim for tests. feat(core): (Optionally) use Zephyr keyboard input devices Add ability to assign a keyboard `input` device to a physical layout, or use a chosen `zmk,matrix-input`. fix(pointing): Refactor for changes to input API Pass NULL user_data to input callbacks. fix(tests): Fix BLE test to account for Zephyr changes Handle additional read callback invocation once all matching characteristic have been read. fix(sensors): Initialize sensor data to 0 before fetching. Be sure we don't get back any uninitialized data by initializing the channel data to 0 before calling into the sensor API. refactor(input): Adjust split input to input API changes. Input callbacks now have a user_data parameter, adjust accordingly. chore(bluetooth): Minor cleanup of split BT code after refactor Small fixes and remove commented dead code left after the split refactor. refactor: Fix up BLE tests after Zephyr upgrade. Minor changes to snapshots based on newer Zephyr version. refactor(boards): Move to upstream xiao_ble board ID. Move to official upstream board definition for the Seeed XIAO BLE. refactor: Adjust metadata schema for HWMv2 board IDs w/ qualifiers Adjust our ZMK metadata to allow for board IDs that include qualifiers with slash delimeters. refactor!(boards): Move nice!nano to HWMv2, and proper revisioning Upgrade the nice!nano board to HWMv2, under the proper nicekeyboards vendor directory, and with proper revisions. Includes a breaking change to default the `2.0.0` version instead of the much older v1 (`1.0.0`). fix: Disable Nordic dt-bindings header checks. Disable the recently added Nordic dt-bindings header checks, which cause issues for our HID related headers. fix(studio): Correct `memset` usage. Use the correct memset call to clear our RPC memory. fix: Refactor for new Zephyr PM API Adjustments to our PM code to match Zephyr PM APIs. refactor(ble): Use correct BT opt for connectable. Adjust for upstream Zephyr BT API changes for advertising options. refactor(boards): Move MakerDiary M2 board to HWMv2. Run the HWMv2 script to convert the MakerDiary M2 board. fix(studio): Correct usage of thread analyzer API Fix up the RPC code that invoke the thread analyzer API to account for API changes. chore: Remove nanopb module override. Leverage nanopb version that's used by Zephyr. feat(core): mapper for magic bootloader values. To trigger bootloaders that use a magic value in RAM to trigger bootloader mode, add a mapping retained memory driver that maps write/read of boot mode values to a special magic value stored in the actually backing RAM. feat(behaviors): Add retention boot mode to reset. Support new generic Zephyr retention boot mode API in the reset behavior. feat: Add double tap to enter bootloader functionality Add ability to enter the bootloader if double tapping reset within the specified window. refactor(CI): Move to 4.1 container tags. Move to the new 4.1 tagged container, to ensure updated SDK, Python packages, etc. refactor(boards): Move nRFMicro to HWMv2 Refactor nRFMicro to HWMv2, using proper SoC, revisions, and variants (for flipped). Also move to devicetree setup of DCDC/HV DCDC. refactor(boards): Move QMK Proton-C to HWMv2 Move Proton-C to HWMv2 for use with Zephyr 4.1. chore(ci): Adjust core coverage for new board IDs. Use correct board IDs, with qualifiers, for our core coverage testing. refactor(boards): Move BDN9 to HWMv2 Move BDN9 to HWMv2, using the base `bdn9` ID, no longer including the `_rev2` suffix in the ID. refactor(boards): Move nice!60 to HWMv2 Migrate nice!60 to HWMv2. refactor: Adjust how we're searching/loading keymap files Use new post_boards_shields extension point for loading keymap files from board/shield directories. refactor(boards): Move planck rev6 to HWMv2. Move Planck board definition to HWMv2, including versioning tweaks. refactor(boards): Move OLKB Preonic to HWMv2 Move Preonic board definition to HWMv2 and remove `_rev3` variant suffix in favor of board versioning with `3.0.0` as the default. chore(deps): Pull in Zephyr optional group for nanopb. Ensure we enable nanopb by adding +optional group filter. fix(ci): Prevent slash characters in artifact names. Move to HWMv2 means board IDs often include slashes, so replace those with underscores when doing file uploads. fix(usb): Adjust Kconfig settings for USB. * Ensure USB isn't initialized automatically before we do, which can happen if USB CDC logging is used/enabled for a given board. * Adjust USB HID to initialize the USB class/interface before we enable the USB device itself. fix(display): Fix setting the small font for the mono theme. Adjust for modified mono theme init function to pass the small font. chore(ci): Fix changed board IDs for core coverage. Adjust board IDs for our core coverage after move to HWMv2 and board versioning consistently. * planck_rev6 -> planck * bdn9_rev2 -> bdn9 fix(underglow): Remove use of removed Kconfig WS2812 symbol refactor(boards): Move PW CKP boards to HWMv2 Migrate the bt60, bt65, and bt75 to HWMv2. refactor(boards): Move Puchi BLE to HWMv2 Migrate the Puchi BLE to HWMv2. refactor(boards): Migrate Ferris rev02 to HWMv2. Move Ferris rev02 to HMWv2, and remove the revision from the ID. refactor(boards): Move Pillbug to HWMv2 Migrate the MechWild PillBug board to HWMv2. refactor(boards): Migrate s40nc to HWMv2 Move the ShortyFortyNoCordy (s40nc) to HWMv2. refactor(boards): Move bluemicro840 board to HWMv2. Migrate bluemicro840 board to HWMv2, set up boot mode retention. fix(boards): Retore bootloader support on XIAO BLE. Set up necessary boot mode/retention to properly set GPREGRET to trigger Adafruit bootloader to run on the XIAO BLE. refactor(boards): Move Adv360 Pro to HWMv2. Migrate Adv360 Pro left/right to HWMv2. refactor(boards): Move Glove80 to HMWv2 Refactor the MoErgo Glove80 left/right to HWMv2. refactor(boards): Move Mikoto to HMWv2. Migrate Mikoto to HWMv2, with non-exact matching, tweaks to I2C selection to imply it for the 7.2.0 revision for the fuel gauge. refactor(boards): Move kbdfans Tofu65 2.0 to HMWv2 Move Tofu65 2.0 to HMWv2, with ID of just `tofu65`. refactor(boards): Remove dz60rgb board Remove dz60rgb, it's no longer readily available and we have other current stm32 reference designs for testing. refactor(boards): Move Corneish Zen to HMWv2 Move Corneish Zen to HMWv2, with IDs of `corneish_zen_left`/`corneish_zen_right`. refactor(boards): Migrate Corne-ish Zen status screen * refactor(boards): Add boot mode to the nice!nano using common dtsi * Add a new .dtsi for setting up nRF52 boot mode/retained memory settings * Adjust XIAO BLE to use the new include file * Add boot mode to to the nice!nano refactor(boards): Add boot mode support to nice!60 board Enable boot mode for nice!60 board. refactor(boards): Adjust Zephyr board metadata file locations Move the ZMK metadata files for upstream Zephyr boards to align with the HWMv2 directory structure that uses the vendor ID for the parent directory for a board directory. fix: Don't enable ZMK Display by default for a few shields By convention, avoid enabling ZMK Display by default on shields that may be built with under-resourced controllers (e.g. nRF52833 based ones). fix: Remove usage of renamed Kconfig from core coverage. Avoid using WS2812_LED_STRIP, since that Kconfig was renamed/split into SPI/GPIO/I2S symbols. refactor(boards): Adjust XIAO RP2040 override names, bootloader support Adjust the .conf/.overlay files to match the proper naming for the XIAO rp2040 board. Also add the necessary Kconfig/DTS bits for supporting bootloader using retained memory/boot mode retention. fix(display): Adjust stack sizes for display usage. Updated LVGL is bumping our stack size, so adjust the system work queue and dedicated display queue stack sizes as needed to account for this. feat(display): Add thread name to dedicated display queue. When thread names are enabled, pass a name to the dedicated display queue for better tracibility when using the thread analyzer. docs(blog): Add Zephyr upgrade post docs: Add bootloader integration page Add a dedicated page to outline steps to set up bootloader integration using the boot retention mechanism in newer Zephyr versions. fix(display): port nice!view display code * remove `lv_` prefix from old LVGL methods doc: Update local setup docs to use `west packages pip` Install Zephyr deps using the newer `west packages pip --install`. Signed-off-by: Peter Johanson <peter@peterjohanson.com> refactor(split): Adjust BT split code for newer Zephyr APIs. refactor(boards): Adjust upstream RP2040 boards for boot mode retention Add necessary DTS/Kconfig settings to upstream RP2040 boards so they can use the ZMK bootloader functionality using the boot mode retention infrastructure. docs: Update Zephyr docs links to 4.1.0 version. Update all links to the Zephyr docs to the 4.1.0 versions to match our Zephyr version in use. docs: Add a note about using CMake v3 for maximum compatibility. Some optional modules, like libmetal, which is used on nRF5340, specifically require CMake v3, so add a note in the native toolchain setup about this. feat(pointing): Handle INPUT_BTN_TOUCH codes for mouse buttons Translate INPUT_BTN_TOUCH input codes into button 0 press/release for HID layer. chore(pointing): Clean up some warning messages. Properly check return code from queue-ing messages, and fix up some type warnings in our logging calls. * Fix input event codes line numbers fix(studio): Properly serialize GATT RPC indications. fix(core): Set a system work queue stack size of 2048 by default We use a fair amount of stack even without BLE or RP2040, so default to 2048 by default everywhere, and constrained platforms can lowes this if they really need. refactor(core): Move away from deprecated DIS Kconfig symbols Use the correct Device Information Service Kconfig symbols for our model number and manufacturer. refactor: Move upstream Zephyr board overrides to extensions dirs Newer Zephyr supports "board extensions" to formally do what we've added in ourselves via some hacks, so move all our board overlay/config file overrides for upstream Zephyr boards into that correct structure. fix(boards): Add xiao_ble sd_partition label for nosd snippet compat Upstream xiao_ble uses different naming convention for the partition labels, so add an additional label for the SD range, so the existing nrf52840-nosd snippet will still work with the board. fix(core): Don't force CBPRINTF_NANO, for proper formatting. The nano CBPRINTF implementation lacks some padded formatting needed to ensure consistent formatting of BLE addresses, which we use to store keys as strings in a few places, so use the complete CBPRINTF by default now. fix(boards): Remove some references to old nice_nano_v2 board ID. The nice!nano board definition now properly uses versioning, so avoid referring to it with old `nice_nano_v2` board ID. fix(boards): Remove nano overlays for old nice_nano_v2 board ID. With board versioning in place, we can remove the unused `nice_nano_v2.overlay` files from shields. --------- Signed-off-by: Peter Johanson <peter@peterjohanson.com> Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com> Co-authored-by: Nicolas Munnich <munnich@lipn.univ-paris13.fr> Co-authored-by: snoyer <noyer.stephane@gmail.com>
This commit is contained in:
3
app/boards/moergo/glove80/CMakeLists.txt
Normal file
3
app/boards/moergo/glove80/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
zephyr_library()
|
||||
zephyr_library_sources(usb_serial_number.c)
|
||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
||||
55
app/boards/moergo/glove80/Kconfig.defconfig
Normal file
55
app/boards/moergo/glove80/Kconfig.defconfig
Normal file
@@ -0,0 +1,55 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_GLOVE80_LH
|
||||
|
||||
config BOARD
|
||||
default "glove80 lh"
|
||||
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif # BOARD_GLOVE80_LH
|
||||
|
||||
if BOARD_GLOVE80_RH
|
||||
|
||||
config BOARD
|
||||
default "glove80 rh"
|
||||
|
||||
endif # BOARD_GLOVE80_RH
|
||||
|
||||
if BOARD_GLOVE80_LH || BOARD_GLOVE80_RH
|
||||
|
||||
config ZMK_SPLIT
|
||||
default y
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||
default 5
|
||||
|
||||
config PINCTRL
|
||||
default y
|
||||
|
||||
if USB
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
config USB_DEVICE_STACK
|
||||
default y
|
||||
|
||||
endif # USB
|
||||
|
||||
if ZMK_BACKLIGHT
|
||||
|
||||
config PWM
|
||||
default y
|
||||
|
||||
config LED_PWM
|
||||
default y
|
||||
|
||||
endif # ZMK_BACKLIGHT
|
||||
|
||||
endif # BOARD_GLOVE80_LH || BOARD_GLOVE80_RH
|
||||
8
app/boards/moergo/glove80/Kconfig.glove80_lh
Normal file
8
app/boards/moergo/glove80/Kconfig.glove80_lh
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_GLOVE80_LH
|
||||
select SOC_NRF52840_QIAA
|
||||
imply RETAINED_MEM
|
||||
imply RETENTION
|
||||
imply RETENTION_BOOT_MODE
|
||||
8
app/boards/moergo/glove80/Kconfig.glove80_rh
Normal file
8
app/boards/moergo/glove80/Kconfig.glove80_rh
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_GLOVE80_RH
|
||||
select SOC_NRF52840_QIAA
|
||||
imply RETAINED_MEM
|
||||
imply RETENTION
|
||||
imply RETENTION_BOOT_MODE
|
||||
6
app/boards/moergo/glove80/board.cmake
Normal file
6
app/boards/moergo/glove80/board.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
9
app/boards/moergo/glove80/board.yml
Normal file
9
app/boards/moergo/glove80/board.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
boards:
|
||||
- name: glove80_rh
|
||||
vendor: moergo
|
||||
socs:
|
||||
- name: nrf52840
|
||||
- name: glove80_lh
|
||||
vendor: moergo
|
||||
socs:
|
||||
- name: nrf52840
|
||||
91
app/boards/moergo/glove80/glove80-layouts.dtsi
Normal file
91
app/boards/moergo/glove80/glove80-layouts.dtsi
Normal file
@@ -0,0 +1,91 @@
|
||||
#include <physical_layouts.dtsi>
|
||||
|
||||
/ {
|
||||
physical_layout0: physical_layout_0 {
|
||||
compatible = "zmk,physical-layout";
|
||||
display-name = "Default";
|
||||
|
||||
keys // w h x y rot rx ry
|
||||
= <&key_physical_attrs 100 100 0 50 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 50 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1300 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 0 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 50 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 50 0 0 0>
|
||||
, <&key_physical_attrs 100 100 0 150 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 150 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 500 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1200 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1300 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 100 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 150 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 150 0 0 0>
|
||||
, <&key_physical_attrs 100 100 0 250 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 250 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 500 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1200 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1300 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 200 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 250 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 250 0 0 0>
|
||||
, <&key_physical_attrs 100 100 0 350 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 350 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 500 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1200 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1300 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 300 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 350 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 350 0 0 0>
|
||||
, <&key_physical_attrs 100 100 0 450 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 450 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 500 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 450 3000 450 925>
|
||||
, <&key_physical_attrs 100 100 400 450 4500 450 925>
|
||||
, <&key_physical_attrs 100 100 400 450 6000 450 925>
|
||||
, <&key_physical_attrs 100 100 1300 450 (-6000) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1300 450 (-4500) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1300 450 (-3000) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1200 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1300 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 400 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 450 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 450 0 0 0>
|
||||
, <&key_physical_attrs 100 100 0 550 0 0 0>
|
||||
, <&key_physical_attrs 100 100 100 550 0 0 0>
|
||||
, <&key_physical_attrs 100 100 200 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 300 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 400 550 2000 450 925>
|
||||
, <&key_physical_attrs 100 100 400 550 4000 450 925>
|
||||
, <&key_physical_attrs 100 100 400 550 6000 450 925>
|
||||
, <&key_physical_attrs 100 100 1300 550 (-6000) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1300 550 (-4000) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1300 550 (-2000) 1350 925>
|
||||
, <&key_physical_attrs 100 100 1300 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1400 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1500 500 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1600 550 0 0 0>
|
||||
, <&key_physical_attrs 100 100 1700 550 0 0 0>
|
||||
;
|
||||
};
|
||||
};
|
||||
109
app/boards/moergo/glove80/glove80.dtsi
Normal file
109
app/boards/moergo/glove80/glove80.dtsi
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
|
||||
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
#include "glove80-layouts.dtsi"
|
||||
|
||||
&physical_layout0 {
|
||||
transform = <&matrix_transform0>;
|
||||
};
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,physical-layout = &physical_layout0;
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
matrix_transform0: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <14>;
|
||||
rows = <6>;
|
||||
map = <
|
||||
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13)
|
||||
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13)
|
||||
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13)
|
||||
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12) RC(3,13)
|
||||
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(0,6) RC(1,6) RC(2,6) RC(2,7) RC(1,7) RC(0,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,12) RC(4,13)
|
||||
RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4) RC(3,6) RC(4,6) RC(5,6) RC(5,7) RC(4,7) RC(3,7) RC(5,9) RC(5,10) RC(5,11) RC(5,12) RC(5,13)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
wakeup-source;
|
||||
|
||||
diode-direction = "col2row";
|
||||
debounce-press-ms = <4>;
|
||||
debounce-release-ms = <20>;
|
||||
};
|
||||
};
|
||||
|
||||
®1 {
|
||||
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
zephyr_udc0: &usbd {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&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 {
|
||||
reg = <0x00000000 0x00026000>;
|
||||
};
|
||||
code_partition: partition@26000 {
|
||||
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 {
|
||||
reg = <0x000ec000 0x00008000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
109
app/boards/moergo/glove80/glove80.keymap
Normal file
109
app/boards/moergo/glove80/glove80.keymap
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/bt.h>
|
||||
#include <dt-bindings/zmk/ext_power.h>
|
||||
#include <dt-bindings/zmk/outputs.h>
|
||||
#include <dt-bindings/zmk/rgb.h>
|
||||
|
||||
// layers
|
||||
#define DEFAULT 0
|
||||
#define LOWER 1
|
||||
#define MAGIC 2
|
||||
|
||||
/ {
|
||||
behaviors {
|
||||
// For the "layer" key, it'd nice to be able to use it as either a shift or a toggle.
|
||||
// Configure it as a tap dance, so the first tap (or hold) is a &mo and the second tap is a &to
|
||||
layer_td: tap_dance_0 {
|
||||
compatible = "zmk,behavior-tap-dance";
|
||||
#binding-cells = <0>;
|
||||
tapping-term-ms = <200>;
|
||||
bindings = <&mo LOWER>, <&to LOWER>;
|
||||
};
|
||||
};
|
||||
|
||||
macros {
|
||||
bt_0: bt_profile_macro_0 {
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings
|
||||
= <&out OUT_BLE>,
|
||||
<&bt BT_SEL 0>;
|
||||
};
|
||||
|
||||
bt_1: bt_profile_macro_1 {
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings
|
||||
= <&out OUT_BLE>,
|
||||
<&bt BT_SEL 1>;
|
||||
};
|
||||
|
||||
bt_2: bt_profile_macro_2 {
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings
|
||||
= <&out OUT_BLE>,
|
||||
<&bt BT_SEL 2>;
|
||||
};
|
||||
|
||||
bt_3: bt_profile_macro_3 {
|
||||
compatible = "zmk,behavior-macro";
|
||||
#binding-cells = <0>;
|
||||
bindings
|
||||
= <&out OUT_BLE>,
|
||||
<&bt BT_SEL 3>;
|
||||
};
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
|
||||
// | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | \ |
|
||||
// | ESC | A | S | D | F | G | | H | J | K | L | ; | ' |
|
||||
// | ` | Z | X | C | V | B | LSHFT | LCTRL | LOWER | | LGUI | RCTRL | RSHFT | N | M | , | . | / | PGUP |
|
||||
// | MAGIC | HOME| END | LEFT | RIGHT| | BSPC | DEL | LALT | | RALT | RET | SPACE | | UP | DOWN | [ | ] | PGDN |
|
||||
|
||||
bindings = <
|
||||
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10
|
||||
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
|
||||
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
|
||||
&kp ESC &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
|
||||
&kp GRAVE &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LCTRL &layer_td &kp LGUI &kp RCTRL &kp RSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp PG_UP
|
||||
&mo MAGIC &kp HOME &kp END &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp LALT &kp RALT &kp RET &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &kp PG_DN
|
||||
>;
|
||||
};
|
||||
|
||||
lower_layer {
|
||||
bindings = <
|
||||
&kp C_BRI_DN &kp C_BRI_UP &kp C_PREV &kp C_NEXT &kp C_PP &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP &none &kp PAUSE_BREAK
|
||||
&trans &none &none &none &none &kp HOME &kp LPAR &kp KP_NUM &kp KP_EQUAL &kp KP_DIVIDE &kp KP_MULTIPLY &kp PSCRN
|
||||
&trans &none &none &kp UP &none &kp END &kp RPAR &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp SLCK
|
||||
&trans &none &kp LEFT &kp DOWN &kp RIGHT &kp PG_UP &kp PRCNT &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &none
|
||||
&trans &kp K_CMENU &none &kp F11 &kp F12 &kp PG_DN &trans &trans &to DEFAULT &trans &trans &trans &kp COMMA &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER &trans
|
||||
&trans &kp CAPS &kp INS &kp F11 &kp F12 &trans &trans &trans &trans &trans &trans &kp KP_N0 &kp KP_N0 &kp KP_DOT &kp KP_ENTER &trans
|
||||
>;
|
||||
};
|
||||
|
||||
magic_layer {
|
||||
bindings = <
|
||||
&bt BT_CLR &none &none &none &none &none &none &none &none &none
|
||||
&none &none &none &none &none &none &none &none &none &none &none &none
|
||||
&none &rgb_ug RGB_SPI &rgb_ug RGB_SAI &rgb_ug RGB_HUI &rgb_ug RGB_BRI &rgb_ug RGB_TOG &none &none &none &none &none &none
|
||||
&bootloader &rgb_ug RGB_SPD &rgb_ug RGB_SAD &rgb_ug RGB_HUD &rgb_ug RGB_BRD &rgb_ug RGB_EFF &none &none &none &none &none &bootloader
|
||||
&sys_reset &none &none &none &none &none &bt_2 &bt_3 &none &none &none &none &none &none &none &none &none &sys_reset
|
||||
&none &none &none &none &none &bt_0 &bt_1 &out OUT_USB &none &none &none &none &none &none &none &none
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
||||
19
app/boards/moergo/glove80/glove80.yaml
Normal file
19
app/boards/moergo/glove80/glove80.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
identifier: glove80
|
||||
name: Glove80
|
||||
url: https://www.moergo.com/
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
||||
- gpio
|
||||
- i2c
|
||||
- spi
|
||||
17
app/boards/moergo/glove80/glove80.zmk.yml
Normal file
17
app/boards/moergo/glove80/glove80.zmk.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
file_format: "1"
|
||||
id: glove80
|
||||
name: Glove80
|
||||
type: board
|
||||
arch: arm
|
||||
url: https://www.moergo.com/
|
||||
features:
|
||||
- keys
|
||||
- underglow
|
||||
- backlight
|
||||
- studio
|
||||
outputs:
|
||||
- usb
|
||||
- ble
|
||||
siblings:
|
||||
- glove80_lh
|
||||
- glove80_rh
|
||||
47
app/boards/moergo/glove80/glove80_lh-pinctrl.dtsi
Normal file
47
app/boards/moergo/glove80/glove80_lh-pinctrl.dtsi
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi3_default: spi3_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_MOSI, 0, 27)>; // WS2812_VEXT_DATA
|
||||
};
|
||||
};
|
||||
|
||||
spi3_sleep: spi3_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_MOSI, 0, 27)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_default: pwm0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 1, 15)>; // rear LED
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_sleep: pwm0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 1, 15)>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 22)>, // EXT1
|
||||
<NRF_PSEL(UART_RX, 0, 21)>; // EXT2
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 22)>,
|
||||
<NRF_PSEL(UART_RX, 0, 21)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
112
app/boards/moergo/glove80/glove80_lh.dts
Normal file
112
app/boards/moergo/glove80/glove80_lh.dts
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "glove80.dtsi"
|
||||
#include "glove80_lh-pinctrl.dtsi"
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
|
||||
/ {
|
||||
model = "glove80_lh";
|
||||
compatible = "glove80_lh";
|
||||
|
||||
chosen {
|
||||
zmk,underglow = &led_strip;
|
||||
zmk,backlight = &back_led_backlight;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
back_led_backlight: pwmleds {
|
||||
compatible = "pwm-leds";
|
||||
pwm_led_0 {
|
||||
pwms = <&pwm0 0 PWM_USEC(20) PWM_POLARITY_NORMAL>;
|
||||
};
|
||||
};
|
||||
|
||||
// Node name must match original "EXT_POWER" label to preserve user settings.
|
||||
EXT_POWER {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
control-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; /* WS2812_CE */
|
||||
init-delay-ms = <100>;
|
||||
};
|
||||
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-nrf-vddh";
|
||||
};
|
||||
|
||||
glove80_ext: connector {
|
||||
compatible = "moergo,glove80-ext";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <1 0 &gpio0 22 0> /* EXT1 */
|
||||
, <2 0 &gpio0 21 0> /* EXT2 */
|
||||
, <3 0 &gpio0 24 0> /* EXT3 */
|
||||
, <4 0 &gpio0 20 0> /* EXT4 */
|
||||
, <5 0 &gpio0 25 0> /* EXT5 */
|
||||
, <6 0 &gpio1 00 0> /* EXT6 */
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
&spi3 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
|
||||
pinctrl-0 = <&spi3_default>;
|
||||
pinctrl-1 = <&spi3_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
led_strip: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <40>; /* 40 keys have underglow at the moment */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
&pwm0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm0_default>;
|
||||
pinctrl-1 = <&pwm0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
&kscan0 {
|
||||
row-gpios
|
||||
= <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW1
|
||||
, <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW2
|
||||
, <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW3
|
||||
, <&gpio0 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW4
|
||||
, <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW5
|
||||
, <&gpio1 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // LH ROW6
|
||||
;
|
||||
col-gpios
|
||||
= <&gpio1 8 GPIO_ACTIVE_HIGH> // LH COL6
|
||||
, <&gpio1 4 GPIO_ACTIVE_HIGH> // LH COL5
|
||||
, <&gpio1 6 GPIO_ACTIVE_HIGH> // LH COL4
|
||||
, <&gpio1 7 GPIO_ACTIVE_HIGH> // LH COL3
|
||||
, <&gpio1 5 GPIO_ACTIVE_HIGH> // LH COL2
|
||||
, <&gpio1 3 GPIO_ACTIVE_HIGH> // LH COL1
|
||||
, <&gpio1 1 GPIO_ACTIVE_HIGH> // LH Thumb
|
||||
;
|
||||
};
|
||||
7
app/boards/moergo/glove80/glove80_lh.keymap
Normal file
7
app/boards/moergo/glove80/glove80_lh.keymap
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "glove80.keymap"
|
||||
88
app/boards/moergo/glove80/glove80_lh_defconfig
Normal file
88
app/boards/moergo/glove80/glove80_lh_defconfig
Normal file
@@ -0,0 +1,88 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Enable both USB and BLE
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_BLE=y
|
||||
|
||||
# Keyboard IDs
|
||||
CONFIG_ZMK_KEYBOARD_NAME="Glove80 Left"
|
||||
CONFIG_USB_DEVICE_PID=0x27db
|
||||
CONFIG_USB_DEVICE_VID=0x16c0
|
||||
CONFIG_USB_DEVICE_MANUFACTURER="MoErgo"
|
||||
CONFIG_USB_DEVICE_SN="moergo.com:GLV80-0123456789ABCDEF"
|
||||
|
||||
CONFIG_BT_DIS_PNP_PID=0x27db
|
||||
CONFIG_BT_DIS_PNP_VID=0x16c0
|
||||
CONFIG_BT_DIS_MANUF="MoErgo"
|
||||
CONFIG_BT_DIS_MODEL="Glove80"
|
||||
|
||||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
|
||||
|
||||
# Work-around for Windows bug with battery notifications
|
||||
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# Enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Build configurations
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
CONFIG_BUILD_OUTPUT_UF2_FAMILY_ID="0x9807B007"
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
|
||||
# Flash configuration
|
||||
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
|
||||
|
||||
# Enable RGB underglow
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP=4
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_MIN=4
|
||||
|
||||
# DO NOT CHANGE CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX TO ABOVE 80. Configuring
|
||||
# BRT_MAX above 80% will draw additional current and can potentially damage your
|
||||
# computer. WARRANTY IS VOID IF BRT_MAX SET ABOVE 80.
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX=80
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=285
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=75
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=16
|
||||
|
||||
# The power LED is implemented as a backlight
|
||||
# For now, the power LED is acting as a "USB connected" indicator
|
||||
CONFIG_ZMK_BACKLIGHT=y
|
||||
CONFIG_ZMK_BACKLIGHT_ON_START=y
|
||||
CONFIG_ZMK_BACKLIGHT_BRT_START=5
|
||||
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y
|
||||
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB=y
|
||||
|
||||
# The full two-byte consumer report space has compatibility issues with some
|
||||
# operating systems, most notably macOS. Use the more basic single-byte usage
|
||||
# space.
|
||||
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
|
||||
|
||||
# Turn on debugging to disable optimization. Debug messages can result in larger
|
||||
# stacks, so enable stack protection and particularly a larger BLE peripheral stack.
|
||||
# CONFIG_DEBUG=y
|
||||
# CONFIG_DEBUG_THREAD_INFO=y
|
||||
# CONFIG_EXCEPTION_STACK_TRACE=y
|
||||
# CONFIG_HW_STACK_PROTECTION=y
|
||||
# CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE=1300
|
||||
|
||||
# Log via USB or Segger RTT
|
||||
CONFIG_ZMK_USB_LOGGING=n
|
||||
CONFIG_ZMK_RTT_LOGGING=n
|
||||
48
app/boards/moergo/glove80/glove80_rh-pinctrl.dtsi
Normal file
48
app/boards/moergo/glove80/glove80_rh-pinctrl.dtsi
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi3_default: spi3_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_MOSI, 0, 13)>; // WS2812_VEXT_DATA
|
||||
};
|
||||
};
|
||||
|
||||
spi3_sleep: spi3_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_MOSI, 0, 13)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_default: pwm0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 16)>; // Rear LED
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_sleep: pwm0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(PWM_OUT0, 0, 16)>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 21)>, // EXT1
|
||||
<NRF_PSEL(UART_RX, 0, 24)>; // EXT2
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 21)>,
|
||||
<NRF_PSEL(UART_RX, 0, 24)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
119
app/boards/moergo/glove80/glove80_rh.dts
Normal file
119
app/boards/moergo/glove80/glove80_rh.dts
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
|
||||
#include "glove80.dtsi"
|
||||
#include "glove80_rh-pinctrl.dtsi"
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
|
||||
/ {
|
||||
model = "glove80_rh";
|
||||
compatible = "glove80_rh";
|
||||
|
||||
chosen {
|
||||
zmk,underglow = &led_strip;
|
||||
zmk,backlight = &back_led_backlight;
|
||||
zmk,battery = &vbatt;
|
||||
};
|
||||
|
||||
back_led_backlight: pwmleds {
|
||||
compatible = "pwm-leds";
|
||||
pwm_led_0 {
|
||||
pwms = <&pwm0 0 PWM_USEC(20) PWM_POLARITY_NORMAL>;
|
||||
};
|
||||
};
|
||||
|
||||
// Node name must match original "EXT_POWER" label to preserve user settings.
|
||||
EXT_POWER {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
control-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; /* WS2812_CE */
|
||||
init-delay-ms = <100>;
|
||||
};
|
||||
|
||||
vbatt: vbatt {
|
||||
compatible = "zmk,battery-nrf-vddh";
|
||||
};
|
||||
|
||||
glove80_ext: connector {
|
||||
compatible = "moergo,glove80-ext";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <1 0 &gpio0 21 0> /* EXT1 */
|
||||
, <2 0 &gpio0 24 0> /* EXT2 */
|
||||
, <3 0 &gpio0 20 0> /* EXT3 */
|
||||
, <4 0 &gpio0 25 0> /* EXT4 */
|
||||
, <5 0 &gpio0 22 0> /* EXT5 */
|
||||
, <6 0 &gpio1 00 0> /* EXT6 */
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
&spi3 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
|
||||
pinctrl-0 = <&spi3_default>;
|
||||
pinctrl-1 = <&spi3_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
led_strip: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <40>; /* 40 keys have underglow at the moment */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
&pwm0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pwm0_default>;
|
||||
pinctrl-1 = <&pwm0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
/* For right hand, the columns are offset by 7 */
|
||||
&matrix_transform0 {
|
||||
col-offset = <7>;
|
||||
};
|
||||
|
||||
&kscan0 {
|
||||
row-gpios
|
||||
= <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW1
|
||||
, <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW2
|
||||
, <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW3
|
||||
, <&gpio1 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW4
|
||||
, <&gpio0 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW5
|
||||
, <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // RH ROW6
|
||||
;
|
||||
col-gpios
|
||||
= <&gpio1 6 GPIO_ACTIVE_HIGH> // RH Thumb
|
||||
, <&gpio1 4 GPIO_ACTIVE_HIGH> // RH COL1
|
||||
, <&gpio0 2 GPIO_ACTIVE_HIGH> // RH COL2
|
||||
, <&gpio1 7 GPIO_ACTIVE_HIGH> // RH COL3
|
||||
, <&gpio1 5 GPIO_ACTIVE_HIGH> // RH COL4
|
||||
, <&gpio1 3 GPIO_ACTIVE_HIGH> // RH COL5
|
||||
, <&gpio1 1 GPIO_ACTIVE_HIGH> // RH COL6
|
||||
;
|
||||
};
|
||||
7
app/boards/moergo/glove80/glove80_rh.keymap
Normal file
7
app/boards/moergo/glove80/glove80_rh.keymap
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "glove80.keymap"
|
||||
85
app/boards/moergo/glove80/glove80_rh_defconfig
Normal file
85
app/boards/moergo/glove80/glove80_rh_defconfig
Normal file
@@ -0,0 +1,85 @@
|
||||
# Copyright (c) 2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Enable both USB and BLE
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_BLE=y
|
||||
|
||||
# Keyboard IDs
|
||||
CONFIG_ZMK_KEYBOARD_NAME="Glove80 Right"
|
||||
CONFIG_USB_DEVICE_PID=0x27d9
|
||||
CONFIG_USB_DEVICE_VID=0x16c0
|
||||
CONFIG_USB_DEVICE_MANUFACTURER="MoErgo"
|
||||
CONFIG_USB_DEVICE_SN="moergo.com:GLV80-0123456789ABCDEF"
|
||||
|
||||
CONFIG_BT_DIS_PNP_PID=0x27d9
|
||||
CONFIG_BT_DIS_PNP_VID=0x16c0
|
||||
CONFIG_BT_DIS_MANUF="MoErgo"
|
||||
CONFIG_BT_DIS_MODEL="Glove80 Right"
|
||||
|
||||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# Enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Build configurations
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
CONFIG_BUILD_OUTPUT_UF2_FAMILY_ID="0x9808B007"
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
|
||||
# Flash configuration
|
||||
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
|
||||
|
||||
# Enable RGB underglow
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP=4
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_MIN=4
|
||||
|
||||
# DO NOT CHANGE CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX TO ABOVE 80. Configuring
|
||||
# BRT_MAX above 80% will draw additional current and can potentially damage your
|
||||
# computer. WARRANTY IS VOID IF BRT_MAX SET ABOVE 80.
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_MAX=80
|
||||
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=285
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=75
|
||||
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=16
|
||||
|
||||
# The power LED is implemented as a backlight
|
||||
# For now, the power LED is acting as a "USB connected" indicator
|
||||
CONFIG_ZMK_BACKLIGHT=y
|
||||
CONFIG_ZMK_BACKLIGHT_ON_START=y
|
||||
CONFIG_ZMK_BACKLIGHT_BRT_START=5
|
||||
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y
|
||||
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB=y
|
||||
|
||||
# The full two-byte consumer report space has compatibility issues with some
|
||||
# operating systems, most notably macOS. Use the more basic single-byte usage
|
||||
# space.
|
||||
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
|
||||
|
||||
# Turn on debugging to disable optimization. Debug messages can result in larger
|
||||
# stacks, so enable stack protection and particularly a larger BLE peripheral stack.
|
||||
# CONFIG_DEBUG=y
|
||||
# CONFIG_DEBUG_THREAD_INFO=y
|
||||
# CONFIG_EXCEPTION_STACK_TRACE=y
|
||||
# CONFIG_HW_STACK_PROTECTION=y
|
||||
# CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE=1300
|
||||
|
||||
# Log via USB or Segger RTT
|
||||
CONFIG_ZMK_USB_LOGGING=n
|
||||
CONFIG_ZMK_RTT_LOGGING=n
|
||||
9
app/boards/moergo/glove80/pre_dt_board.cmake
Normal file
9
app/boards/moergo/glove80/pre_dt_board.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (c) 2024 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
|
||||
# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
|
||||
|
||||
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
|
||||
13
app/boards/moergo/glove80/readme.md
Normal file
13
app/boards/moergo/glove80/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
## MoErgo Glove80
|
||||
|
||||
This board definition provides ZMK support for the [MoErgo Glove80](https://www.moergo.com)
|
||||
keyboard.
|
||||
|
||||
MoErgo additionally offers a customized version of ZMK which adds additional functionality such as
|
||||
RGB status indicators, available on GitHub at [moergo-sc/zmk](https://github.com/moergo-sc/zmk). The
|
||||
MoErgo customized ZMK fork is regularly updated to include the latest changes from mainline ZMK, but
|
||||
will not always be completely up-to-date. MoErgo also offers an online layout configurator and
|
||||
firmware builder application using the customized fork at [my.glove80.com](https://my.glove80.com).
|
||||
|
||||
While mainline ZMK is expected to work well with Glove80, MoErgo only provides support for use of
|
||||
their customized fork. Likewise, the ZMK community cannot directly provide support for MoErgo's fork.
|
||||
67
app/boards/moergo/glove80/usb_serial_number.c
Normal file
67
app/boards/moergo/glove80/usb_serial_number.c
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2020 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <zephyr/usb/usb_device.h>
|
||||
#include <zephyr/drivers/hwinfo.h>
|
||||
#include "usb_descriptor.h"
|
||||
|
||||
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(usb_descriptor);
|
||||
|
||||
int base16_encode(const uint8_t *data, int length, uint8_t *result, int bufSize);
|
||||
|
||||
uint8_t *usb_update_sn_string_descriptor(void) {
|
||||
/*
|
||||
* nrf52840 hwinfo returns a 64-bit hardware id. Glove80 uses this as a
|
||||
* serial number, encoded as base16 into the last 16 characters of the
|
||||
* CONFIG_USB_DEVICE_SN template. If insufficient template space is
|
||||
* available, instead return the static serial number string.
|
||||
*/
|
||||
const uint8_t template_len = sizeof(CONFIG_USB_DEVICE_SN);
|
||||
const uint8_t sn_len = 16;
|
||||
|
||||
if (template_len < sn_len + 1) {
|
||||
LOG_DBG("Serial number template too short");
|
||||
return CONFIG_USB_DEVICE_SN;
|
||||
}
|
||||
|
||||
static uint8_t serial[sizeof(CONFIG_USB_DEVICE_SN)];
|
||||
strncpy(serial, CONFIG_USB_DEVICE_SN, template_len);
|
||||
|
||||
uint8_t hwid[8];
|
||||
memset(hwid, 0, sizeof(hwid));
|
||||
uint8_t hwlen = hwinfo_get_device_id(hwid, sizeof(hwid));
|
||||
|
||||
if (hwlen > 0) {
|
||||
const uint8_t offset = template_len - sn_len - 1;
|
||||
LOG_HEXDUMP_DBG(&hwid, sn_len, "Serial Number");
|
||||
base16_encode(hwid, hwlen, serial + offset, sn_len + 1);
|
||||
}
|
||||
|
||||
return serial;
|
||||
}
|
||||
|
||||
int base16_encode(const uint8_t *data, int length, uint8_t *result, int bufSize) {
|
||||
const char hex[] = "0123456789ABCDEF";
|
||||
|
||||
int i = 0;
|
||||
while (i < bufSize && i < length * 2) {
|
||||
uint8_t nibble;
|
||||
if (i % 2 == 0) {
|
||||
nibble = data[i / 2] >> 4;
|
||||
} else {
|
||||
nibble = data[i / 2] & 0xF;
|
||||
}
|
||||
result[i] = hex[nibble];
|
||||
++i;
|
||||
}
|
||||
if (i < bufSize) {
|
||||
result[i] = '\0';
|
||||
}
|
||||
return i;
|
||||
}
|
||||
Reference in New Issue
Block a user