Compare commits

..

39 Commits

Author SHA1 Message Date
9c1f27d103 Adding in code for jNumpad and pslgh 2023-11-24 09:05:16 +00:00
Cem Aksoylar
a3f30ee799 feat(build): Add support for artifact-name in build.yaml, correctly 2023-11-23 21:09:14 -08:00
Idan Gazit
f77e38f2b9 chore: Update devcontainer.json
The format has changed slightly.
2023-11-23 21:02:22 -08:00
Chris Andreae
0a4b1a6533 feat(ble): add behavior to disconnect from BLE profile
Adds new functionality and a behavior to disconnect an active BLE connection.
The motivation for this is that for some devices like phones, the presence of an
active BLE connection results in the onscreen keyboard being selected.
2023-11-20 15:00:10 -05:00
Alexander Krikun
d7d9eed317 feat(mouse): Initial mouse keys support.
* Add HID report/descriptor for a new report with mouse buttons,
  and x/y/wheel deltas.
* New mouse key press behavior for press/release of mouse keys.
* Add constants for HID main item values (e.g. data/array/absolute)
* Define and use constants for our HID report IDs.
2023-11-15 11:16:59 -08:00
ReFil
8776911da5 feat(ble): Allow disabling BLE BAS reporting
The battery reporting has been known to cause macOS computers to wakeup repeatedly. In some cases (e.g. display or custom lighting implementation) one might want to collect battery SOC without broadcasting over BLE

* Update docs/docs/config/battery.md

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-11-15 13:03:30 -05:00
Peter Johanson
3027b2a6e8 chore(usb): Don't enable ZMK_USB_ROOT by default.
* Some initial reports of crashes with this code enabled, so disabling
  by default for now pending further investigation.
2023-11-13 23:56:10 -08:00
Peter Johanson
f6716f869a fix(usb): Build with ZMK_USB_BOOT disabled.
* Invert the logic so `get_keyboard_report` is sane when `ZMK_USB_BOOT`
  is disabled.
2023-11-13 23:56:10 -08:00
Chris Andreae
2a1904e184 feat(boards): Add Glove80 to boards
* Add board definition for MoErgo Glove80
2023-11-14 02:08:58 -05:00
Pete Johanson
afe65ead9c Revert "feat(build): Add support for artifact-name in build.yaml"
This reverts commit c1bf35ce1d.
2023-11-13 13:51:08 -08:00
Peter Johanson
964c54139d fix(usb): Tweak how ZMK_USB gets enabled.
* Previous version of multiple overrides of the default value of ZMK_USB
  were problematic. Move to using board _defconfig files for the
  defaults for those, along with proper `depends on` for ZMK_USB that
  accounts for split and split roles.
2023-11-13 12:56:23 -08:00
Cem Aksoylar
7b4b5d4ff2 fix(docs): Fix debouncing driver support note 2023-11-13 12:37:09 -08:00
Cem Aksoylar
a5c3edd51b refactor(docs): Remove local build section in customization 2023-11-13 12:34:44 -08:00
Cem Aksoylar
2554b5c88f fix(docs): Update boards in build examples to common+uf2 ones 2023-11-13 12:34:44 -08:00
Cem Aksoylar
c1bf35ce1d feat(build): Add support for artifact-name in build.yaml 2023-11-13 12:27:05 -08:00
Chris Andreae
91aa3378f3 feat(usb): Add boot protocol support
* USB boot protocol support
* Use a single definition of a boot report, used for regular reports in
  non-6KRO, and for rollover in all branches.
* Handle gaps in the zmk report when producing a boot report in HKRO mode. For
  .example, if it was 8KRO, it would be possible to have the state 0 0 0 0 0 0 0
  17 (by pressing 8 keys, and letting go of the first 7). Copying the first 6
  bytes would not show up the single pressed key.
* Disable usb status change and callback on SOF events:
  SOF events were introduced by the boot protocol changes, and required internally
  by Zephyr's idle support, but are unused within ZMK itself. Ignore them in the
  usb status callback.

---------

Co-authored-by: Andrew Childs <lorne@cons.org.nz>
2023-11-13 13:04:04 -05:00
Cem Aksoylar
b80c0be0ce feat(blog): Add keymap editor post for spotlight series
Co-authored-by: Nick Coutsos <nick@coutsos.com>
2023-11-08 23:00:26 -08:00
Cem Aksoylar
5b49bc10cd feat(blog): Show all posts on sidebar 2023-11-08 23:00:26 -08:00
Peter Johanson
c2d220fbdf refactor(hid): Use proper defines for HID values.
* Add report ID defines and use them consistently.
* Add defines for main item value flags to avoid magic constants.
2023-11-08 16:00:19 -08:00
Peter Johanson
34c8b3f1e3 refactor: Update boards/shields for encoders.
* Update existing boards/shields for new `steps` and
  `triggers-per-rotation` set up.
2023-11-03 12:35:25 -07:00
Peter Johanson
8d09809ef0 fix(docs): Updated encoder config docs.
* Update new shield guide for new sensor/encoder settings.
* Add DTS section to encoder config docs.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-11-03 12:35:25 -07:00
Nick Coutsos
9e8ee86842 chore(docs): Fix links to relocated files (#1975) 2023-10-22 09:05:49 -07:00
ReFil
82e85699ed feat(docs): Document ZMK_BATTERY_REPORTING config (#1971)
`CONFIG_ZMK_BATTERY_REPORTING` is currently undocumented, A new KConfig section for battery has been added in line with the other sections in the configuration section of the docs, `CONFIG_ZMK_BATTERY_REPORT_INTERVAL` has been moved from system to battery for consistency
2023-10-19 14:04:04 -07:00
Khalid Aj
7fe9ecd87f feat(shields): Add Reviung53 shield.
* Initial Reviung53 shield

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-10-17 18:43:50 -04:00
Joel Spadin
3b1d04372b feat: Print Kconfig and DTS for failed builds
Added the combined devicetree file to the user config build action. Set
it and the Kconfig output to run even on a failed build.
2023-10-17 15:35:44 -07:00
Alex Kang
a9a53e6da4 feat(shields): Reviung34 shield definition
* Initial implementation of REVIUNG34 shield.
* Add copyright information to files
* Added a README with instructions on how to enable the 1x2u layout.
* Add a default chosen matrix transform in the default keymap, alongside a commented out version for the alternate layout.

---------

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-10-14 19:39:42 -07:00
Peter Johanson
3ab922822c feat(shields): Add ZMK Uno nice!view support.
Export the `nice_view_spi` node properly from the ZMK Uno overlay
to ensure the shield will work when built along with the `nice_view`
shield.
2023-10-14 10:51:48 -07:00
Cem Aksoylar
a9f677007b fix(blog): Correct incorrect info re: global-quick-tap 2023-10-11 12:18:02 -07:00
dependabot[bot]
0c06023ca0 chore(deps): bump postcss from 8.4.18 to 8.4.31 in /docs
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.18 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.18...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-10 16:17:44 -07:00
ReFil
6c75d6986c feat(docs): Document globe key specific quirks 2023-10-10 14:04:28 -07:00
Joel Spadin
65667b863a docs: Add syntax highlighting to more code blocks
Added language tags to more code blocks in the documentation to enable
syntax highlighting.
2023-10-09 15:19:24 -07:00
Joel Spadin
4a339093ce docs: Add highlighting for devicetree and kconfig
Added syntax highlighting for devicetree and kconfig files.

The PrismJS project is not accepting contributions right now as they
work on a version 2 of the library, so the new language files are added
directly here.

Also enabled syntax highlighting for various languages that are used in
the docs but aren't enabled in Docusaurus by default.
2023-10-09 15:19:24 -07:00
Diogo Doreto
6af22424f1 feat(shields): add right encoders support to waterfowl 2023-10-09 11:46:05 -07:00
Cem Aksoylar
791711b555 feat(docs): Note how to use GPIO outside interconnect definition 2023-10-08 18:38:48 -07:00
Joel Spadin
8a84b7dd5b fix(shields): Fix incorrect union access in nice view
Fixed an error in a previous commit where a member of the selected
endpoint was used without checking if it was the correct transport type.
The nice!view status screen displays the active BLE profile regardless
of whether BLE is active, so we have to get that data directly from the
BLE code instead of from the selected endpoint.
2023-10-08 19:30:23 -04:00
Alex Kang
fd05478897 feat(shields): Microdox V2 shield definition
* Refactor common parts of the Microdox sheild into a separate file. This is in preparation for adding Microdox V2 as another shield in the same directory.
* Refactor Microdox keymap into a common file in preparation for Microdox V2
* Add Microdox V2 shield definition
* Added a README to explain v1/v2 differences.
2023-10-06 15:27:38 -04:00
Cem Aksoylar
ca5c9b4ae6 feat(blog): Add SOTF #6 (#1943)
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2023-10-05 19:53:15 -07:00
Amettler Thierry
913fdb831e feat(docs): Add configuration snippet for layer-taps 2023-10-04 13:29:06 -07:00
Seth Milliken
df92b0e37d feat(shields): sofle: add underglow support with &pinctrl update
* Sofle Shield: Add underglow support

---------

Co-authored-by: Kim Streich <kim@infusedinsight.com>
Co-authored-by: Seth Milliken <seth_zmk@araxia.net>
2023-10-04 11:48:46 -04:00
252 changed files with 4429 additions and 635 deletions

View File

@@ -13,9 +13,13 @@
"type=volume,source=zmk-zephyr-modules,target=${containerWorkspaceFolder}/modules",
"type=volume,source=zmk-zephyr-tools,target=${containerWorkspaceFolder}/tools"
],
"extensions": ["ms-vscode.cpptools"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
},
"forwardPorts": [3000]
}

View File

@@ -55,12 +55,14 @@ jobs:
- name: Prepare variables
shell: sh -x {0}
env:
board: ${{ matrix.board }}
shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }}
run: |
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${{ matrix.board }}" >> $GITHUB_ENV
echo "artifact_name=${shield:+$shield-}${{ matrix.board }}-zmk" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
@@ -97,7 +99,27 @@ jobs:
run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
- name: ${{ env.display_name }} Kconfig file
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort
run: |
if [ -f build/zephyr/.config ]
then
grep -v -e "^#" -e "^$" build/zephyr/.config | sort
else
echo "No Kconfig output"
fi
if: ${{ !cancelled() }}
- name: ${{ env.display_name }} Devicetree file
run: |
if [ -f build/zephyr/zephyr.dts ]
then
cat build/zephyr/zephyr.dts
elif [ -f build/zephyr/zephyr.dts.pre ]
then
cat -s build/zephyr/zephyr.dts.pre
else
echo "No Devicetree output"
fi
if: ${{ !cancelled() }}
- name: Rename artifacts
shell: sh -x {0}

View File

@@ -31,12 +31,14 @@ target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
target_sources(app PRIVATE src/events/activity_state_changed.c)
target_sources(app PRIVATE src/events/position_state_changed.c)
target_sources(app PRIVATE src/events/sensor_event.c)
target_sources(app PRIVATE src/events/mouse_button_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/events/usb_conn_state_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/hid.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse.c)
target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_KEY_TOGGLE app PRIVATE src/behaviors/behavior_key_toggle.c)
target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c)
@@ -54,6 +56,7 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE app PRIVATE src/behaviors/behavior_sensor_rotate.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR app PRIVATE src/behaviors/behavior_sensor_rotate_var.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON app PRIVATE src/behaviors/behavior_sensor_rotate_common.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_MOUSE_KEY_PRESS app PRIVATE src/behaviors/behavior_mouse_key_press.c)
target_sources(app PRIVATE src/combo.c)
target_sources(app PRIVATE src/behaviors/behavior_tap_dance.c)
target_sources(app PRIVATE src/behavior_queue.c)

View File

@@ -91,10 +91,17 @@ menu "Output Types"
config ZMK_USB
bool "USB"
depends on (!ZMK_SPLIT || (ZMK_SPLIT && ZMK_SPLIT_ROLE_CENTRAL))
select USB
select USB_DEVICE_STACK
select USB_DEVICE_HID
config ZMK_USB_BOOT
bool "USB Boot Protocol Support"
depends on ZMK_USB
select USB_HID_BOOT_PROTOCOL
select USB_DEVICE_SOF
if ZMK_USB
config USB_NUMOF_EP_WRITE_RETRIES
@@ -149,6 +156,10 @@ config ZMK_BLE_CONSUMER_REPORT_QUEUE_SIZE
int "Max number of consumer HID reports to queue for sending over BLE"
default 5
config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
int "Max number of mouse HID reports to queue for sending over BLE"
default 20
config ZMK_BLE_CLEAR_BONDS_ON_START
bool "Configuration that clears all bond information from the keyboard on startup."
default n
@@ -308,13 +319,22 @@ endif
#Display/LED Options
endmenu
menu "Mouse Options"
config ZMK_MOUSE
bool "Enable ZMK mouse emulation"
default n
#Mouse Options
endmenu
menu "Power Management"
config ZMK_BATTERY_REPORTING
bool "Battery level detection/reporting"
default n
select SENSOR
select BT_BAS if ZMK_BLE
imply BT_BAS if ZMK_BLE
config ZMK_IDLE_TIMEOUT
int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
@@ -575,4 +595,3 @@ osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield"
source "Kconfig.zephyr"

View File

@@ -6,6 +6,11 @@ config ZMK_BEHAVIOR_KEY_TOGGLE
default y
depends on DT_HAS_ZMK_BEHAVIOR_KEY_TOGGLE_ENABLED
config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE
config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool

View File

@@ -11,9 +11,6 @@ config BOARD
config ZMK_KEYBOARD_NAME
default "BDN9 Rev2"
config ZMK_USB
default y
config ZMK_RGB_UNDERGLOW
select SPI
select WS2812_STRIP

View File

@@ -43,7 +43,7 @@
label = "LEFT_ENCODER";
a-gpios = <&gpioa 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
mid_encoder: encoder_mid {
@@ -51,7 +51,7 @@
label = "MID_ENCODER";
a-gpios = <&gpioa 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpioa 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder: encoder_right {
@@ -59,7 +59,7 @@
label = "RIGHT_ENCODER";
a-gpios = <&gpioa 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpiob 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@@ -67,6 +67,7 @@
compatible = "zmk,keymap-sensors";
status = "disabled";
sensors = <>;
triggers-per-rotation = <20>;
};
};

View File

@@ -23,3 +23,4 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y

View File

@@ -18,10 +18,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_BLUEMICRO840_V1

View File

@@ -21,3 +21,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -19,12 +19,6 @@ endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
config ZMK_KEYBOARD_NAME
default "BT60"

View File

@@ -22,9 +22,10 @@
zmk,matrix_transform = &default_transform;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
@@ -34,7 +35,7 @@
label = "LEFT_ENCODER";
a-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};

View File

@@ -23,3 +23,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -23,3 +23,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -25,10 +25,4 @@ endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_BT60_V2 || BOARD_BT65_V1 || BOARD_BT75_V1

View File

@@ -36,3 +36,6 @@ CONFIG_WS2812_STRIP=y
CONFIG_SPI=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -36,3 +36,6 @@ CONFIG_WS2812_STRIP=y
CONFIG_SPI=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -36,3 +36,6 @@ CONFIG_WS2812_STRIP=y
CONFIG_SPI=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -26,9 +26,10 @@
zmk,battery = &vbatt;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};
kscan0: kscan_0 {
@@ -76,7 +77,7 @@
label = "ENCODER_ONE";
a-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@@ -85,7 +86,7 @@
label = "ENCODER_TWO";
a-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@@ -94,7 +95,7 @@
label = "encoder_3";
a-gpios = <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};

View File

@@ -25,12 +25,6 @@ config ZMK_SPLIT
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
if USB
config USB_NRFX

View File

@@ -39,6 +39,9 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048

View File

@@ -39,6 +39,9 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048

View File

@@ -35,6 +35,9 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048

View File

@@ -35,6 +35,9 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048

View File

@@ -8,7 +8,4 @@ if BOARD_DZ60RGB_REV1
config ZMK_KEYBOARD_NAME
default "DZ60RGB Rev 1"
config ZMK_USB
default y
endif # BOARD_DZ60RGB_REV1

View File

@@ -25,3 +25,5 @@ CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
CONFIG_ZMK_USB=y

View File

@@ -11,9 +11,6 @@ config BOARD
config ZMK_KEYBOARD_NAME
default "Ferris rev 0.2"
config ZMK_USB
default y
config ZMK_KSCAN_MATRIX_POLLING
default y

View File

@@ -0,0 +1,3 @@
zephyr_library()
zephyr_library_sources(usb_serial_number.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on (BOARD_GLOVE80_LH || BOARD_GLOVE80_RH)

View File

@@ -0,0 +1,10 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_GLOVE80_LH
bool "Glove80 LH"
depends on SOC_NRF52840_QIAA
config BOARD_GLOVE80_RH
bool "Glove80 RH"
depends on SOC_NRF52840_QIAA

View File

@@ -0,0 +1,65 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
if BOARD_GLOVE80_LH
config BOARD
default "glove80 lh"
config ZMK_SPLIT_BLE_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
if ZMK_RGB_UNDERGLOW
config SPI
default y
config WS2812_STRIP
default y
endif # ZMK_RGB_UNDERGLOW
endif # BOARD_GLOVE80_LH || BOARD_GLOVE80_RH

View 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/blackmagicprobe.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View File

@@ -0,0 +1,107 @@
/*
* Copyright (c) 2021 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};
default_transform: 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";
label = "KSCAN";
diode-direction = "col2row";
debounce-press-ms = <4>;
debounce-release-ms = <20>;
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&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>;
};
};
};

View File

@@ -0,0 +1,114 @@
/*
* 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";
label = "LAYER_TAP_DANCE";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&mo LOWER>, <&to LOWER>;
};
};
macros {
bt_0: bt_profile_macro_0 {
label = "BT_0";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 0>;
};
bt_1: bt_profile_macro_1 {
label = "BT_1";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 1>;
};
bt_2: bt_profile_macro_2 {
label = "BT_2";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 2>;
};
bt_3: bt_profile_macro_3 {
label = "BT_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
>;
};
};
};

View 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

View File

@@ -0,0 +1,16 @@
file_format: "1"
id: glove80
name: Glove80
type: board
arch: arm
url: https://www.moergo.com/
features:
- keys
- underglow
- backlight
outputs:
- usb
- ble
siblings:
- glove80_lh
- glove80_rh

View 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;
};
};
};

View File

@@ -0,0 +1,101 @@
/*
* 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";
label = "BACK LED";
pwm_led_0 {
pwms = <&pwm0 0 PWM_USEC(20) PWM_POLARITY_NORMAL>;
label = "Back LED configured as backlight";
};
};
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; /* WS2812_CE */
init-delay-ms = <100>;
};
vbatt: vbatt {
compatible = "zmk,battery-nrf-vddh";
label = "BATTERY";
};
};
&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";
label = "WS2812C-2020";
/* 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
;
};

View File

@@ -0,0 +1,7 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "glove80.keymap"

View File

@@ -0,0 +1,92 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_GLOVE80_LH=y
# 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

View 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;
};
};
};

View File

@@ -0,0 +1,108 @@
/*
* 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";
label = "BACK LED";
pwm_led_0 {
pwms = <&pwm0 0 PWM_USEC(20) PWM_POLARITY_NORMAL>;
label = "Back LED configured as backlight";
};
};
ext-power {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; /* WS2812_CE */
init-delay-ms = <100>;
};
vbatt: vbatt {
compatible = "zmk,battery-nrf-vddh";
label = "BATTERY";
};
};
&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";
label = "WS2812C-2020";
/* 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 */
&default_transform {
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
;
};

View File

@@ -0,0 +1,7 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "glove80.keymap"

View File

@@ -0,0 +1,89 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_GLOVE80_RH=y
# 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

View 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.

View 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;
}

View File

@@ -9,7 +9,4 @@ config ZMK_KEYBOARD_NAME
config RP2_FLASH_W25Q080
default y
config ZMK_USB
default y
endif # BOARD_KBDFANS_TOFU65_V2

View File

@@ -18,3 +18,5 @@ CONFIG_USE_DT_CODE_PARTITION=y
# Output UF2 by default, native bootloader supports it.
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_ZMK_USB=y

View File

@@ -21,12 +21,6 @@ endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
config PINMUX
default y

View File

@@ -21,3 +21,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -16,10 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_NICE60

View File

@@ -28,3 +28,7 @@ CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=160
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -16,10 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2

View File

@@ -22,3 +22,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -22,3 +22,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_BLE=y
CONFIG_ZMK_USB=y

View File

@@ -16,10 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_NRF52840_M2

View File

@@ -20,3 +20,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -18,12 +18,6 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
config PINMUX
default y

View File

@@ -23,3 +23,6 @@ CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -23,3 +23,6 @@ CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -23,3 +23,6 @@ CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -23,3 +23,6 @@ CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -16,10 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_PILLBUG

View File

@@ -23,3 +23,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -8,9 +8,6 @@ if BOARD_PLANCK_REV6
config ZMK_KEYBOARD_NAME
default "Planck V6"
config ZMK_USB
default y
config ZMK_KSCAN_MATRIX_POLLING
default y

View File

@@ -15,3 +15,5 @@ CONFIG_GPIO=y
# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y

View File

@@ -8,9 +8,6 @@ if BOARD_PREONIC_REV3
config ZMK_KEYBOARD_NAME
default "Preonic V3"
config ZMK_USB
default y
config ZMK_KSCAN_MATRIX_POLLING
default y

View File

@@ -13,3 +13,5 @@ CONFIG_GPIO=y
# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y

View File

@@ -8,7 +8,4 @@ if BOARD_QMK_PROTON_C
config BOARD
default "proton_c"
config ZMK_USB
default y
endif # BOARD_QMK_PROTON_C

View File

@@ -17,3 +17,4 @@ CONFIG_GPIO=y
# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y

View File

@@ -16,12 +16,6 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
config PINMUX
default y

View File

@@ -25,3 +25,6 @@ CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -19,10 +19,4 @@ endif # USB
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
endif # BOARD_S40NC

View File

@@ -20,3 +20,6 @@ CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View File

@@ -0,0 +1,40 @@
# Copyright (c) 2020 Pete Johanson, Richard Jones
# SPDX-License-Identifier: MIT
if SHIELD_JNUMPAD
config ZMK_KEYBOARD_NAME
default "jNumpad Wireless"
endif
if ZMK_DISPLAY
config I2C
default y
config SSD1306
default y
config SSD1306_REVERSE_MODE
default y
endif # ZMK_DISPLAY
if LVGL
config LV_Z_VDB_SIZE
default 64
config LV_Z_DPI
default 148
config LV_Z_BITS_PER_PIXEL
default 1
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
endchoice
endif # LVGL

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2020 Pete Johanson, Richard Jones
# SPDX-License-Identifier: MIT
config SHIELD_JNUMPAD
def_bool $(shields_list_contains,jnumpad)

View File

@@ -0,0 +1,7 @@
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN=y
CONFIG_ZMK_DISPLAY_WORK_QUEUE_SYSTEM=y
CONFIG_ZMK_WIDGET_BATTERY_STATUS=y
CONFIG_ZMK_WIDGET_BATTERY_STATUS_SHOW_PERCENTAGE=y
CONFIG_ZMK_WIDGET_WPM_STATUS=y
CONFIG_ZMK_EXT_POWER=y

View File

@@ -0,0 +1,48 @@
/ {
chosen {
zmk,kscan = &kscan0;
zephyr,display = &oled;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 9 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
;
};
};
&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>;
};
};

View File

@@ -0,0 +1,73 @@
// numpad.keymap
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
/ {
combos {
compatible = "zmk,combos";
combo_ext_pwr {
timeout-ms = <50>;
key-positions = <1 2>;
bindings = <&ext_power EP_TOG>;
};
combo_bt_prv {
timeout-ms = <50>;
key-positions = <1 3>;
bindings = <&bt BT_PRV>;
};
combo_bt_nxt {
timeout-ms = <50>;
key-positions = <1 7>;
bindings = <&bt BT_NXT>;
};
combo_reset {
timeout-ms = <50>;
key-positions = <1 15>;
bindings = <&sys_reset>;
};
combo_btclr {
timeout-ms = <50>;
key-positions = <1 16>;
bindings = <&bt BT_CLR>;
};
combo_btldr {
timeout-ms = <50>;
key-positions = <1 18>;
bindings = <&bootloader>;
};
};
};
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// ┌───┬───┬───┬───┐
// │NUM│ / │ * │ - │
// ├───┼───┼───┼───┤
// │ 7 │ 8 │ 9 │ + │
// ├───┼───┼───┼─ ─┤
// │ 4 │ 5 │ 6 │ │
// ├───┼───┼───┼───┤
// │ 1 │ 2 │ 3 │RET│
// ├───┴───┼───┼─ ─┤
// │ 0 │ . │ │
// └───────┴───┴───┘
bindings = <
&kp KP_NUM &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS
&kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_PLUS
&kp KP_N4 &kp KP_N5 &kp KP_N6 &trans
&kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER
&kp KP_N0 &trans &kp KP_DOT &trans
>;
};
};
};

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2020 Pete Johanson, Richard Jones
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "jnumpad.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
zephyr,display = &oled;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&pro_micro 9 GPIO_ACTIVE_HIGH>
, <&pro_micro 8 GPIO_ACTIVE_HIGH>
, <&pro_micro 7 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
;
};
};

View File

@@ -39,7 +39,7 @@
label = "TOP_ENCODER";
a-gpios = <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
@@ -48,13 +48,14 @@
label = "BOTTOM_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "okay";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&top_encoder &bottom_encoder>;
triggers-per-rotation = <20>;
};
};

View File

@@ -23,20 +23,21 @@
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};
right_encoder: encoder_right {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
// TODO: RGB node(s)

View File

@@ -51,12 +51,13 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7)
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
};

View File

@@ -50,7 +50,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@@ -59,13 +59,14 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
};

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_MICRODOX_LEFT
if SHIELD_MICRODOX_LEFT || SHIELD_MICRODOX_V2_LEFT
config ZMK_KEYBOARD_NAME
default "Microdox"
@@ -11,7 +11,7 @@ config ZMK_SPLIT_ROLE_CENTRAL
endif
if SHIELD_MICRODOX_LEFT || SHIELD_MICRODOX_RIGHT
if SHIELD_MICRODOX_LEFT || SHIELD_MICRODOX_RIGHT || SHIELD_MICRODOX_V2_LEFT || SHIELD_MICRODOX_V2_RIGHT
config ZMK_SPLIT
default y

View File

@@ -6,3 +6,9 @@ config SHIELD_MICRODOX_LEFT
config SHIELD_MICRODOX_RIGHT
def_bool $(shields_list_contains,microdox_right)
config SHIELD_MICRODOX_V2_LEFT
def_bool $(shields_list_contains,microdox_v2_left)
config SHIELD_MICRODOX_V2_RIGHT
def_bool $(shields_list_contains,microdox_v2_right)

View File

@@ -0,0 +1,8 @@
# Microdox
Microdox is a 36 key split keyboard by Boardsource.
Two variants are defined for this shield V1 and V2. The layout is exactly the same between the
two. Per [help documentation](https://www.boardsource.xyz/help/6129be4a9c85c6050be190d2), if you
purchased your PCB before April 2022, use `microdox_left`/`microdox_right`. Otherwise, use
`microdox_v2_left`/`microdox_v2_right`.

View File

@@ -4,35 +4,12 @@
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "microdox_common.dtsi"
/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <10>;
rows = <4>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW6 | SW7 | SW8 | SW9 | SW10 | | SW10 | SW9 | SW8 | SW7 | SW6 |
// | SW11 | SW12 | SW13 | SW14 | SW15 | | SW15 | SW14 | SW13 | SW12 | SW11 |
// | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
@@ -40,26 +17,5 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
// TODO: per-key RGB node(s)?
};
&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>;
com-sequential;
prechargep = <0x22>;
};
};

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <10>;
rows = <4>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW6 | SW7 | SW8 | SW9 | SW10 | | SW10 | SW9 | SW8 | SW7 | SW6 |
// | SW11 | SW12 | SW13 | SW14 | SW15 | | SW15 | SW14 | SW13 | SW12 | SW11 |
// | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
>;
};
// TODO: per-key RGB node(s)?
};
&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>;
com-sequential;
prechargep = <0x22>;
};
};

View File

@@ -0,0 +1,6 @@
# Uncomment the following lines to enable the Microdox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Microdox OLED Display
# CONFIG_ZMK_DISPLAY=y

View File

@@ -0,0 +1,15 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "microdox_common.dtsi"
/ {
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
};
};

View File

@@ -0,0 +1,13 @@
file_format: "1"
id: microdox_v2
name: Microdox V2
type: shield
url: https://boardsource.xyz/store/5f2e7e4a2902de7151494f92
requires: [pro_micro]
exposes: [i2c_oled]
features:
- keys
- display
siblings:
- microdox_v2_left
- microdox_v2_right

View File

@@ -0,0 +1,23 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "microdox_v2.dtsi"
&kscan0 {
col-gpios
= <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 18 GPIO_ACTIVE_HIGH>
, <&pro_micro 19 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

View File

@@ -0,0 +1,32 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "microdox.dtsi"
&default_transform {
col-offset = <5>;
};
&oled {
segment-remap;
com-invdir;
};
&kscan0 {
col-gpios
= <&pro_micro 14 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
, <&pro_micro 6 GPIO_ACTIVE_HIGH>
, <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 21 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

View File

@@ -48,6 +48,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1 &encoder_2>;
triggers-per-rotation = <20>;
};

View File

@@ -39,7 +39,7 @@
label = "Encoder 1";
a-gpios = <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};
@@ -48,7 +48,7 @@
label = "Encoder 2";
a-gpios = <&pro_micro 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
resolution = <4>;
steps = <80>;
status = "disabled";
};

View File

@@ -6,10 +6,6 @@ if SHIELD_NIBBLE
config ZMK_KEYBOARD_NAME
default "NIBBLE"
config ZMK_USB
default y
if ZMK_DISPLAY
config I2C

View File

@@ -12,6 +12,7 @@
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};
keymap {

Some files were not shown because too many files have changed in this diff Show More