Compare commits

...
Sign in to create a new pull request.

408 commits

Author SHA1 Message Date
Peter Johanson
6b4d591c37 fix(bt): Fix compilation failure for clearing bonds.
Some checks failed
BLE Tests / collect-tests (push) Has been cancelled
Docs Checks / lint (push) Has been cancelled
Docs Checks / typecheck (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / collect-tests (push) Has been cancelled
BLE Tests / run-tests (push) Has been cancelled
Tests / run-tests (push) Has been cancelled
* Refactor broke the build when clearing bonds on start.
2024-09-09 11:26:53 -06:00
Nicolas Munnich
1c48f64730
fix(docs): Fix broken anchor in Studio setup (#2465) 2024-09-07 09:26:24 -07:00
Nicolas Munnich
f0319fde94
docs(feat): Added a page on shift registers (#2452)
Added a page on shift registers
---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-09-07 13:19:01 +02:00
Pete Johanson
d52bb04090 Revert "feat: Split physical layout selection sync."
This reverts commit 03b5b38bc4.
2024-09-07 00:22:01 -06:00
Grazfather
58207fdb2c
fix(docs): Mention display-name property in layer docs (#2460) 2024-09-06 20:03:23 -07:00
Alexander Krikun
cddc92108c fix(boards): add sleep pinctrl node for nice!60
Add spi3_sleep pinctrl node to fix nice!60 builds with
both RGB underglow and sleep enabled.
2024-09-06 13:04:22 -06:00
honorless
a2f32cc12c refactor(shield): tidbit
* Implement alternative matrix-transform.

* Add missing wakeup-source attribute.

* Revise README to provide more appropriate information.

* Remove unnecessary files (partially-functional shield).
2024-09-06 13:02:15 -06:00
Robert U
2a137bb675
fix: Support west test when invoked as module 2024-09-06 14:56:40 -04:00
dependabot[bot]
ba6f21fd2b chore(deps): bump tj-actions/changed-files from 44 to 45
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44 to 45.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v44...v45)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 12:51:29 -06:00
ReFil
91447ac55c
fix: Correct max brightness in backlight metadata
The set brightness function in the backlighting code has a max of 100, as does the zephyr led-pwm driver https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/led/led_pwm.c

The range for the set brightness function should reflect this max
2024-09-06 14:36:08 -04:00
honorless
eaa8989f37 style: update commented-out obsolete keycodes 2024-09-06 12:22:54 -06:00
honorless
e0ec2ff84d refactor: update obsolete keycodes 2024-09-06 12:22:54 -06:00
Peter Johanson
03b5b38bc4 feat: Split physical layout selection sync.
* Ensure the split peripherals have the same selected physical
  layout on connection and change.
2024-09-06 12:20:45 -06:00
Peter Johanson
3975d2fdaf feat: Add studio related documentation.
* Document setting up studio for a new keyboard definition.
* Document how to enable ZMK Studio for a build, adding reserved layers,
  and controlling which behaviors are built into a studio firmware.
* Document `&studio_unlock` behavior.
* Document studio configuration options.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-09-05 12:22:08 -06:00
Peter Johanson
5176fbea6a fix: Locking fix for RPC subsystem. 2024-09-05 12:22:08 -06:00
Peter Johanson
782695f4a9 fix: Fixes for CRC16 local IDs. 2024-09-05 12:22:08 -06:00
Peter Johanson
e0339a2a57 feat: Add shared layout .dtsi files to promote reuse.
* Add Corne and Ferris shared layouts, and update the respective
  shields to use them.
* Add a sample Hummingbird physical layout for testing posix xiao.
* Add Sofle physical layout as an additional reference.
2024-09-05 12:22:08 -06:00
Peter Johanson
b84436e611 feat: Add posix_pro_micro and posix_seeed_xiao shields
* Make it easier to test native builds of our shields by adding
  `posix_pro_micro` and `posix_seeed_xiao` so you can build posix
  target of, e.g. `corne_left` for testing ZMK Studio.
2024-09-05 12:22:08 -06:00
Peter Johanson
fd28eab179 feat: Add the ability to keep/omit behaviors for a given build.
* Use defines to keep either all behaviors with omits, or selective behaviors with
  explicit kept behavior, before including `behavior.dtsi` in keymaps.
* Default ZMK_BEHAVIORS_KEEP_ALL when building with the studio RPC
  endpoint snippet.
2024-09-05 12:22:08 -06:00
Peter Johanson
d77e400eb9 feat(boards): Add posix MiniVan studio tester
* New shield to easily test studio using the `native_posix_64` board.
2024-09-05 12:22:08 -06:00
Peter Johanson
c8c19598a7 feat(keymap): Add binding get/set, layer movement
* Add keymap API for getting/setting a bindings
  in keymap layers.
* Add layer move support via intemediary ordering array.
* Add settings storage for keymap changes.
2024-09-05 12:22:08 -06:00
dependabot[bot]
0f972f1cc3 chore(deps): bump web-tree-sitter from 0.20.8 to 0.23.0 in /docs
Bumps [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) from 0.20.8 to 0.23.0.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Changelog](https://github.com/tree-sitter/tree-sitter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tree-sitter/tree-sitter/compare/v0.20.8...v0.23.0)

---
updated-dependencies:
- dependency-name: web-tree-sitter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 22:57:37 -07:00
Nicolas Munnich
266227b580
refactor(docs): Refactor the development section (#2438) 2024-09-01 21:54:19 -07:00
Cem Aksoylar
aae4feeda8 chore(deps): npm update on docs 2024-09-01 21:37:47 -07:00
Cem Aksoylar
b74cd39ab5 chore(blog): Use truncate markers 2024-09-01 00:15:23 -07:00
Cem Aksoylar
0120156002 refactor(blog): Use global authors 2024-09-01 00:15:23 -07:00
Cem Aksoylar
745b960593 fix(docs): Fix broken anchors 2024-09-01 00:13:46 -07:00
dependabot[bot]
882226e261 chore(deps-dev): bump webpack from 5.89.0 to 5.94.0 in /docs
Bumps [webpack](https://github.com/webpack/webpack) from 5.89.0 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.89.0...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-31 17:13:32 -07:00
dependabot[bot]
d74896d780 chore(deps): bump micromatch from 4.0.5 to 4.0.8 in /docs
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-31 17:06:43 -07:00
Mike Szczys
f019524600 fix(display): widgets: increase buffer size for symbols
Increase buffer size used for placing LVGL symbols on displays. This
prevents array overflow warnings as discussed in #2444.

Also convert one sprintf to snprintf to ensure the buffers are always
null terminated and never overflow.

Signed-off-by: Mike Szczys <szczys@hotmail.com>
2024-08-28 00:35:28 -06:00
Anant Thazhemadam
6946ca8b07
fix(docs): minor corrections and fix typo (#2443)
* docs(faq): minor corrections

* docs: fix typo - `s/Alterative/Alternative`

* docs(faq): use Lily58 as an example instead of Corne with revision

Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>

---------

Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
2024-08-27 16:23:15 +02:00
William Brockhus
b866ec031f
fix(docs): Fixing wording in the split keyboards feature page (#2440) 2024-08-25 09:31:21 +02:00
Nicolas Munnich
5f056f7199
refactor(docs): Convert the keymaps section into a base folder (#2430)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-21 10:39:18 -07:00
Nicolas Munnich
503f6c8e58
feat(docs): Add and modify docs to point users to the experimental zmk-cli (#2431)
Co-authored-by: Joel Spadin <joelspadin@gmail.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-21 10:36:23 -07:00
Peter Johanson
b735a051ce fix(docs): Admonition formatting fix. 2024-08-15 12:51:38 -06:00
Peter Johanson
d5061c5d3b fix: Make CRC behavior local ID select CRC. 2024-08-15 11:45:18 -06:00
Peter Johanson
6ae6bf78b4 fix(boards): BDN9 rev2 tweaks.
* Reduce RAM usage, no need for heap any more in ZMK.
* Don't attempt to enable FPU that's not present.
2024-08-15 11:45:18 -06:00
Peter Johanson
fb67e4603a feat: Add studio core coverage targets.
* Cover stm32, RP2040, and nRF52 builds.
2024-08-15 11:45:18 -06:00
Peter Johanson
bafe648425 feat: Add &studio_unlock behavior.
* New behavior allows unlocking the keyboard to allow ZMK Studio to
  make changes.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-15 11:45:18 -06:00
Peter Johanson
b1bcc3e418 feat(studio): Add studio-rpc-usb-uart snippet.
* Add an easy snippet for enabling USB UART added
   to the `zephyr_udc0` standard node.
2024-08-15 11:45:18 -06:00
Peter Johanson
feda96eb40 feat(studio): Initial RPC infrastructure and subsystems.
* UART and BLE/GATT transports for a protobuf encoded RPC
  request/response protocol.
* Custom framing protocol is used to frame a give message.
* Requests/responses are divided into major "subsystems" which
  handle requests and create response messages.
* Notification support, including mapping local events to RPC
  notifications by a given subsystem.
* Meta responses for "no response" and "unlock needed".
* Initial basic lock state support in a new core section, and allow specifying
  if a given RPC callback requires unlocked state or not.
* Add behavior subsystem with full metadata support and examples of
  using callback to serialize a repeated field without extra stack space needed.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-15 11:45:18 -06:00
Cem Aksoylar
ea64fcaf71 fix(docs): Note direct pin use in matrix transform 2024-08-15 10:38:10 -07:00
dependabot[bot]
6fe13c9565
chore(deps-dev): bump eslint-plugin-mdx from 2.3.3 to 3.1.5 in /docs (#2128)
Bumps [eslint-plugin-mdx](https://github.com/mdx-js/eslint-mdx) from 2.3.3 to 3.1.5.
- [Release notes](https://github.com/mdx-js/eslint-mdx/releases)
- [Changelog](https://github.com/mdx-js/eslint-mdx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mdx-js/eslint-mdx/compare/eslint-plugin-mdx@2.3.3...eslint-plugin-mdx@3.1.5)

---
updated-dependencies:
- dependency-name: eslint-plugin-mdx
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 16:15:39 +02:00
dependabot[bot]
08988ec7da
chore(deps): bump braces from 3.0.2 to 3.0.3 in /docs (#2337)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 16:14:45 +02:00
LostQuasar
b42d06ecf7
chore: Update pancake shield url 2024-08-14 14:38:38 -04:00
down
895f557ae5 fix: no error return in sticky key get_parameter_metadata 2024-08-14 12:34:18 -06:00
Cem Aksoylar
96cd3a1ce2 refactor(docs): Remove unnecessary jsx includes 2024-08-13 23:03:15 -07:00
Cem Aksoylar
4faeb365b1 feat(docs): Add keyboard vs consumer variants note 2024-08-13 23:03:15 -07:00
Cem Aksoylar
ba0dee088f feat(docs): Add section on nesting mod-morphs
Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
2024-08-13 14:56:07 -07:00
Cem Aksoylar
0d15ae84f4 fix(docs): Fix mod-morph terms from keycodes to bindings 2024-08-13 14:56:07 -07:00
Cem Aksoylar
8b909acdcf refactor(docs): Add subheaders for devicetree error types 2024-08-13 11:11:27 -07:00
Cem Aksoylar
3de8a56fcb feat(docs): Add a note on column numbers for DTS errors 2024-08-13 11:11:27 -07:00
Cem Aksoylar
00e4818094 fix(docs): Fix broken anchor in reset behaviors 2024-08-13 10:51:40 -07:00
Nicolas Munnich
049c070b3a
feat(docs): Minor improvements to the docs (#2411) 2024-08-13 10:47:45 -07:00
Peter Johanson
fb3af5327e fix: Fix hardware metadata validation after image changes.
* Newer Docker image requires --break-system-packages for pip.
2024-08-13 07:38:11 -07:00
Pete Johanson
6d50ba5553 chore: Docs review tweaks.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-08-12 16:57:54 -07:00
Peter Johanson
3fec690def feat: Add config settings for sticky keys/hold-tap
* Add new Kconfig symbols to config max held sticky-keys/hold-taps
  and for max captured events during hold-tap resolution.
2024-08-12 16:57:54 -07:00
Cem Aksoylar
2eff266f5b feat(docs): Add battery life remark for split keyboards 2024-08-07 23:57:58 -07:00
Cem Aksoylar
2a0708d1fc feat(docs): Add locality warning for nested behaviors 2024-08-07 23:57:58 -07:00
Cem Aksoylar
2501f1f548 feat(docs): Add references to new split keyboards page 2024-08-07 23:57:58 -07:00
Cem Aksoylar
d75e388593 feat(docs): Add split keyboards feature page
Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
2024-08-07 23:57:58 -07:00
Peter Johanson
cd25c12ce9 fix: Proper device PM support for composite kscan.
* Clean up composite kscan to allow multiple instances properly.
* Implement PM hook and properly suspend/resume the child devices.

Fixes: #2388
2024-08-03 13:45:51 -07:00
Peter Johanson
78ed721c36 fix(pm): Properly configure a wakeup as input.
* Other drivers properly disconnect/de-config pins now, so we need
  to be sure the wakeup trigger connects the wake pin as input.
2024-08-02 16:37:11 -07:00
Cem Aksoylar
47a6715aa6 fix(docs): Fix toggle layer docs 2024-08-02 11:17:10 -07:00
Cem Aksoylar
b9a025c76e
fix(docs): Document number of peripherals Kconfig (#2389)
Fixes #2373
2024-08-02 18:57:15 +02:00
Cem Aksoylar
b080befebb fix(docs): Fix link for matrix transform 2024-08-02 09:55:20 -07:00
Nicolas Munnich
9e7fcde868
feat(docs): Improve the layers-related documentation (#2390)
Fixes #1284
2024-07-31 20:53:36 -07:00
Nicolas Munnich
f92dce43e9
feat(docs): Add modules feature page (#2380)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-07-25 12:08:08 -07:00
Nicolas Munnich
97294aa341
chore: Add a recommended extension for .mdx files (#2381) 2024-07-25 12:00:55 -07:00
Nicolas Munnich
fd152baff0
feat(docs): Add troubleshooting notes on experimental bluetooth options (#2387)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-07-25 12:00:22 -07:00
Cem Aksoylar
7bd74a6b0f fix(docs): Add required display-name in physical layout examples 2024-07-14 16:59:15 -07:00
Peter Johanson
8c6bda260a fix: Proper behavior metadata for key repeat/toggle 2024-07-05 15:38:04 -06:00
Peter Johanson
3694ff85a0 fix: Fix up layer metadata, move to layer IDs.
* Studio will use stable layer IDs to refer to layers, so that
  layer reordering doesn't affect behavior bindings, so update to match.
* Fix a few layer metadata entries that missed being refactored.
2024-07-05 13:13:42 -06:00
Peter Johanson
e01f13f9f0 fix: Fix external power settings load issue.
* Because settings load is delayed now, enable external
  power on init, and let it be disabled on settings load
  later, to ensure power is on early for
  other peripheral initialization.

Fixes: #2361
2024-07-04 17:20:40 -06:00
Peter Johanson
82eed0f5dd feat(boards): Add flash/settings to XIAO RP2040.
* Add storage partition.
* Default necessacy Kconfig symbols for flash/settings.
2024-07-03 16:57:22 -06:00
Peter Johanson
b4f9081b09 docs: Updated new shield documentation for physical layouts.
* Document how to define one or more physical layouts and assign
  the chosen one.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-07-03 16:52:05 -06:00
Peter Johanson
5fcf092901 refactor(shields): Set ZMK Uno physical layouts.
* Add physical layout definitions for uno and split uno shields.
2024-07-03 16:52:05 -06:00
Peter Johanson
74f7fe921b fix(splits): Increase split notify stack size. 2024-07-03 16:52:05 -06:00
Peter Johanson
0438cb0ee5 feat(kscan): More complete PM support to drivers.
* Update our GPIO kscan drivers to more completely support PM device,
  by doing proper hardare init/deinit in the PM action hook.
2024-07-03 16:52:05 -06:00
Peter Johanson
c5cca5b34f feat: Add keyboard physical layout system.
* Add bindings to allow creating multiple physical layouts that specify
  their key's physical attributes, and the matching matrix transform
  and dependant kscan to use.
* Synthesize a basic physical layout if none specified, for backwards
  compatibility.
* Update matrix transform API to explicitly pass in the selected transform
  to the API instead of using a fixed chosen transform.
* Move kscan subscription and handling into the physical layout code, so
  that selecting a different physical layout at runtime can also use the
  correct kscan instance.
* Add `physical_layouts.dtsi` file to include so you can use the
  pre-configured `&key_physical_attrs` for adding you layout keys.
2024-07-03 16:52:05 -06:00
Peter Johanson
80173f8ea3 fix: Improve startup time with proper settings loading.
* Avoid doing duplicate calls to setings_load_subtree, which iterates
  NVS fully each time under the hood, and instead use on settings_load
  later in the lifecycle.
2024-07-03 16:24:17 -06:00
Peter Johanson
f18974e8c4 fix: Adjust hid indicator listeners for event refactor
* Avoid static listener to prevent subscription
  issue.
2024-07-01 12:32:04 -06:00
ReFil
f2ea1da036
fix(boards): Suppress devicetree warning
nRF5x boards throw a spurious warning for duplicate unit-address when the devicetree gets processed

Upstream issue:  https://github.com/zephyrproject-rtos/zephyr/issues/29713

Warning suppressed as per: https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
2024-06-30 12:59:46 -04:00
Peter Johanson
96e55c8be6 fix: BLE refactor mouse keys fix. 2024-06-28 17:48:45 -06:00
Peter Johanson
483a4930e9 feat(behaviors): Add local ID system for behaviors
* Add a new feature for tracking a given behavior by a new concept
  of a "behavior local ID" which is a stable 16-bit identifier for
  a given behavior, that is resilient to new behaviors being added
  and requires no additional work on the part of the behavior
  authors.
* Add implementations for either settings lookup table, or CRC16
  hashing of behavior device names for generating behavior local
  IDs.
2024-06-28 15:10:32 -06:00
Peter Johanson
f7c34c70ba refactor(ble): Extract API to get active profile connection.
* Add `struct bt_conn *zmk_ble_active_profile_conn(void)` function for
  fetching a connection for the current profile.
2024-06-28 14:43:17 -06:00
Peter Johanson
b576d52d58 feat(core): Support adding subs to other listeners.
* Used for ZMK Studio event remappers to be sure the one
  RPC event listener subscribes to their mapped events.
2024-06-28 14:36:25 -06:00
Peter Johanson
49f7275beb fix: Add metadata to missed behaviors. 2024-06-25 12:11:32 -06:00
Timoyoungster
29599e8b0a docs: hopefully more clear description of the new setting 2024-06-24 14:26:14 -06:00
Timoyoungster
10d03ca46c fix: adding option to separate implicit mod release from key release
This adds a new config value `ZMK_HID_SEPARATE_MOD_RELEASE_REPORT`
where, if enabled, the report for a key release is sent separately to
the accompanying modifier release signals, which are then sent in a
second report.

This fixes an issue where certain applications are unable to work with
implicitly modified keys (e.g. colon) due to them registering the
modifier release prior to the actual key release.

Have tested this on my personal keyboard and `wev` now shows the signals
in the correct order.

=> **Previously:** ```LSHIFT (pressed) -> colon (pressed) -> LSHIFT
(released) -> **semi**colon (released)```

=> **Now:** ```LSHIFT (pressed) -> colon (pressed) -> colon (released)
-> LSHIFT (released)```

(This time without accidental files)
2024-06-24 14:26:14 -06:00
honorless
4dce096161 docs: improve settings_reset link 2024-06-24 13:18:56 -07:00
honorless
9c6d1af102 ci(build): limit run scope
* Cancel redundant non-nightly runs and jobs dependent on canceled jobs.

* Limit scheduled runs to zmkfirmware-owned repos.
2024-06-24 13:41:03 -06:00
honorless
7c9477be6e ci(build): improve security posture
* Limit unnecessary permissions.

* Avoid storing credentials.
2024-06-24 13:41:03 -06:00
honorless
0bea7832e9 ci(build): amend changed-files invocation 2024-06-24 13:41:03 -06:00
Peter Johanson
3e2c428fca chore: Add rp2040/USB logging core coverage.
* Include an rp2040 core build target, and include USB logging snippet
  for completeness.
2024-06-24 11:11:51 -06:00
Peter Johanson
03099b04b6 feat(behaviors): Add behavior metadata information.
* For upcoming ZMK studio work, make a set of rich metadata available
  to provide a friendly name for a behavior, and allow super flexible
  descriptions of the parameters the behaviors take.
* Add ability to validate a zmk_behavior_binding against
  the behavior metadata available.
2024-06-24 11:08:00 -06:00
Peter Johanson
7cdf1e42ea fix: Actually add the zmk-usb-logging snippet.
* D'oh.
2024-06-24 10:54:07 -06:00
Peter Johanson
7be955ff72 fix(usb): Ensure USB init is last
* To avoid USB init issues due to other initialization disrupting
  USB setup, move USB setup to a lower priority.
2024-06-21 13:29:12 -06:00
Peter Johanson
a080b5287f refactor: Remove static CDC ACM logging nodes.
* To avoid spurious CDC ACM instances when usint CDC ACM for something
  other than logging, move to the approach used by Zephyr of using a
  snippet to redirect console output to a CDC ACM node added by the
  snippet. Remove all the existing static CDC ACM nodes.
* Add new `zmk-usb-logging` snippet that mirrors the upstream
  `cdc-acm-logging` snippet, but still does our extra USB logging
  configuration.
* Updated logging docs accordingly.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-06-20 12:06:13 -06:00
Cem Aksoylar
7c09eb217e refactor(docs): Document and enforce header casing conventions 2024-06-17 11:46:32 -07:00
Cem Aksoylar
e56db304ea refactor(docs): Split up troubleshooting page into a section 2024-06-17 11:46:32 -07:00
Nicolas Munnich
308d6bce6e
feat(docs): Improve the toolchain setup page (#2272)
Split the toolchain setup into separate docker and native pages
and improve instructions to better refer to Zephyr docs in certain steps.
Also refactor to improve consistency and add virtualenv instructions.

---------

Co-authored-by: KemoNine <mcrosson@kemonine.info>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-06-01 21:51:08 -07:00
Nicolas Munnich
2d96f469c8
fix(docs): Removing to-to typos (#2310) 2024-05-25 22:16:33 -07:00
German Gutierrez
2ee76be6fe
fix(soft_off): central waits 100ms in split if hold_time enabled 2024-05-13 17:43:35 -04:00
Joel Spadin
f0b20c1c93 feat(boards): Add nRF52 high voltage DC/DC config
Added a Kconfig option to enable SOC_DCDC_NRF52X_HV for nice_nano_v2
and mikoto. According to Nordic's documentation, the DC/DC regulator is
more efficient than the LDO regulator, so this is enabled by default.

The following boards do not support this mode and were not changed:

- nice_nano
- nice60
- nrfmicro_11, nrfmicro_13
- nrf52840_m2
- bluemicro840

I could not find schematics to confirm whether the following boards
support this mode:

- bt60_v1, bt60_v2
- bt65_v1
- bt75_v1
- corneish_zen_v1, corneish_zen_v2
- pillbug
- puchi_ble_v1
- s40nc
2024-05-13 14:14:50 -07:00
dependabot[bot]
8f5c7bbfd4 chore(deps): bump pre-commit/action from 3.0.0 to 3.0.1
Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: pre-commit/action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 14:07:13 -07:00
Horu
7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -04:00
ReFil
4dfc45d4ab
feat(docs): Document example toggle-mode implementation
---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-05-03 14:17:09 -04:00
ReFil
2423136788 fix(boards): Fix pulls on ZMK uno toggle switch
The devicetree pulls always add on to the extra pulls configured by toggle mode, so these should not have pulls defined in the devicetree. Saved ~200uA avg on another board with a 3t toggle switch
2024-05-03 06:55:43 -07:00
Peter Johanson
af908826cd fix: Initialize sideband kscan in APPLICATION.
* In order to be sure the rest of the system is fully ready before
  intializing, because init may result in immediate events being
  triggered when used with toggle direct kscan inner devices.
2024-05-01 11:35:54 -07:00
German Gutierrez
d1ad34761a
fix: shortening keymap_soft_off behavior node
* Shorten the soft off node in order for it to work across splits.
2024-04-29 12:22:40 -04:00
Jarryd Tilbrook
0d3a4b7bbb
fix(underglow): Correctly set underglow state
This fixes a bug introduced in #2244
2024-04-25 07:26:26 -07:00
Pablo Martínez
4d566853af
fix(rgb): auto-off logic 2024-04-25 04:55:42 -04:00
Sadek Baroudi
f4a070aacf fix(boards): nrf boards missing SPI in pinctrl and dtsi, requiring users to manually define in their shield definitions if they wanted to use SPI 2024-04-25 00:54:44 -07:00
Peter Johanson
16e92cf665 fix(behaviors): Add multiple soft-off instances properly.
* Properly pass the node id for the unique
  soft-off behavior instance when defining it.
2024-04-17 23:53:12 -07:00
Keeley Hoek
e22bc7620c fix(hid): Correct off-by-one buffer overflow with NKRO 2024-04-09 23:20:20 -07:00
Cem Aksoylar
a9021deef6 fix(docs): Add wakeup-source to split new shield example 2024-04-09 16:27:27 -07:00
Cem Aksoylar
dfc6dc84b8 fix(docs): Make clear the matrix transform example is incomplete 2024-04-09 16:27:27 -07:00
Cem Aksoylar
7a51a46b9f feat(docs): Add pointer to shields folder in new shield docs 2024-04-09 16:27:27 -07:00
Xudong Zheng
849eca7228 refactor(underglow): fix uninitialized variable warning 2024-04-09 15:57:34 -07:00
フィルターペーパー
7d5aa0c0bf feat(docs): Update section for devicetree_generated error 2024-04-04 18:31:09 -07:00
Tobias Arndt
fe509c466f fix(kscan): Enable charlieplex interrupts for single compatible device
Fixes #2201
2024-03-30 19:13:39 -07:00
Tobias Arndt
e7d6519534 fix(docs): Fix and note GPIO flags for charlieplex config 2024-03-30 19:13:39 -07:00
Cem Aksoylar
eb5a6fcfe1 refactor(docs): Split DT props table for sensor rotate variants 2024-03-30 17:03:51 -07:00
Cem Aksoylar
e65a1227d8 fix(docs): Correct property types for behavior bindings 2024-03-30 17:03:51 -07:00
zhiayang
4bef4e98f5
feat(boards): Support board revisions in setup scripts.
* Make setup.sh/ps1 prompt for board revision for boards that have revisions
2024-03-30 19:12:37 -04:00
Peter Johanson
fff1cbecdc fix: Add wakeup-source; to kscan nodes for ZMK_SLEEP.
* ZMK_SLEEP also enables PM_DEVICE, so be sure to mark kscan
  nodes as wakeup sources so they can wake keyboards from sleep.
2024-03-29 12:31:43 -07:00
dependabot[bot]
d672b0c705 chore(deps): bump react-toastify from 7.0.4 to 10.0.5 in /docs
Bumps [react-toastify](https://github.com/fkhadra/react-toastify) from 7.0.4 to 10.0.5.
- [Release notes](https://github.com/fkhadra/react-toastify/releases)
- [Commits](https://github.com/fkhadra/react-toastify/compare/v7.0.4...v10.0.5)

---
updated-dependencies:
- dependency-name: react-toastify
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 10:41:56 -07:00
dependabot[bot]
18b86b7720 chore(deps): bump follow-redirects from 1.15.5 to 1.15.6 in /docs
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 10:31:21 -07:00
dependabot[bot]
25bb126a11 chore(deps): bump express from 4.18.2 to 4.19.2 in /docs
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 10:22:10 -07:00
dependabot[bot]
34910787ff chore(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /docs
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 10:15:51 -07:00
Peter Johanson
f9bb18b676 fix(docs): Add &soft_off to behaviors index. 2024-03-27 22:52:32 -07:00
Peter Johanson
e66f068fb5 fix(docs): Minor soft-off docs tweaks from review. 2024-03-27 20:59:26 -07:00
Peter Johanson
29c0cdb3ab fix(shields): Fix for direct use with ZMK Uno split. 2024-03-27 20:59:26 -07:00
Peter Johanson
7e7110d85f fix(pm): Fixes for dedicated on/off on peripherals.
* Add new flag to differentiate soft off on peripherals that
  is invoked by split GATT svc and dedicated additional ones
  tied to GPIO pin.
2024-03-27 20:59:26 -07:00
Peter Johanson
41d81801ed fix(pm): Use Zephyr created device slots.
* Avoid overwriting random memory by using
  iterable section created by Zephyr PM.
2024-03-27 20:59:26 -07:00
Peter Johanson
d0e0ecb4e3 refactor: Use kscan directly to wake when we can.
* When adding a dedicated GPIO pin for soft off/on, use the direct
  kscan as the waker, instead of adding an additional node.
2024-03-27 20:59:26 -07:00
Peter Johanson
2df6dcd973 feat(behaviors): More logging in soft off. 2024-03-27 20:59:26 -07:00
Pete Johanson
fa9ea9ea8b fix(docs): Fix soft off waker prop name, headers.
* Use the correct property for extra GPIOs to
  make active for the waker before going into soft
  off state.
* Change header depth for easier navigation of the
  soft off feature page.

Co-authored-by: Pablo Martínez <58857054+elpekenin@users.noreply.github.com>
2024-03-27 20:59:26 -07:00
Peter Johanson
bb94a7aafe fix: Fixes for building soft off without deep sleep. 2024-03-27 20:59:26 -07:00
Peter Johanson
cac999b1d6 feat: Updated soft-off docs.
* Document new sideband behavior kscan driver for integrated
  soft-off support.
2024-03-27 20:59:26 -07:00
Peter Johanson
8d54e287f0 fix: Adjustments for Zephyr 3.5. 2024-03-27 20:59:26 -07:00
Peter Johanson
bd21f41412 refactor: Fixes for review feedback. 2024-03-27 20:59:26 -07:00
Peter Johanson
5d960a758f fix: Cleanups of sideband and direct kscan from review.
* Add dedicated init priority for the sideband kscan.
* Refactor sideband code for clarity.
* Tweaks to direct kscan for clarity.
* Make sideband behavior row optional for brevity.
* Allow overriding ZMK Uno sideband behaviors.
2024-03-27 20:59:26 -07:00
Peter Johanson
4198fac90f fix(pm): Fix deep sleep with sideband behaviors.
* Properly implement the PM hook needed for sideband behavior
  kscan device to have wakeup source enabled on it.
2024-03-27 20:59:26 -07:00
Peter Johanson
09111f1cf3 fix: Sleep after clearing endpoints to wait for send.
* Add a small sleep to allow other threads to send data for the
  endpoint clearing before sleep.
2024-03-27 20:59:26 -07:00
Peter Johanson
c3144055e8 refactor(boards): Move ZMK Uno 1P3T slider to sideband
* Invoke output selection from the slider on the ZMK Uno via
  sideband behavior setup, to simplify keymap.
2024-03-27 20:59:26 -07:00
Peter Johanson
a0ad1d4c94 refactor: Add kscan sideband behavior driver
* Instead of gpio key behavior trigger, add new kscan driver that
  decorates/wraps a given kscan driver and will invoke basic system
  behavior assigned to a given row + column, without the need for keymap
  mapping in the matrix transform, bypassing keymaps entirely.
2024-03-27 20:59:26 -07:00
Peter Johanson
e78b25a445 feat(kscan): Direct kscan driver can use gpio-keys.
* Allow specifying direct kscan driver pins using gpio-key list
  as an alternative.
2024-03-27 20:59:26 -07:00
Pete Johanson
933fdcd364 refactor(pm): Remove scanned behavior trigger.
* Remove the painful scanned behavior trigger for now, future enhancement
  will restore this high level functionality using kscan directly.
2024-03-27 20:59:26 -07:00
Pete Johanson
5ebe924e94 chore: Various soft-off review fixes
* Code style to avoid goto.
* Enable pm.c compilation via dedicated Kconfig flag.
* Comment wakeup trigger PM behavior.
2024-03-27 20:59:26 -07:00
Peter Johanson
fceb0351a5 refactor: Fixes for soft-off based on review.
* Better naming for gpio-key behavior triggers.
* Tweaks to scanned behavior trigger to avoid bad semaphore use,
  and reduce chance of issues with slowly scanned matrixes.
* Various code cleanups of style issues.
2024-03-27 20:59:26 -07:00
Pete Johanson
96968514e3 fix(docs): Apply suggestions from code review
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-27 20:59:26 -07:00
Peter Johanson
e78249ee06 fix(bt): Fix BT tests after soft off work.
* Move to explicit enable of `ZMK_PM_SOFT_OFF` to turn
  on the feature and use the behaviors, which matches
  how other features work, and helps with split and
  testing schemes.
2024-03-27 20:59:26 -07:00
Peter Johanson
0d4d4fb2b5 feat(pm): Clear HID data before soft off.
* Make sure the connected host has no held HID usages before we sleep.
2024-03-27 20:59:26 -07:00
Peter Johanson
860e53b33a refactor: Promote new endpoints API
* Add ability for external callers to clear the current endpoint.
2024-03-27 20:59:26 -07:00
Peter Johanson
d3fffb9e89 feat(shields): Add soft-off to the nrf52840dk ZMK Uno
* Use Button 1 for soft off on the nrf52840 when using the ZMK Uno
  shield.
2024-03-27 20:59:26 -07:00
Peter Johanson
b19df0cbf0 feat(behaviors): Add soft off behavior.
* New soft-off behavior that can be used to force the device
  into  soft-off state with only certain configured wakeup
  devices.
2024-03-27 20:59:26 -07:00
Peter Johanson
738c3c0e3b feat(kscan): Add PM support to GPIO kscan drivers.
* Add PM device hook to the kscan direct & matrix drivers.
2024-03-27 20:59:26 -07:00
Peter Johanson
adb3a13dc5 feat: Add soft on/off support.
Initial work on a soft on/off support for ZMK. Triggering soft off
puts the device into deep sleep with only a specific GPIO pin
configured to wake the device, avoiding waking from other key
presses in the matrix like the normal deep sleep.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-27 20:59:26 -07:00
Thomas Huber
58ccc5970d fix(build): Modify function return type
Change return type of `sticky_key_timeout` function to `void` given it
does not return any value to remove compiler warnings.
2024-03-27 14:52:42 -07:00
Thomas Huber
e806cd6da1 feat(gitignore): add clangd cache folder 2024-03-27 14:41:26 -07:00
Peter Johanson
94c3b9a246 feat(build): Allow specifying snippets for a build.
* Allow using snippets https://docs.zephyrproject.org/latest/build/snippets/using.html
  for user builds in a `snippets` array properly.
2024-03-24 18:44:54 -07:00
Cem Aksoylar
c684cee76f refactor(docs): Refer to overview page for behaviors 2024-03-24 18:29:29 -07:00
Thomas Huber
f2d8b9b0a3 feat(docs): Add Behavior overview page
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-24 17:50:33 -07:00
Peter Johanson
44358798d3 feat: Add ability to fetch battery voltage.
* To be able to use the Zephyr `voltage-divider` driver,
  add a mode for fetching raw voltage from the sensor
 and do state of charge calculation outside of the driver.
2024-03-24 13:28:55 -07:00
Cem Aksoylar
931a36ff4a feat(docs): Add a note on using BT with dual boot systems 2024-03-20 11:49:23 -07:00
Peter Johanson
3a3eed2960 fix: Add settings reset on start init priority.
* Add a dedicated settings reset on start init priority and default
  it to lower priority (high number) than default FLASH_INIT_PRIORITY
  to be sure flash is initialized before we open the area.
2024-03-20 11:18:43 -07:00
フィルターペーパー
1f7cd7a107 feat(docs): Add troubleshooting section for empty_file error 2024-03-19 23:48:57 -07:00
Theo Lemay
828943156a
fix(docs): Fix hold-tap info callout (#2211)
The hold-while-undecided callout does not properly render in the docs. This fixes it.
2024-03-18 15:34:45 -07:00
フィルターペーパー
736c5fb46e feat(docs): Add a note on macOS v14.3 file copy error message 2024-03-18 10:38:09 -07:00
Theo Lemay
ce743f2b35 chore: fix whitespace 2024-03-18 10:30:14 -07:00
Theo Lemay
af7e4198ae chore: remove label in test 2024-03-18 10:30:14 -07:00
Theo Lemay
94d9d837e3 refactor: extract duplicate logic 2024-03-18 10:30:14 -07:00
Theo Lemay
341534aa15 feat(behaviors): lazy sticky keys 2024-03-18 10:30:14 -07:00
Pablo
8929355ac0
fix(keymap): Replace some keypad keycodes
* Change KP_MULTIPLY to ASTRK in defaults keymap
2024-03-18 13:19:27 -04:00
honorless
6f2e19ff88 refactor: replace quick_tap_ms with quick-tap-ms
* The underscore form of this property is deprecated.
2024-03-18 10:15:50 -07:00
honorless
3a38979684 refactor: replace tapping_term_ms with tapping-term-ms
* The underscore form of this property is deprecated.
2024-03-18 10:15:50 -07:00
Hans Kruse
c6e0551fb0
fix(hid): Fix typo in HID usage alias 2024-03-18 13:06:09 -04:00
Cem Aksoylar
325e207781 feat(docs): Add pointers to HID descriptor refresh 2024-03-18 09:58:16 -07:00
Cem Aksoylar
aa6cfe250d feat(docs): Document refreshing the HID descriptor 2024-03-18 09:58:16 -07:00
Cem Aksoylar
bddee70b6b refactor(docs): Remove outdated Windows battery advice and unnecessary header 2024-03-18 09:58:16 -07:00
ReFil
388ad71385
feat(build): Explicit missing keymap node error
* Explicit error if zmk,keymap not set
* Document keymap error

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-18 12:54:47 -04:00
Joel Spadin
a77288f527 fix: Update settings reset for Zephyr 3.5 2024-03-18 09:48:19 -07:00
Joel Spadin
14b06a36bf docs: Update settings_reset documentation
Updated the section for troubleshooting split halves unable to pair now
that the settings_reset shield resets all settings and explicitly
disables CONFIG_ZMK_BLE:

- Added a note that all settings will be reset.
- Removed the section about immediately putting the halves into
  bootloader mode to prevent pairing, as this is not necessary anymore.
- Added a note that you will not be able to see or pair the Bluetooth
  keyboard until you have flashed regular firmware again.
- Added a sentence to clarify that you will need to re-pair the
  keyboard to all host devices.

Also added some text describing common scenarios where this procedure
might be needed.
2024-03-18 09:48:19 -07:00
Joel Spadin
1dfcfc7d3f feat(shields): Make settings_reset shield reset all settings
Added a new CONFIG_ZMK_SETTINGS_RESET_ON_START option which enables init
code to call zmk_settings_erase(), and changed the settings_reset shield
to use it instead of CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START, so it now
resets all settings instead of just clearing BLE bonds.

CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START is left in place for now in case
someone still needs it. It may be replaced in the future once we find a
better way to repair a broken split connection.
2024-03-18 09:48:19 -07:00
Joel Spadin
610a806c84 feat: Add function to erase all settings
Added a zmk_settings_erase() function to clear all saved settings. This
does not go through Zephyr's settings subsystem, but instead directly
clears the data from the setting storage backend, so a reboot is needed
for it to take effect.
2024-03-18 09:48:19 -07:00
Peter Johanson
2adaa00d10 fix(build): Properly board revision keymaps.
* Handle board keymap location for boards with Zephyr
  board revisions included.
* Includes bare non-revision file and a revision specific keymap
  in case newer revision changes the layout/key positions.
2024-03-08 10:58:10 -08:00
Thomas Huber
08ab45fc78 feat(CONTRIBUTING.md): Add info regarding ESLint 2024-03-04 20:08:52 -08:00
Thomas Huber
37af94edde feat(docs): Add warning to new shield docs how Kconfig treats whitspaces
Added a warning to the shield section explaining that Kconfig does
not ignore whitespaces on function calls and therefore adding whitespaces
after the comma will break functionality.
2024-03-04 20:08:52 -08:00
Andrew Kannan
db7b197790
fix(docs): Add underglow brightness min/max (#2180) 2024-02-28 10:39:04 -08:00
Theo Lemay
c9c620d19f fix: inline initialise 2024-02-20 00:25:53 -08:00
Theo Lemay
8b20874c99 chore: remove label in test 2024-02-20 00:25:53 -08:00
Theo Lemay
c007d60357 feat(behaviors): hold while undecided 2024-02-20 00:25:53 -08:00
Xudong Zheng
104c73d303 refactor: address transport switch enumeration warning
When building without USB or Bluetooth, the compiler emits a warning due to
ZMK_TRANSPORT_USB or ZMK_TRANSPORT_BLE not being handled.
2024-02-19 21:41:52 -08:00
Seth Milliken
b44ec381f6 feat(boards): add encoder support to planck 2024-02-19 17:01:10 -08:00
honorless
ccf0380179 refactor: remove redundant Kconfig defaults
bool symbols implicitly default to n.
2024-02-19 16:39:31 -08:00
ton-im
c082f8d802
fix(boards): Add ext power init delay for nrfMicro
* Address issues with OLED init occurring before display is powered.
2024-02-19 19:32:12 -05:00
zhiayang
a9ae6796a0
fix(display): Proper initial display of battery status
* fix initial display of battery status on displays, and also fix a null deref
2024-02-19 19:15:19 -05:00
Peter Johanson
fda6a5f185 fix(boards): Tweaks for Ferris rev0.2 for Zephyr.
* Enable missing clock and set up USB pinctrl.
2024-02-17 21:57:21 -08:00
Dennis
604af2ebd3
feat(docs): Add pointers for peripheral battery monitoring (#2177)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>

Fixes #2166
2024-02-17 21:51:09 -08:00
ctranstrum
0f49fa9ae4
fix(behavior): Proper init priority for ext_power. 2024-02-14 20:29:19 -05:00
Peter Johanson
c7fb418e88 fix(build): Used a fixed temp dir for caching.
* Improve GHA caching by using a fixed temporary directory
  when using one.
2024-02-14 14:08:22 -08:00
honorless
40adb3858d refactor(boards): remove superfluous conf settings 2024-02-10 16:15:09 -08:00
honorless
cdcf4ebfb6 feat(boards): allow use of blackpill_f401cc 2024-02-10 16:15:09 -08:00
Pete Johanson
f72f415c5b fix(docs): More Zephyr docs link updates.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-02-09 14:32:46 -08:00
Peter Johanson
50a303b8bb fix(pm): Restore sleep suspension of devices.
* After the move to `sys_poweroff`, restore the behavior of
  suspending devices before entering sleep state.
2024-02-09 14:32:46 -08:00
Peter Johanson
1d83f279cd fix(pm): Tweaks for deep sleep/PM.
* Restore enabling of PM_DEVICE, make ZMK_SLEEP work with
  the ZMK Uno shield on nrf52840dk_nrf52840 board.
2024-02-09 14:32:46 -08:00
Peter Johanson
edc72c1166 chore(docs): Update Zephyr links to 3.5.0 versions. 2024-02-09 14:32:46 -08:00
Peter Johanson
4bcecd98f8 fix(display): Tweaks to memory Kconfig settings.
* Don't default heap mempool by default now that there's a dedicated
  LVGL mempool
* Set proper defaults for CiZ display hardware/custom screen.
* Double the dedicated display thread stack size for CiZ.
2024-02-09 14:32:46 -08:00
Peter Johanson
2d6c9f797c refactor(display): Move to proper SPI ready API. 2024-02-09 14:32:46 -08:00
Peter Johanson
18e5a1a26b feat: Add Zephyr 3.5 blog post. 2024-02-09 14:32:46 -08:00
Peter Johanson
cd6f8a680c fix(ble): Update security test for changes in 3.5. 2024-02-09 14:32:46 -08:00
Peter Johanson
b2a0a357e1 fix(display): Set a default mem size for built-in
* Set a reasonable default LVGL mem pool size for our built-in
  status screen.
2024-02-09 14:32:46 -08:00
Peter Johanson
d9c0ded402 fix(shields): Fix use of deprecated Zephyr header. 2024-02-09 14:32:46 -08:00
Peter Johanson
aeb5bed3d6 fix(kscan): Adjust charlieplex init level/priority. 2024-02-09 14:32:46 -08:00
Peter Johanson
a6c0399493 fix(bluetooth): Remove LLCP impl override. 2024-02-09 14:32:46 -08:00
Peter Johanson
324ada1d20 fix(boards): Remove unused pin settings.
* Remove unused pin settings that used deprecated
  devicetree properties.
2024-02-09 14:32:46 -08:00
Peter Johanson
8e9b4fa57c fix(boards): Make &bootloader work on nrf52 for now.
* Use `NRF_STORE_REBOOT_TYPE_GPREGRET` to get bootloader behavior
  to work for now until retained bootmode is implemented.
2024-02-09 14:32:46 -08:00
Peter Johanson
3968d9febd feat(boards): Make west flash work with new UF2 runner. 2024-02-09 14:32:46 -08:00
Peter Johanson
b3f1d769f0 fix(bt): Fixes for BLE test BSIM bits. 2024-02-09 14:32:46 -08:00
Peter Johanson
4fcbe3268a fix(bt): Updated snapshots for BLE tests.
* Core Zephyr changes tweaked the output from the
  BT stack for our unit tests.
2024-02-09 14:32:46 -08:00
Peter Johanson
413820fc7f fix(shields): LVGL fixes for nice!view screen
* Bump the LVGL mem pool size needed for custom screen.
* Fixes for LVGL drawing/label usage.
2024-02-09 14:32:46 -08:00
Peter Johanson
802881b625 fix(boards): Remove references to PINMUX Kconfig. 2024-02-09 14:32:46 -08:00
Peter Johanson
f4e6d70465 fix: Proper use of CONTAINER_OF with delayable work. 2024-02-09 14:32:46 -08:00
Peter Johanson
94aa7d8d53 chore(ci): Bump to 3.5 Docker images. 2024-02-09 14:32:46 -08:00
Peter Johanson
552347b8a4 fix(kscan): Adjust composite kscan priority
* Composite kscan needs a dedicated priority to be sure it is
  initialized after the other kscan instances.
2024-02-09 14:32:46 -08:00
Peter Johanson
a81a2d37a8 refactor: Remove explicit blocklist item.
* `sof` is now not enabled by default as a west dep, so need to
  add it to the blocklist ourselves.
2024-02-09 14:32:46 -08:00
Peter Johanson
98e3b8b435 refactor: Move to new sys_poweroff API.
* Move to new `sys_poweroff` API for our deep sleep functionality.
2024-02-09 14:32:46 -08:00
Peter Johanson
b6d9f3c911 fix(ble): Ensure large enough string for setting name.
* Fix warning related to potentially large number of profiles
  causing overflow of allocated string for the setting name.
2024-02-09 14:32:46 -08:00
Peter Johanson
58413ca8c5 refactor(kscan): Clean up warning about shadowed local. 2024-02-09 14:32:46 -08:00
Peter Johanson
d6de8a3acc refactor: Move to POST_KERNEL phase for behavior inits. 2024-02-09 14:32:46 -08:00
Peter Johanson
ba1a6c08ad refactor: Return int from main function. 2024-02-09 14:32:46 -08:00
Peter Johanson
d06e90e713 fix: Fix syscalls generation setup. 2024-02-09 14:32:46 -08:00
Peter Johanson
bd9c71ab0a fix(sensors): Avoid duplicate Kconfig/DTS name.
* Upstream added an equivalent fuel gauge driver, so namespace
  our Kconfig symbol and DTS compatible for the MAX17048 driver.
2024-02-09 14:32:46 -08:00
Peter Johanson
0b5afbf9c0 refacter(bluetooth): Proper HCI header include. 2024-02-09 14:32:46 -08:00
Peter Johanson
fb99496a73 chore: Switch to 3.5 Zephyr version. 2024-02-09 14:32:46 -08:00
Peter Johanson
f7e7c9c10b fix: Add missing include for k_work types. 2024-02-09 14:32:46 -08:00
Peter Johanson
bf4008da02 refactor: All SYS_INIT functions are void args. 2024-02-09 14:32:46 -08:00
Peter Johanson
f4fce9e158 refactor(display): Move new LVGL DPI Kconfig setting. 2024-02-09 14:32:46 -08:00
Cem Aksoylar
b8846cf635 refactor(display): Remove unused BAS includes 2024-02-06 01:09:07 -08:00
Cem Aksoylar
efbcd3c8f6 fix(boards): Disable ZMK_USB for peripherals 2024-02-06 01:09:07 -08:00
Cem Aksoylar
4b03fcb709 fix(boards): Add missing battery header include 2024-02-06 01:09:07 -08:00
Joel Spadin
5826b80374 chore: Fix formatting
Fixed the formatting in a file that wasn't passing pre-commit checks.
2024-02-03 21:56:20 -08:00
Joel Spadin
3a4cf185a1 feat(keymap-upgrader): Upgrade encoder resolution
Added an upgrade function to the keymap upgrader to replace the encoder
"resolution" property with "steps" and (if it is not already present)
"triggers-per-rotation".
2024-02-03 18:45:21 -06:00
Joel Spadin
be75da096c fix(keymap-upgrader): Fix highlight on last line
Fixed an issue where a text edit at the very end of a file would cause
it to highlight from the start of the edit to the start of the file
instead of to the end of the file.
2024-02-03 18:45:21 -06:00
Joel Spadin
c2299e2203 fix(shields): Fix deprecated encoder properties
Switched remaining shields over from resolution to steps.
2024-02-03 18:45:21 -06:00
Joel Spadin
f24a0bf9c8 fix(shields): Add labels to all sensors nodes 2024-02-03 18:45:21 -06:00
Johan Friis
aab09d504c
feat(docs): Document Karabiner interference with Mod-Morphs (#2146) 2024-01-30 00:07:48 -08:00
Xudong Zheng
4a5806ac73 feat(core): enable FPU if CPU has FPU 2024-01-29 17:54:34 -08:00
Cem Aksoylar
0755b7a64c fix(ci): Update upload-artifact with merge step 2024-01-29 16:44:39 -08:00
Dhruvin Shah
5685074835 docs: correcting file path in config.md 2024-01-27 11:40:12 -06:00
senseored
b120daa16a
fix(boards): Assign preonic_rev3 chosen console
Quick fix to make USB-logging work on the Preonic.
2024-01-27 07:18:45 -08:00
Pete Johanson
275c0ce271 Revert "fix(ci): Update one lingering upload-artifacts action." 2024-01-26 00:46:00 -08:00
Peter Johanson
3c14c7c112 fix(ci): Update one lingering upload-artifacts action. 2024-01-26 00:40:05 -08:00
Peter Johanson
789c11629e fix(ci): Bump setup-python version. 2024-01-26 00:26:46 -08:00
Peter Johanson
72d5c01e46 fix(ci): Move to maintained get-changed files. 2024-01-26 00:26:46 -08:00
Peter Johanson
1f8b45d57d fix(ci): Updated actions to move away Node 16. 2024-01-26 00:26:46 -08:00
Joel Spadin
1dbd6910cb chore(docs): Update tree-sitter-devicetree to 0.9.0 2024-01-25 18:03:37 -06:00
Joel Spadin
08d9391a8a feat(keymap-upgrader): Upgrade renamed nodes
Added an upgrade function to fix renamed behavior nodes in the unlikely
event that someone was changing behavior settings this way instead of
using references.
2024-01-25 18:03:37 -06:00
Joel Spadin
bf5284b3b9 fix(keymap-upgrader): Note that changed lines are highlighted 2024-01-25 18:03:37 -06:00
Joel Spadin
d4be70587d fix(keymap-upgrader): Filter key codes to bindings
Changed the key code upgrader to only replace codes that appear in
"bindings" properties. Modifier flags such as MOD_LCTL are no longer
valid as key codes, but they are still used in "mods" properties and
should not be replaced there.
2024-01-25 18:03:37 -06:00
Joel Spadin
37fcf190e6 feat(keymap-upgrader): Highlight changes
Updated the keymap upgrader to highlight which lines it changed as well
as indicate when nothing needed to be upgraded.

Also adjusted the line highlight colors to be more readable in both
light and dark color schemes.
2024-01-25 18:03:37 -06:00
Joel Spadin
84e056793b fix(docs): Fix links to keymap upgrader 2024-01-25 18:03:37 -06:00
Joel Spadin
a0465391be refactor: Improve keymap upgrader
Moved the keymap upgrader to a top-level page like the power profiler
to make it more discoverable. It upgrades more things than key codes
now, so putting it in the codes category doesn't make much sense.

Converted the upgrader code to TypeScript and split it up into smaller
files to make it easier to add new upgrade functions.

Added upgrade functions to remove/replace "label" properties and rename
matrix-transform.h to matrix_transform.h.
2024-01-25 18:03:37 -06:00
Peter Johanson
1a3529a3e6 fix(ci): Use proper variable expression. 2024-01-25 13:20:25 -08:00
honorless
6b547019c2 refactor: use zmk,matrix-transform instead of zmk,matrix_transform
* Align codebase with documentation.
2024-01-23 23:02:35 -06:00
honorless
a3fbc2a5ba docs: suggest zmk,matrix-transform over zmk,matrix_transform
* While functionally equivalent, the hyphenated form of this property
  is more consistent with other ZMK properties and adheres to DTS style
  guidelines.

* Additionally, update links to use Zephyr 3.2 documentation instead
  of 2.5 where appropriate.
2024-01-23 23:02:35 -06:00
Cem Aksoylar
19613128b9 fix(docs): Fix extra line issue in hardware headers
Need to make prettier ignore these, because otherwise it splits
them to separate lines and reverts the whole change
2024-01-20 22:28:41 -08:00
Cem Aksoylar
0dc04df09c fix(docs): Fix eslint-plugin-react errors
Remove unused components, and disable proptype checking for children
in OsTabs custom component since I can't figure out a way to assign
propTypes to it in an mdx file.
2024-01-20 22:28:41 -08:00
Cem Aksoylar
7196f9f075 ci(docs): Disable eslint rule for unescaped entities
eslint-plugin-react is emitting a lot of react/no-unescaped-entities
errors in mdx files, primarily due to apostrophes. It seems not ideal
to have to escape every apostrophe in all mdx text, so this commit
disables the check.

There might be a better way to handle this issue, but I am not aware
of one right now.
2024-01-20 22:28:41 -08:00
Cem Aksoylar
fa91648cce ci(docs): Use eslint plugin for automatic JSX runtime
Ref: https://docusaurus.io/docs/migration/v3#automatic-jsx-runtime
and https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md#when-not-to-use-it
2024-01-20 22:28:41 -08:00
Cem Aksoylar
e3f458e539 ci(docs): Fix tsc config for docusaurus 3 2024-01-20 22:28:41 -08:00
Cem Aksoylar
57684f8a66 fix(docs): Fix broken anchors in docs (but not blog) 2024-01-20 22:28:41 -08:00
Cem Aksoylar
5cbffd6625 fix(docs): Work around docusaurus bug causing broken links
Some links ended up broken after docusaurus 3 upgrade,
especially if they are the second on the same line and have anchors.
Likely due to https://github.com/facebook/docusaurus/issues/9518
2024-01-20 22:28:41 -08:00
Cem Aksoylar
1b326ff856 fix(docs): Fix relative links with trailing slashes 2024-01-20 22:28:41 -08:00
Cem Aksoylar
dcfe07d9f6 refactor(docs): Use new admonition title syntax and disable mdx v1 compat 2024-01-20 22:28:41 -08:00
Cem Aksoylar
ee855de349 fix(docs): Fix incorrect admonition title 2024-01-20 22:28:41 -08:00
Cem Aksoylar
f014eb45a7 refactor(docs): Use .mdx for docs with mdx features
Also applies prettier changes in touched files due to precommit
2024-01-20 22:28:41 -08:00
Cem Aksoylar
00962a7255 refactor(docs): Remove no longer necessary React imports 2024-01-20 22:28:41 -08:00
Cem Aksoylar
a0a952413a fix(docs): Fix deprecated admonition types 2024-01-20 22:28:41 -08:00
Cem Aksoylar
13c856d1d3 fix(docs): Fix mdx 3 incompatibility 2024-01-20 22:28:41 -08:00
Cem Aksoylar
0827ff245f chore(docs): Update docusaurus to 3
Following https://docusaurus.io/docs/migration/v3#upgrading-dependencies
and `npm update`
2024-01-20 22:28:41 -08:00
Peter Johanson
f71458aca0 fix(shields): Fix battery warnings for custom widgets. 2024-01-16 16:39:28 -08:00
crides
8c14b155e8 docs: confirm some consumer codes on iOS
Tested on iOS 16.6
2024-01-15 18:07:48 -08:00
Peter Johanson
0890aaeaff chore: Run tests if any includes change. 2024-01-14 16:19:30 -08:00
Peter Johanson
e5050e40fe feat(tests): Enable asserts for tests. 2024-01-14 16:19:30 -08:00
Peter Johanson
e89cffc959 fix(events): Remove our usage of assert.
* __ASSERT is converted to a do/while loop when asserts are enabled,
  which doesn't work with our usage, so revert that addition.
2024-01-14 16:19:30 -08:00
Peter Johanson
331915f989 fix: Fix missed event manager usages from refactor. 2024-01-14 11:31:05 -08:00
Peter Johanson
644feeb40d fix(core): Address review comments from Joel.
* Fix up some lingering events API tweaks for heap-less event manager.
2024-01-14 11:13:57 -08:00
Peter Johanson
33209dee1d refactor(core): Move to stack allocated events.
* Move to local/stack allocated event API that doesn't require
  dynamic allocation/freeing.
* Disable heap, we no longer use alloc/free unless using LVGL.
* Tons of refactors all over to account for the new event approach.
2024-01-14 11:13:57 -08:00
Peter Johanson
50e473276f chore(ci): Split build and upload into separate steps
* Treat build and upload as distinct steps during a build, and don't fail
  a PR if only the upload portion fails.
2024-01-14 10:42:04 -08:00
typorian
466cf92029
fix(docs): Document CONFIG_ZMK_USB_BOOT 2024-01-12 11:02:47 -08:00
dependabot[bot]
2829185a94 chore(deps): bump follow-redirects from 1.15.2 to 1.15.4 in /docs
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-12 10:42:52 -08:00
Peter Johanson
db9ab30335 fix(boards): Fix up EXT_POWER naming for adv360pro;
* Restore setting loading by preserving old device name for the
  external power node.
2024-01-08 17:50:19 -08:00
Xudong Zheng
6bf4870704 fix(battery): prevent bus fault when battery does not exist
zmk_battery_start_reporting() may be called from battery_event_listener(), which
will result in a bus fault when attempting to read a battery that does not exist
such as on a dongle.
2024-01-08 17:39:05 -08:00
Peter Johanson
7652fbeb6b fix(split): Split peripherals should auto sec req still.
* Ensure split peripherals have `BT_GATT_AUTO_SEC_REQ` enabled so that
  reconnects to centrals are automatically encrypted.
2024-01-06 00:53:49 -08:00
Peter Johanson
12bc8b0402 fix: Fix function signatures for WPM.
* Recent refactor accidentally used the wrong signatures for a few
  WPM function definitions.
2024-01-05 16:09:34 -08:00
Leonardo Bispo
cebf651d11
fix(boards): include the right flash info in XIAO BLE overlay 2024-01-05 19:00:32 -05:00
Peter Johanson
395ffaa790 fix(ble): Properly send mouse HoG using worker.
* Properly send mouse HoG reports using our worker to avoid thread issues.
2024-01-05 12:17:59 -08:00
Peter Johanson
74875314f8 feat(ble): Request encryption if notifying fails
* If attempting to notify and getting an EPERM return value, request
  upgrading the security of the connection at that moment, since it
  likely means we got a connection to a bonded host but the connection
  hasn't been upgraded to encrypted yet.
2024-01-05 12:17:59 -08:00
Pete Johanson
69f962fab2 feat(ble): Add security related tests.
* Add security related tests to verify behavior when trying to read
  a GATT characteristic from our peripheral with and without client
  auto security request/retry.
2024-01-05 12:17:59 -08:00
Peter Johanson
bc7b4b56bd fix(ble): Disable Auto Sec Req again.
* Auto security request actually makes macOS worse, so disable it,
  and remove our early request in favor of using GATT enforcement
 to ensure connections are secured.
2024-01-05 12:17:59 -08:00
Chris Andreae
7d1c1ae8fd fixup! docs
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-01-05 12:16:38 -08:00
Chris Andreae
7b9466c7dc fixup! add documentation for BT_CLR_ALL 2024-01-05 12:16:38 -08:00
Chris Andreae
194a9790eb fixup! use wider type for loop iterator 2024-01-05 12:16:38 -08:00
Chris Andreae
b813f34e34 fixup! bt: add BT_CLR_ALL behaviour 2024-01-05 12:16:38 -08:00
Chris Andreae
f4fe7fa40f Extract common behaviour of clearing a bond 2024-01-05 12:16:38 -08:00
Chris Andreae
604c95118e Remove error reporting from ble utility functions that never error 2024-01-05 12:16:38 -08:00
Chris Andreae
b8cb407351 lint: use correct type signature for Zephyr callbacks 2024-01-05 12:16:38 -08:00
Chris Andreae
7a5155f36e lint: add (void) parameter to pass -Wstrict-prototypes
Note there was one place where a non-strict prototype was actually being used
with an argument, in `zmk_hog_init`. In this case, the actual argument type was
added instead.
2024-01-05 12:16:38 -08:00
moergo-sc
5257cde1f5 bt: add BT_CLR_ALL behaviour
Defines behaviour to clear all paired Bluetooth profiles
2024-01-05 12:16:38 -08:00
Justin Ridgewell
6f8d080b6a
fix: Use zmk_battery_state_of_charge in battery widgets 2024-01-05 15:02:06 -05:00
Cem Aksoylar
b3146e665e
feat(blog): Add post for joelspadin projects for spotlight series (#2092)
Co-authored-by: Joel Spadin <joelspadin@gmail.com>
2024-01-05 10:42:04 -08:00
Gabor Hornyak
0e2f94b73b feat(ble): Support perhipheral battery levels.
* Add ability to fetch and report peripheral battery levels
  on split centrals.
* Add additional support for adding a new Battery Level
  service to split centrals that exposes fetched peripheral
  battery levels to connected hosts.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2024-01-03 09:26:51 -08:00
honorless
d35311af97 refactor: remove misleading build warning
* Among other issues, this message is often misinterpreted by users
  building out-of-tree shields -- leading them to think the shield
  "not being found" is the cause of a build failure.
2023-12-30 18:26:00 -08:00
honorless
7ef6ec7560 refactor: remove unused Kconfig files 2023-12-30 18:26:00 -08:00
jack
c965e35140
chore: Ignore python virtualenv files 2023-12-27 10:07:55 -08:00
Peter Johanson
a593c7260a feat(bt): Add test for unauth overwrite.
* Add a test to ensure unauth overwrite does the right thing when
  hosts try to pair again without the profile cleared on the ZMK side.
2023-12-18 13:18:09 -08:00
Cem Aksoylar
12d73ba4f9 fix(docs): Fix remark on &bt parameter #2 2023-12-17 17:38:07 -08:00
Cem Aksoylar
78fa1e77c4 feat(blog): Add nodefree-config post for spotlight series
Co-authored-by: Robert U <978080+urob@users.noreply.github.com>
2023-12-16 21:55:45 -08:00
Peter Johanson
1b8b6b4a0e refactor(core): Make low priority queue optional.
* Add a new Kconfig symbol to enable the low priority queue, and make
  the two features that depend on it `select` the symbol to turn it on.
  This helps ensure no wasted RAM/ROM on devices that don't need it.
2023-12-16 17:10:45 -08:00
Peter Johanson
f4f402fa44 fix(ci): Use unique artifact for test logs
* To address conflicts with identically named artifact uploads, include the
  test name in the artifact name.
2023-12-15 13:23:51 -08:00
Peter Johanson
9b3a98691c refactor(bt): Split security and conn exp. Kconfig
* Split connection and security experimental changes into dedicated
  Kconfig flags for easier testing of only connection related fixes.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-15 08:59:03 -08:00
Peter Johanson
52ed49b4bb fix(ci): Upgrade to github-script@v7
* Also adjust form @actions/upload API changes.
2023-12-13 11:48:28 -08:00
Cem Aksoylar
ff57ccc75a feat(shields): Allow settings_reset to build with board-only keyboards 2023-12-13 11:29:33 -08:00
Hooky
2c50cff891
feat(kscan): Add charlieplex keyscan driver
* Supports matrixes with and without additional interrupt pin use.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2023-12-09 17:10:05 -05:00
Peter Johanson
b35a5e83c0 fix(shields): Don't enable passkey support on Uno.
* The ZMK Uno has no way to input the full range of digits, so skip
  that setting so it's not pulled in by BLE experimental feature flag.
2023-12-08 14:57:23 -08:00
Peter Johanson
63c8c5700a feat(bt): Add more experimental tweaks.
* Support auto security upgrade for splits properly.
* Disable 2M and legacy LLCP if the experimental
  Kconfig flag is selected.
2023-12-08 14:57:23 -08:00
Peter Johanson
96f9031951 fix(build): Only copy if zephyr module detected
* To fix issues with breakage with existing user config
  repos, only do our copy strategy if we detect a zephyr module
  present in the repo as well.
2023-12-08 10:49:27 -08:00
Cem Aksoylar
384637ae6c fix(docs): Fix text blurb about split Kconfig.defconfig 2023-12-06 22:50:06 -08:00
Cem Aksoylar
09d47d8117 refactor(docs): Convert breaks to unordered lists in tables
Co-authored-by: Joel Spadin <joelspadin@gmail.com>
2023-12-06 22:46:03 -08:00
Cem Aksoylar
55bf7cae7e feat(docs): Note how parameters are forwarded for behaviors 2023-12-06 22:46:03 -08:00
Cem Aksoylar
56d863cba6 feat(docs): Document sensor-rotate in behaviors config 2023-12-06 22:46:03 -08:00
Cem Aksoylar
2bab81a304 fix(docs): Note -var definition files for macros 2023-12-06 22:46:03 -08:00
Cem Aksoylar
76a209c728 fix(docs): Fix sticky key #binding-cells 2023-12-06 22:46:03 -08:00
Cem Aksoylar
f3ad08b619 fix(docs): Add missing page pointers in behaviors config 2023-12-06 22:46:03 -08:00
Peter Johanson
88338a9b3c feat(shields): Add ZMK Uno split setup
* Make it easier to test split code with ZMK Uno
  hardware by adding a split left/right setup as well.
2023-12-06 15:00:29 -08:00
Peter Johanson
291bbc2257 refactor(docs): New shield guide to suggest modules
* Update the new shield guide to position Zephyr module location
  as the default when creating new shields, with a note about
  using ZMK repository itself as a last resort.
* Document building with additional Zephyr modules.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-06 09:36:37 -08:00
Peter Johanson
3656ec63d0 feat(build): Build unified config/mod repos.
* Detect in our build script if our config repo is *also* a Zephyr
  module and if so pass to ZMK build in ZMK_EXTRA_MODULES
  define.
* Copy config directory contents to new independent temp workspace
  to avoid Kconfig conflicts between the build repo's zephyr module
  directory and the checkout zephyr pulled in by `west update`.
2023-12-06 09:36:37 -08:00
Peter Johanson
efd403a567 refactor: Hook into CMake loading in a better spot.
* Shift to using an extra Zephyr module to do keymap location
  work after all board roots are resolved. This avoids duplicate work
  and allows us to load custom boards from Zephyr modules as well as
  user config setups.
2023-12-06 09:36:37 -08:00
Peter Johanson
0ab6a0ad11 feat(bt): Add new experimental Kconfig setting.
* In order to have an easy way to test and phase in BT changes, add a
  new `ZMK_BLE_EXPERIMENTAL_FEATURES` Kconfig setting.
2023-12-06 09:22:50 -08:00
Joel Spadin
17a6f0b128 refactor: Remove new uses of label property
Removed new uses of the "label" property which were introduced after
the previous commits on this branch were written.
2023-12-04 20:06:54 -06:00
Joel Spadin
0fd8e25807 docs: Document behavior name length limit
Added a section to the new behavior guide to document that the names of
behaviors invoked on the peripheral side of a split must be at most 8
characters long.
2023-12-04 20:06:54 -06:00
Joel Spadin
23ecf08119 refactor(behaviors)!: Remove labels from behaviors
Removed the label property from built-in behaviors, custom behaviors
defined in a few keymaps, and macros generated with ZMK_MACRO().

Now that node names are used to identify behaviors, and names only need
to be unique within the set of behaviors, the names of all behaviors
have been shortened to be similar to their original labels.

This means that any keymaps which reference behavior nodes by name
instead of by label will need to be updated. Keymaps typically use the
labels though, so most keymaps should be unaffected by this change.
2023-12-04 20:06:54 -06:00
Joel Spadin
36eda571b7 refactor(behaviors): Create a list to lookup behaviors
Added BEHAVIOR_DT_DEFINE() and BEHAVIOR_DT_INST_DEFINE(), which work
exactly like the DEVICE_*_DEFINE() macros, except they also register the
device as a behavior by adding a pointer to it to a memory section.

Added zmk_behavior_get_binding(), which works like device_get_binding()
except that it only searches the devices that have been registered as
behaviors. This ensures that behaviors cannot have name collisions with
other devices defined by the SoC, which will be important when we remove
the label property from behaviors so they are given their node names.

As an added benefit, this is faster since it searches a smaller list.
Some basic benchmark code I wrote indicates it takes 30-70% as long,
depending on where the behavior is in the list and whether the name
string is an exact pointer match.

From now on, behaviors should use BEHAVIOR_*_DEFINe() instead of
DEVICE_*_DEFINE(), and any code that looks up a behavior by name should
use zmk_behavior_get_binding() instead of device_get_binding().
2023-12-04 20:06:54 -06:00
Joel Spadin
5ecd3521f5 docs: Remove label property from documentation 2023-12-04 20:06:54 -06:00
Joel Spadin
d4e8dee444 refactor(keymaps): Rename layer label to "display-name"
Changed the property used to define a layer name for displays from
"label" (which affects other things in Zephyr and is deprecated) to
"display-name". (It cannot be named simply "name", because that has
special meaning in newer versions of the devicetree compiler.)

"label" is still supported as a fallback, so no changes need to be made
to existing keymaps.
2023-12-04 20:06:54 -06:00
Joel Spadin
ba5637fdef refactor: Remove unimportant labels
Removed "label" properties which no longer have any function.

Labels are still used as layer names and as identifiers for sending
behaviors between sides of a split keyboard, so those have been left
alone for now.
2023-12-04 20:06:54 -06:00
Joel Spadin
3ae9e74056 refactor(drivers): Make label property optional 2023-12-04 20:06:54 -06:00
Joel Spadin
05925c72d7 refactor(ext_power): Remove label property
Changed the label property on zmk,ext-power-generic to be optional and
removed it from existing uses. Renamed the nodes for all non-development
boards to "EXT_POWER" to preserve user settings.

rgb_underglow.c now finds the correct device by finding the first
instance of zmk,ext-power-generic instead of looking for a node named
"EXT_POWER".
2023-12-04 20:06:54 -06:00
Joel Spadin
179bdbc41a refactor(behaviors): Make label property optional
Changed all code (except for layer names) which used the label property
to use DEVICE_DT_NAME() instead, which uses the label if set or falls
back to the full node name. This matches how Zephyr determines the node
names used with device_get_binding() and allows us to start removing the
deprecated label property from things.
2023-12-04 20:06:54 -06:00
ReFil
dbe5dfb1d8
feat(split): Add is_bonded function to peripherals
There is already a function to see if the peripheral is connected, a matching one for if it's bonded is a useful addition for displays/indicators. `is_bonded` gets reset to false in the advertising function in preparation for runtime peripheral bond clearing
2023-12-04 18:31:35 -05:00
ReFil
9bacaffe62
feat(hid): Add KConfig option for higher NKRO usages
By default the maximum NKRO usage is set to maximise compatibility, but some keys dont work, this adds the ability to use those extended keys, at the cost of compatibiltity

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2023-12-04 18:24:05 -05:00
Cem Aksoylar
8ee3467adf fix(docs): Update outdated information in the hardware page 2023-12-04 15:22:49 -08:00
Cem Aksoylar
042e5209b3 fix(docs): Fix table for BT_DISC 2023-12-04 09:24:53 -08:00
ReFil
ecefd6d24b
fix(docs): Update backlight docs (#1894)
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
2023-12-04 09:21:49 -08:00
Peter Johanson
55aed8e89d feat(tests): Add ability to auto-accept test diff. 2023-12-02 17:11:45 -08:00
Peter Johanson
c63d0791d5 chore: Ensure BSIM env. variables set in devcontainer. 2023-12-02 17:11:45 -08:00
Peter Johanson
693530c2f1 feat(bluetooth): Initial nRF52 BSIM based test support.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-02 17:11:45 -08:00
Peter Johanson
da15564d0e feat(bluetooth): Build on ARCH_POSIX. 2023-12-02 17:11:45 -08:00
Peter Johanson
3fad4dba07 fix(bt): Passkey entry pairing fixes.
* Don't propogate any key press events while in the
  middle of passkey entry, avoid funky state on hosts.
* Handle passkey on release, not press, to ensure key *releases*
  are not accidentally sent, especially the Enter release
  at the very end of passkey entry, which can trigger
  cancel in the dialog if the keyboard is connected
  via USB to the same host.
2023-12-01 16:48:46 -08:00
Peter Johanson
329d6474ee feat(ble): Make it possible to use BT_GATT_AUTO_SEC_REQ
* Only upgrade security of new connections if BT_GATT_AUTO_SEC_REQ
  is not enabled.
2023-12-01 16:47:49 -08:00
Peter Johanson
744f70c80c feat(bt): Add support for unauth overwrite
* Properly handle the user enabling the
  `CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE`
  Zephyr flag and handle re-pairing to an existing taken
  profile from the same address.
2023-12-01 23:39:31 +00:00
ReFil
69f7bfb409
feat(boards): Kinesis Advantage 360 pro
Add the Kinesis Advantage 360 Pro board definition.
2023-11-27 19:09:58 -05:00
Peter Johanson
817ce8764f refactor: Move to zmk_hid_indicators_t type. 2023-11-27 16:03:18 -08:00
Alessandro Bortolin
d9bb0d7d0e feat: LED indicators on peripheral side 2023-11-27 16:03:18 -08:00
Alessandro Bortolin
4e55c5f6e9 feat: handle LED indicators report 2023-11-27 16:03:18 -08:00
ReFil
6276e973d5 feat(ble): Only update BAS when active
Subscribes to the activity changing event, will stop the battery work timer when in idle or deep sleep, restart when board goes active
2023-11-27 09:58:20 -08:00
ReFil
84b93350b8
feat(docs): Document adding USB logging to a standalone board (#2039)
Currently this is only documented in the zephyr 3.0 upgrade blog. This explicitly documents it as well as when it doesn't need to be applied (i.e. when a mcu board is already in use).
2023-11-27 09:12:33 -08: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
1037 changed files with 35846 additions and 23682 deletions

View file

@ -6,3 +6,8 @@ fi
if [ -f "$WORKSPACE_DIR/zephyr/zephyr-env.sh" ]; then
source "$WORKSPACE_DIR/zephyr/zephyr-env.sh"
fi
if [ -d "$WORKSPACE_DIR/tools/bsim" ]; then
export BSIM_OUT_PATH="$WORKSPACE_DIR/tools/bsim/"
export BSIM_COMPONENTS_PATH="$WORKSPACE_DIR/tools/bsim/components/"
fi

View file

@ -1,4 +1,4 @@
FROM docker.io/zmkfirmware/zmk-dev-arm:3.2
FROM docker.io/zmkfirmware/zmk-dev-arm:3.5
COPY .bashrc tmp
RUN mv /tmp/.bashrc ~/.bashrc

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]
}

78
.github/workflows/ble-test.yml vendored Normal file
View file

@ -0,0 +1,78 @@
name: BLE Tests
on:
push:
paths:
- ".github/workflows/ble-test.yml"
- "app/tests/ble/**"
- "app/src/**"
- "app/run-ble-test.sh"
pull_request:
paths:
- ".github/workflows/ble-test.yml"
- "app/tests/ble/**"
- "app/src/**"
- "app/run-ble-test.sh"
jobs:
collect-tests:
outputs:
test-dirs: ${{ steps.test-dirs.outputs.test-dirs }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find test directories
id: test-dirs
run: |
cd app/tests/ble
export TESTS=$(ls -d * | grep -v central | jq -R -s -c 'split("\n")[:-1]')
echo "test-dirs=${TESTS}" > $GITHUB_OUTPUT
run-tests:
needs: collect-tests
strategy:
matrix:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache west modules
uses: actions/cache@v4
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
timeout-minutes: 2
continue-on-error: true
- name: Initialize workspace (west init)
run: west init -l app
- name: Enable babblesim group filter
run: west config manifest.group-filter -- +babblesim
- name: Update modules (west update)
run: west update
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Build BabbleSim components
working-directory: tools/bsim
run: make everything
- name: Test ${{ matrix.test }}
working-directory: app
run: BSIM_COMPONENTS_PATH="${GITHUB_WORKSPACE}/tools/bsim/components" BSIM_OUT_PATH="${GITHUB_WORKSPACE}/tools/bsim" ./run-ble-test.sh tests/ble/${{ matrix.test }}
- name: Archive artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.test }}-log-files"
path: app/build/**/*.log

View file

@ -32,7 +32,7 @@ jobs:
build_matrix: ${{ env.build_matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install yaml2json
run: python3 -m pip install remarshal
@ -52,31 +52,59 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create build directory
run: |
echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV
- name: Prepare variables
shell: sh -x {0}
env:
board: ${{ matrix.board }}
shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }}
snippet: ${{ matrix.snippet }}
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
if [ -e zephyr/module.yml ]; then
export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
new_tmp_dir="${TMPDIR:-/tmp}/zmk-config"
mkdir -p "${new_tmp_dir}"
echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV
else
echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v3
if [ -n "${snippet}" ]; then
extra_west_args="-S \"${snippet}\""
fi
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
- name: Copy config files to isolated temporary directory
run: |
if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then
mkdir "${{ env.base_dir }}/${{ inputs.config_path }}"
cp -R ${{ inputs.config_path }}/* "${{ env.base_dir }}/${{ inputs.config_path }}/"
fi
- name: Cache west modules
uses: actions/cache@v3.0.11
uses: actions/cache@v4
continue-on-error: true
env:
cache_name: cache-zephyr-${{ env.zephyr_version }}-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
${{ env.base_dir }}/modules/
${{ env.base_dir }}/tools/
${{ env.base_dir }}/zephyr/
${{ env.base_dir }}/bootloader/
${{ env.base_dir }}/zmk/
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache_name }}-
@ -84,35 +112,71 @@ jobs:
${{ runner.os }}-
- name: West Init
run: west init -l "${{ inputs.config_path }}"
working-directory: ${{ env.base_dir }}
run: west init -l "${{ env.base_dir }}/${{ inputs.config_path }}"
- name: West Update
working-directory: ${{ env.base_dir }}
run: west update
- name: West Zephyr export
working-directory: ${{ env.base_dir }}
run: west zephyr-export
- name: West Build (${{ env.display_name }})
working-directory: ${{ env.base_dir }}
shell: sh -x {0}
run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/${{ 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 "${{ env.build_dir }}/zephyr/.config" ]
then
grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort
else
echo "No Kconfig output"
fi
if: ${{ !cancelled() }}
- name: ${{ env.display_name }} Devicetree file
run: |
if [ -f "${{ env.build_dir }}/zephyr/zephyr.dts" ]
then
cat "${{ env.build_dir }}/zephyr/zephyr.dts"
elif [ -f "${{ env.build_dir }}/zephyr/zephyr.dts.pre" ]
then
cat -s "${{ env.build_dir }}/zephyr/zephyr.dts.pre"
else
echo "No Devicetree output"
fi
if: ${{ !cancelled() }}
- name: Rename artifacts
shell: sh -x {0}
run: |
mkdir build/artifacts
if [ -f build/zephyr/zmk.uf2 ]
mkdir "${{ env.build_dir }}/artifacts"
if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ]
then
cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2"
elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ]
cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2"
elif [ -f "${{ env.build_dir }}/zephyr/zmk.${{ inputs.fallback_binary }}" ]
then
cp "build/zephyr/zmk.${{ inputs.fallback_binary }}" "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
cp "${{ env.build_dir }}/zephyr/zmk.${{ inputs.fallback_binary }}" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
fi
- name: Archive (${{ env.display_name }})
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ env.artifact_name }}
path: ${{ env.build_dir }}/artifacts
merge:
runs-on: ubuntu-latest
needs: build
name: Merge Output Artifacts
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: ${{ inputs.archive_name }}
path: build/artifacts
pattern: artifact-*
delete-merged: true

View file

@ -12,21 +12,29 @@ on:
schedule:
- cron: "22 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
permissions: {}
jobs:
build:
if: ${{ always() }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2
image: docker.io/zmkfirmware/zmk-build-arm:3.5
needs: compile-matrix
strategy:
matrix:
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache west modules
uses: actions/cache@v3.0.2
uses: actions/cache@v4
env:
cache-name: cache-zephyr-modules
with:
@ -49,19 +57,17 @@ jobs:
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Install @actions/artifact
run: npm install @actions/artifact
- name: Build and upload artifacts
uses: actions/github-script@v4
- name: Build
uses: actions/github-script@v7
id: boards-list
with:
script: |
const fs = require('fs');
const artifact = require('@actions/artifact');
const artifactClient = artifact.create();
const execSync = require('child_process').execSync;
@ -71,10 +77,39 @@ jobs:
for (const shieldArgs of buildShieldArgs) {
try {
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
const output = execSync(`west build -s app -p -b ${{ matrix.board }} ${shieldArgs.snippet ? '-S ' + shieldArgs.snippet : ''} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
console.log(output.toString());
} catch (e) {
console.error(`::error::Failed to build ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
console.error(e);
error = true;
} finally {
console.log('::endgroup::');
}
}
if (error) {
throw new Error('Failed to build one or more configurations');
}
- name: Upload artifacts
uses: actions/github-script@v7
continue-on-error: ${{ github.event_name == 'pull_request' }}
id: boards-upload
with:
script: |
const fs = require('fs');
const {default: artifact} = require('@actions/artifact');
const buildShieldArgs = JSON.parse(`${{ matrix.shieldArgs }}`);
let error = false;
for (const shieldArgs of buildShieldArgs) {
try {
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Upload`)
const fileExtensions = ["hex", "uf2"];
@ -90,9 +125,9 @@ jobs:
const cmakeName = shieldArgs['cmake-args'] ? '-' + (shieldArgs.nickname || shieldArgs['cmake-args'].split(' ').join('')) : '';
const artifactName = `${{ matrix.board }}${shieldArgs.shield ? '-' + shieldArgs.shield : ''}${cmakeName}-zmk`;
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
await artifact.uploadArtifact(artifactName, files, rootDirectory, options);
} catch (e) {
console.error(`::error::Failed to build or upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
console.error(`::error::Failed to upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
console.error(e);
error = true;
} finally {
@ -104,14 +139,14 @@ jobs:
throw new Error('Failed to build one or more configurations');
}
compile-matrix:
if: ${{ always() }}
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [core-coverage, board-changes, nightly]
outputs:
include-list: ${{ steps.compile-list.outputs.result }}
steps:
- name: Join build lists
uses: actions/github-script@v4
uses: actions/github-script@v7
id: compile-list
with:
script: |
@ -135,6 +170,7 @@ jobs:
perBoard[configuration.board].push({
shield: configuration.shield,
'cmake-args': configuration['cmake-args'],
snippet: configuration.snippet,
nickname: configuration.nickname
})
}
@ -151,14 +187,16 @@ jobs:
core-include: ${{ steps.core-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: core-list
with:
script: |
@ -180,14 +218,14 @@ jobs:
boards-include: ${{ steps.boards-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: boards-list
with:
script: |
@ -257,14 +295,14 @@ jobs:
});
}))).flat();
nightly:
if: ${{ github.event_name == 'schedule' }}
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'zmkfirmware' }}
runs-on: ubuntu-latest
needs: get-grouped-hardware
outputs:
nightly-include: ${{ steps.nightly-list.outputs.result }}
steps:
- name: Create nightly list
uses: actions/github-script@v4
uses: actions/github-script@v7
id: nightly-list
with:
script: |
@ -307,15 +345,17 @@ jobs:
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Install js-yaml
run: npm install js-yaml
- name: Aggregate Metadata
uses: actions/github-script@v4
uses: actions/github-script@v7
id: aggregate-metadata
with:
script: |
@ -333,7 +373,7 @@ jobs:
result-encoding: string
- name: Organize Metadata
uses: actions/github-script@v4
uses: actions/github-script@v7
id: organize-metadata
with:
script: |
@ -382,27 +422,32 @@ jobs:
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
outputs:
changed-files: ${{ steps.changed-files.outputs.all }}
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}
board-changes: ${{ steps.board-changes.outputs.result }}
core-changes: ${{ steps.core-changes.outputs.result }}
steps:
- uses: Ana06/get-changed-files@v2.0.0
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: tj-actions/changed-files@v45
id: changed-files
with:
format: "json"
- uses: actions/github-script@v4
json: true
escape_json: false
- uses: actions/github-script@v7
id: board-changes
with:
script: |
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all_changed_files }}`);
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
return boardChanges.length ? 'true' : 'false';
result-encoding: string
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: core-changes
with:
script: |
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all_changed_files }}`);
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
const appChanges = changedFiles.filter(f => f.startsWith('app'));
const ymlChanges = changedFiles.includes('.github/workflows/build.yml');

View file

@ -14,7 +14,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
@ -24,7 +24,7 @@ jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: bahmutov/npm-install@v1
with:
working-directory: docs

View file

@ -18,11 +18,11 @@ jobs:
validate-metadata:
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-dev-arm:3.2
image: docker.io/zmkfirmware/zmk-dev-arm:3.5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install -r app/scripts/requirements.txt
run: pip install --break-system-packages -r app/scripts/requirements.txt
- name: West init
run: west init -l app
- name: Update modules (west update)

View file

@ -8,8 +8,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1

View file

@ -6,11 +6,13 @@ on:
- ".github/workflows/test.yml"
- "app/tests/**"
- "app/src/**"
- "app/include/**"
pull_request:
paths:
- ".github/workflows/test.yml"
- "app/tests/**"
- "app/src/**"
- "app/include/**"
jobs:
collect-tests:
@ -19,13 +21,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Find test directories
id: test-dirs
run: |
cd app/tests/
export TESTS=$(ls -d * | jq -R -s -c 'split("\n")[:-1]')
echo "::set-output name=test-dirs::${TESTS}"
export TESTS=$(ls -d * | grep -v ble | jq -R -s -c 'split("\n")[:-1]')
echo "test-dirs=${TESTS}" >> $GITHUB_OUTPUT
run-tests:
needs: collect-tests
strategy:
@ -33,12 +35,12 @@ jobs:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2
image: docker.io/zmkfirmware/zmk-build-arm:3.5
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache west modules
uses: actions/cache@v3.0.2
uses: actions/cache@v4
env:
cache-name: cache-zephyr-modules
with:
@ -65,7 +67,7 @@ jobs:
run: west test tests/${{ matrix.test }}
- name: Archive artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: "log-files"
name: "${{ matrix.test }}-log-files"
path: app/build/**/*.log

9
.gitignore vendored
View file

@ -5,5 +5,14 @@
/zephyr
/zmk-config
/build
# macOS
*.DS_Store
# Python
__pycache__
.python-version
.venv
# clangd
app/.cache/

View file

@ -4,6 +4,7 @@
"ms-python.python",
"ms-vscode.cpptools",
"plorefice.devicetree",
"twxs.cmake"
"twxs.cmake",
"unifiedjs.vscode-mdx"
]
}

View file

@ -86,6 +86,12 @@ documentation to areas not currently covered are greatly appreciated.
ZMK uses `prettier` to format documentation files. You can run prettier with `npm run prettier:format`.
You can setup git to run prettier automatically when you commit by installing the pre-commit hooks: `pip3 install pre-commit`, `pre-commit install`.
### Linting
This repository utilizes ESLint for code linting to ensure consistent code style and identify potential errors or bugs early in the development process.
You can run ESLint with `npm run lint` to verify your changes.
## Code Contributions
### Development Setup

View file

@ -2,45 +2,53 @@ cmake_minimum_required(VERSION 3.13.1)
set(CONFIG_APPLICATION_DEFINED_SYSCALL true)
# Add our custom Zephyr module for drivers w/ syscalls, etc.
list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR}/drivers/zephyr)
set(ZephyrBuildConfiguration_ROOT ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND ZEPHYR_EXTRA_MODULES
${CMAKE_CURRENT_SOURCE_DIR}/module
)
set(ZEPHYR_EXTRA_MODULES "${ZMK_EXTRA_MODULES};${CMAKE_CURRENT_SOURCE_DIR}/module;${CMAKE_CURRENT_SOURCE_DIR}/keymap-module")
# Find Zephyr. This also loads Zephyr's build system.
find_package(Zephyr REQUIRED HINTS ../zephyr)
project(zmk)
zephyr_linker_sources(SECTIONS include/linker/zmk-behaviors.ld)
zephyr_linker_sources(RODATA include/linker/zmk-events.ld)
if(CONFIG_ZMK_BEHAVIOR_LOCAL_IDS)
zephyr_linker_sources(DATA_SECTIONS include/linker/zmk-behavior-local-id-map.ld)
endif()
zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/behavior.h)
zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/ext_power.h)
# Add your source file to the "app" target. This must come after
# find_package(Zephyr) which defines the target.
target_include_directories(app PRIVATE include)
target_sources(app PRIVATE src/stdlib.c)
target_sources(app PRIVATE src/activity.c)
target_sources(app PRIVATE src/kscan.c)
target_sources(app PRIVATE src/behavior.c)
target_sources_ifdef(CONFIG_ZMK_KSCAN_SIDEBAND_BEHAVIORS app PRIVATE src/kscan_sideband_behaviors.c)
target_sources(app PRIVATE src/matrix_transform.c)
target_sources(app PRIVATE src/physical_layouts.c)
target_sources(app PRIVATE src/sensors.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.c)
target_sources(app PRIVATE src/event_manager.c)
target_sources_ifdef(CONFIG_ZMK_PM app PRIVATE src/pm.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
target_sources_ifdef(CONFIG_ZMK_GPIO_KEY_WAKEUP_TRIGGER app PRIVATE src/gpio_key_wakeup_trigger.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)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SOFT_OFF app PRIVATE src/behaviors/behavior_soft_off.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)
target_sources(app PRIVATE src/behaviors/behavior_sticky_key.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_HOLD_TAP app PRIVATE src/behaviors/behavior_hold_tap.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_STICKY_KEY app PRIVATE src/behaviors/behavior_sticky_key.c)
target_sources(app PRIVATE src/behaviors/behavior_caps_word.c)
target_sources(app PRIVATE src/behaviors/behavior_key_repeat.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_MACRO app PRIVATE src/behaviors/behavior_macro.c)
@ -54,6 +62,8 @@ 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_ifdef(CONFIG_ZMK_BEHAVIOR_STUDIO_UNLOCK app PRIVATE src/behaviors/behavior_studio_unlock.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)
@ -65,6 +75,7 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/events/layer_state_changed.c)
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
target_sources(app PRIVATE src/events/keycode_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/hid_indicators.c)
if (CONFIG_ZMK_BLE)
target_sources(app PRIVATE src/events/ble_active_profile_changed.c)
@ -80,6 +91,8 @@ target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/behaviors/behavior_bac
target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/events/battery_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/battery.c)
target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/events/hid_indicators_changed.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c)
add_subdirectory(src/split)
@ -87,9 +100,33 @@ target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c)
target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/backlight.c)
target_sources(app PRIVATE src/workqueue.c)
target_sources_ifdef(CONFIG_ZMK_LOW_PRIORITY_WORK_QUEUE app PRIVATE src/workqueue.c)
target_sources(app PRIVATE src/main.c)
add_subdirectory(src/display/)
add_subdirectory_ifdef(CONFIG_SETTINGS src/settings/)
if (CONFIG_ZMK_STUDIO_RPC)
# For some reason this is failing if run from a different sub-file.
list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)
include(nanopb)
# Turn off the default nanopb behavior
set(NANOPB_GENERATE_CPP_STANDALONE OFF)
nanopb_generate_cpp(proto_srcs proto_hdrs RELPATH ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/studio.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/meta.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/core.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/behaviors.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/keymap.proto
)
target_include_directories(app PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_sources(app PRIVATE ${proto_srcs} ${proto_hdrs})
add_subdirectory(src/studio)
endif()
zephyr_cc_option(-Wfatal-errors)

View file

@ -37,6 +37,17 @@ config BT_DIS_MODEL
config BT_DIS_MANUF
default "ZMK Project"
# Hardware specific overrides
if SOC_SERIES_NRF52X
# Default on for our usage until boards implement retained bootmode.
config NRF_STORE_REBOOT_TYPE_GPREGRET
bool
default y
endif
menu "HID"
choice ZMK_HID_REPORT_TYPE
@ -53,10 +64,19 @@ config ZMK_HID_REPORT_TYPE_NKRO
help
Enable full N-Key Roll Over for HID output. This selection will prevent the keyboard
from working with some BIOS/UEFI versions that only support "boot keyboard" support.
This option also prevents using some infrequently used higher range HID usages.
This option also prevents using some infrequently used higher range HID usages (notably F13-F24 and INTL1-9)
These usages can be re enabled with ZMK_HID_KEYBOARD_NKRO_EXTENDED_REPORT.
endchoice
config ZMK_HID_KEYBOARD_NKRO_EXTENDED_REPORT
bool "Enable extended NKRO reporting"
depends on ZMK_HID_REPORT_TYPE_NKRO
help
Enables higher usage range for NKRO (F13-F24 and INTL1-9).
Please note this is not compatible with Android currently and you will get no input
if ZMK_HID_REPORT_TYPE_HKRO
config ZMK_HID_KEYBOARD_REPORT_SIZE
@ -87,14 +107,33 @@ config ZMK_HID_CONSUMER_REPORT_USAGES_BASIC
endchoice
config ZMK_HID_INDICATORS
bool "HID Indicators"
help
Enable HID indicators, used for detecting state of Caps/Scroll/Num Lock,
Kata, and Compose.
config ZMK_HID_SEPARATE_MOD_RELEASE_REPORT
bool "Release Modifiers Separately"
help
Send a separate release event for the modifiers, to make sure the release
of the modifier doesn't get recognized before the actual key's release event.
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
@ -114,21 +153,48 @@ menuconfig ZMK_BLE
select BT_SMP_APP_PAIRING_ACCEPT
select BT_PERIPHERAL
select BT_DIS
select BT_SETTINGS
select SETTINGS
imply ZMK_BATTERY_REPORTING
imply BT_SETTINGS if !ARCH_POSIX
imply SETTINGS if !ARCH_POSIX
imply ZMK_BATTERY_REPORTING if !ARCH_POSIX
if ZMK_BLE
config ZMK_BLE_EXPERIMENTAL_CONN
bool "Experimental BLE connection changes"
help
Enables a combination of settings that are planned to be default in future versions of ZMK
to improve connection stability. This includes changes to timing on BLE pairing initiation,
restores use of the updated/new LLCP implementation, and disables 2M PHY support.
config ZMK_BLE_EXPERIMENTAL_SEC
bool "Experimental BLE security changes"
imply BT_SMP_ALLOW_UNAUTH_OVERWRITE
help
Enables a combination of settings that are planned to be officially supported in the future.
This includes enabling BT Secure Connection passkey entry, and allows overwrite of keys from
previously paired hosts.
config ZMK_BLE_EXPERIMENTAL_FEATURES
bool "Experimental BLE connection and security settings/features"
select ZMK_BLE_EXPERIMENTAL_CONN
select ZMK_BLE_EXPERIMENTAL_SEC
help
Enables experimental connection changes and security features.
config ZMK_BLE_PASSKEY_ENTRY
bool "Require passkey entry on the keyboard to complete pairing"
select RING_BUFFER
config BT_SMP_ALLOW_UNAUTH_OVERWRITE
imply ZMK_BLE_PASSKEY_ENTRY
config BT_CTLR_PHY_2M
default n if ZMK_BLE_EXPERIMENTAL_CONN
# BT_TINYCRYPT_ECC is required for BT_SMP_SC_PAIR_ONLY when using HCI
config BT_TINYCRYPT_ECC
default y if BT_HCI && !BT_CTLR
choice BT_LL_SW_LLCP_IMPL
default BT_LL_SW_LLCP_LEGACY
endchoice
config SYSTEM_WORKQUEUE_STACK_SIZE
default 4096 if SOC_RP2040
default 2048
@ -149,25 +215,23 @@ 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
# HID GATT notifications sent this way are *not* picked up by Linux, and possibly others.
config BT_GATT_NOTIFY_MULTIPLE
default n
config BT_GATT_AUTO_SEC_REQ
default n
default (ZMK_SPLIT_BLE && !ZMK_SPLIT_ROLE_CENTRAL)
config BT_DEVICE_APPEARANCE
default 961
config ZMK_BLE_PASSKEY_ENTRY
bool "Require passkey entry on the keyboard to complete pairing"
default n
select RING_BUFFER
config BT_PERIPHERAL_PREF_MIN_INT
default 6
@ -194,13 +258,36 @@ rsource "src/split/Kconfig"
#Basic Keyboard Setup
endmenu
menu "Keymaps"
config ZMK_KEYMAP_LAYER_REORDERING
bool "Layer Reordering Support"
config ZMK_KEYMAP_SETTINGS_STORAGE
bool "Settings Save/Load"
depends on SETTINGS
depends on ZMK_BEHAVIOR_LOCAL_IDS
if ZMK_KEYMAP_SETTINGS_STORAGE
config ZMK_KEYMAP_LAYER_NAME_MAX_LEN
int "Max Layer Name Length"
default 20
endif
endmenu # Keymaps
rsource "src/studio/Kconfig"
menu "Display/LED Options"
rsource "src/display/Kconfig"
menuconfig ZMK_RGB_UNDERGLOW
bool "RGB Adressable LED Underglow"
bool "RGB Addressable LED Underglow"
select LED_STRIP
select ZMK_LOW_PRIORITY_WORK_QUEUE
if ZMK_RGB_UNDERGLOW
@ -308,13 +395,35 @@ endif
#Display/LED Options
endmenu
menu "Mouse Options"
config ZMK_MOUSE
bool "Enable ZMK mouse emulation"
#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
select ZMK_LOW_PRIORITY_WORK_QUEUE
imply BT_BAS if ZMK_BLE
if ZMK_BATTERY_REPORTING
choice ZMK_BATTERY_REPORTING_FETCH_MODE
prompt "Battery Reporting Fetch Mode"
config ZMK_BATTERY_REPORTING_FETCH_MODE_STATE_OF_CHARGE
bool "State of charge"
config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE
bool "Lithium Voltage"
endchoice
endif
config ZMK_IDLE_TIMEOUT
int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
@ -322,6 +431,9 @@ config ZMK_IDLE_TIMEOUT
config ZMK_SLEEP
bool "Enable deep sleep support"
depends on HAS_POWEROFF
select POWEROFF
select ZMK_PM_DEVICE_SUSPEND_RESUME
imply USB
if ZMK_SLEEP
@ -340,6 +452,26 @@ config ZMK_EXT_POWER
bool "Enable support to control external power output"
default y
config ZMK_PM
bool
config ZMK_PM_DEVICE_SUSPEND_RESUME
bool
select ZMK_PM
config ZMK_PM_SOFT_OFF
bool "Soft-off support"
depends on HAS_POWEROFF
select ZMK_PM
select PM_DEVICE
select ZMK_PM_DEVICE_SUSPEND_RESUME
select POWEROFF
config ZMK_GPIO_KEY_WAKEUP_TRIGGER
bool "Hardware supported wakeup (GPIO)"
default y
depends on DT_HAS_ZMK_GPIO_KEY_WAKEUP_TRIGGER_ENABLED && ZMK_PM_SOFT_OFF
#Power Management
endmenu
@ -386,7 +518,11 @@ if USB_DEVICE_STACK
config ZMK_USB_INIT_PRIORITY
int "USB Init Priority"
default 50
default 94
config ZMK_USB_HID_INIT_PRIORITY
int "USB HID Init Priority"
default 95
#USB
endif
@ -416,6 +552,21 @@ config ZMK_KSCAN_EVENT_QUEUE_SIZE
endif # ZMK_KSCAN
config ZMK_KSCAN_SIDEBAND_BEHAVIORS
bool
default y
depends on DT_HAS_ZMK_KSCAN_SIDEBAND_BEHAVIORS_ENABLED
select KSCAN
if ZMK_KSCAN_SIDEBAND_BEHAVIORS
config ZMK_KSCAN_SIDEBAND_BEHAVIORS_INIT_PRIORITY
int "Keyboard scan sideband behaviors driver init priority"
# The default kscan init priority is 90, so be sure we are initialized later.
default 95
endif # ZMK_KSCAN_SIDEBAND_BEHAVIORS
menu "Logging"
config ZMK_LOGGING_MINIMAL
@ -496,6 +647,22 @@ endmenu
if SETTINGS
config ZMK_SETTINGS_RESET_ON_START
bool "Delete all persistent settings when the keyboard boots"
if ZMK_SETTINGS_RESET_ON_START
config ZMK_SETTINGS_RESET_ON_START_INIT_PRIORITY
int "Settings Reset ON Start Initialization Priority"
default 60
help
Initialization priority for the settings reset on start. Must be lower priority/
higher value than FLASH_INIT_PRIORITY if using the NVS/Flash settings backend.
endif
config ZMK_SETTINGS_SAVE_DEBOUNCE
int "Milliseconds to debounce settings saves"
default 60000
@ -508,6 +675,11 @@ config ZMK_BATTERY_REPORT_INTERVAL
int "Battery level report interval in seconds"
default 60
config ZMK_LOW_PRIORITY_WORK_QUEUE
bool "Work queue for low priority items"
if ZMK_LOW_PRIORITY_WORK_QUEUE
config ZMK_LOW_PRIORITY_THREAD_STACK_SIZE
int "Low priority thread stack size"
default 768
@ -516,15 +688,14 @@ config ZMK_LOW_PRIORITY_THREAD_PRIORITY
int "Low priority thread priority"
default 10
endif
#Advanced
endmenu
#ZMK
endmenu
config HEAP_MEM_POOL_SIZE
default 8192
config KERNEL_BIN_NAME
default "zmk"
@ -534,9 +705,11 @@ config REBOOT
config USB_DEVICE_STACK
default y if HAS_HW_NRF_USBD
config FPU
default CPU_HAS_FPU
config ZMK_WPM
bool "Calculate WPM"
default n
config ZMK_KEYMAP_SENSORS
bool "Enable Keymap Sensors support"
@ -575,4 +748,3 @@ osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield"
source "Kconfig.zephyr"

View file

@ -1,15 +1,101 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
config ZMK_BEHAVIOR_METADATA
bool "Metadata"
help
Enabling this option adds APIs for documenting and fetching
metadata describing a behaviors name, and supported parameters.
config ZMK_BEHAVIOR_LOCAL_IDS
bool "Local IDs"
if ZMK_BEHAVIOR_LOCAL_IDS
config ZMK_BEHAVIOR_LOCAL_IDS_IN_BINDINGS
bool "Track in behavior bindings"
choice ZMK_BEHAVIOR_LOCAL_ID_TYPE
prompt "Local ID Type"
config ZMK_BEHAVIOR_LOCAL_ID_TYPE_SETTINGS_TABLE
bool "Settings Table"
depends on SETTINGS
select ZMK_BEHAVIOR_LOCAL_IDS_IN_BINDINGS
help
Use persistent entries in the settings subsystem to identify
behaviors by local ID, which uses the device name to generate
a new settings entry tying a presistant local ID to that name.
This guarantees stable, colllision-free local IDs at the expense
of settings storage used.
config ZMK_BEHAVIOR_LOCAL_ID_TYPE_CRC16
bool "CRC16 Hash"
select CRC
help
Use the CRC16-ANSI hash of behavior device names to generate
stable behavior local IDs. This saves on settings storage at
the expense of (highly unlikely) risk of collisions.
endchoice
endif
config ZMK_BEHAVIOR_HOLD_TAP
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_HOLD_TAP_ENABLED
if ZMK_BEHAVIOR_HOLD_TAP
config ZMK_BEHAVIOR_HOLD_TAP_MAX_HELD
int "Hold Tap Max Held"
default 10
help
Max number of simultaneously held hold-taps
config ZMK_BEHAVIOR_HOLD_TAP_MAX_CAPTURED_EVENTS
int "Hold Tap Max Captured Events"
default 40
help
Max number of captured system events while waiting to resolve hold taps
endif
config ZMK_BEHAVIOR_KEY_TOGGLE
bool
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_STICKY_KEY
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_STICKY_KEY_ENABLED
if ZMK_BEHAVIOR_STICKY_KEY
config ZMK_BEHAVIOR_STICKY_KEY_MAX_HELD
int "Sticky Key Max Held"
default 10
help
Max number of simultaneously held sticky keys
endif
config ZMK_BEHAVIOR_SOFT_OFF
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED && ZMK_PM_SOFT_OFF
config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool
default n
config ZMK_BEHAVIOR_SENSOR_ROTATE
bool
@ -23,6 +109,11 @@ config ZMK_BEHAVIOR_SENSOR_ROTATE_VAR
depends on DT_HAS_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR_ENABLED
select ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
config ZMK_BEHAVIOR_STUDIO_UNLOCK
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_STUDIO_UNLOCK_ENABLED && ZMK_STUDIO
config ZMK_BEHAVIOR_MACRO
bool
default y

View file

@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/
#include "usb_console.dtsi"
&xiao_serial { status = "disabled"; };

View file

@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/
#include "usb_console.dtsi"
&pro_micro_serial { status = "disabled"; };

View file

@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/
#include "usb_console.dtsi"
&xiao_serial { status = "disabled"; };

View file

@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_ADV360PRO_LEFT || BOARD_ADV360PRO_RIGHT

View file

@ -0,0 +1,12 @@
#
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
config BOARD_ADV360PRO_LEFT
bool "adv360pro_left"
depends on SOC_NRF52840_QIAA
config BOARD_ADV360PRO_RIGHT
bool "adv360pro_right"
depends on SOC_NRF52840_QIAA

View file

@ -0,0 +1,55 @@
#
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
if BOARD_ADV360PRO_LEFT
config ZMK_KEYBOARD_NAME
default "Adv360 Pro"
config ZMK_SPLIT_ROLE_CENTRAL
default y
endif # BOARD_ADV360PRO_LEFT
if BOARD_ADV360PRO_RIGHT
config ZMK_KEYBOARD_NAME
default "Adv360 Pro rt"
endif # BOARD_ADV360PRO_RIGHT
if BOARD_ADV360PRO_LEFT || BOARD_ADV360PRO_RIGHT
config BOARD
default "adv360pro"
config ZMK_SPLIT
default y
config SPI
bool
default y
config BT_CTLR
default BT
if USB
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
endif # USB
config ZMK_BATTERY_VOLTAGE_DIVIDER
default y
config SPI
default y
endif # BOARD_ADV360PRO_LEFT || BOARD_ADV360PRO_RIGHT

View file

@ -0,0 +1,7 @@
# Kinesis Advantage 360 Professional
This board definition provides upstream support for the [Kinesis Advantage 360 Professional](https://kinesis-ergo.com/keyboards/advantage360/)
Kinesis offer a specific [custom configuration](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/) for the 360 Pro that references [a customised version of ZMK](https://github.com/ReFil/zmk/tree/adv360-z3.2-2) with Advantage 360 Pro specific functionality and changes over base ZMK. The Kinesis fork is regularly updated to bring the latest updates and changes from base ZMK however will not always be completely up to date, some features such as new keycodes will not be immediately available on the 360 Pro after they are implemented in base ZMK.
When using this board definition some of the more advanced features (the indicator RGB leds) will not work, and Kinesis cannot provide customer service for usage of base ZMK. Likewise the ZMK community cannot provide support for either the Kinesis keymap editor, nor any usage of the Kinesis custom fork.

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 20)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 20)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
low-power-enable;
};
};
};

View file

@ -0,0 +1,155 @@
/*
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>
#include "adv360pro-pinctrl.dtsi"
/ {
model = "Adv360 Pro";
compatible = "kinesis,adv360pro";
chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,backlight = &backlight;
zmk,battery = &vbatt;
zmk,matrix-transform = &default_transform;
zmk,underglow = &led_strip;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <20>;
rows = <5>;
map = <
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,13) RC(4,14) RC(4,15) RC(4,16) RC(4,17) RC(4,18) RC(4,19)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,13) RC(3,14) RC(3,15) RC(3,16) RC(3,17) RC(3,18) RC(3,19)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) RC(2,14) RC(2,15) RC(2,16) RC(2,17) RC(2,18) RC(2,19)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,9) RC(1,10) RC(1,14) RC(1,15) RC(1,16) RC(1,17) RC(1,18) RC(1,19)
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,15) RC(0,16) RC(0,17) RC(0,18) RC(0,19)
>;
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 2>;
output-ohms = <100000>;
full-ohms = <(100000 + 100000)>;
};
backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {
pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>;
};
};
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&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>;
};
};
};
&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>;
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <3>; /* number of LEDs */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

View file

@ -0,0 +1,48 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/backlight.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2
>;
};
keypad {
bindings = <
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &mo 3 &kp N6 &kp KP_NUM &kp KP_EQUAL &kp KP_DIVIDE &kp KP_MULTIPLY &kp MINUS
&kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp BSLH
&kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER &kp RSHFT
&mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp KP_N0 &kp UP &kp DOWN &kp KP_DOT &kp RBKT &mo 2
>;
};
fn {
bindings = <
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &tog 1 &mo 3 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&trans &trans &trans &trans &trans &trans &none &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &none &trans &trans &trans &trans &none &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
mod {
bindings = <
&none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &trans &none &none &none &none &none &none
&none &none &none &none &none &none &bootloader &bootloader &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &bt BT_CLR &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &bl BL_TOG &rgb_ug RGB_TOG &bl BL_INC &bl BL_DEC &none &none &none
>;
};
};
};

View file

@ -0,0 +1,19 @@
identifier: adv360pro
name: Advantage 360 Pro
type: keyboard
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
- i2c
- counter
- spi
- usb_device
- nvs
- can
- kscan
- ble
- pwm

View file

@ -0,0 +1,16 @@
file_format: "1"
id: adv360pro
name: Advantage 360 Pro
type: board
url: https://kinesis-ergo.com/keyboards/advantage360
arch: arm
features:
- keys
- underglow
- backlight
outputs:
- usb
- ble
siblings:
- adv360pro_left
- adv360pro_right

View file

@ -0,0 +1,37 @@
/*
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/
#include "adv360pro.dtsi"
/{
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row";
row-gpios
= <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&gpio0 25 GPIO_ACTIVE_HIGH>
, <&gpio0 11 GPIO_ACTIVE_HIGH>
, <&gpio0 2 GPIO_ACTIVE_HIGH>
, <&gpio0 28 GPIO_ACTIVE_HIGH>
, <&gpio0 29 GPIO_ACTIVE_HIGH>
, <&gpio0 30 GPIO_ACTIVE_HIGH>
, <&gpio0 31 GPIO_ACTIVE_HIGH>
, <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio0 7 GPIO_ACTIVE_HIGH>
;
};
};

View file

@ -0,0 +1,55 @@
#
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_ADV360PRO_LEFT=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
# Enable SPI for LEDS
CONFIG_PINCTRL=y
CONFIG_SPI=y
CONFIG_SPI_NRFX=y
# Enable writing to flash
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
# Enable 32kHz crystal
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM=y
#RGB leds config
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=0
CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y
#Backlighting configuration
CONFIG_PWM=y
CONFIG_LED_PWM=y
CONFIG_ZMK_BACKLIGHT=y
CONFIG_ZMK_BACKLIGHT_BRT_START=20
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y
#Misc configuration
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_BLE=y

View file

@ -0,0 +1,41 @@
/*
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/
#include "adv360pro.dtsi"
/{
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row";
row-gpios
= <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 31 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 30 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 7 GPIO_ACTIVE_HIGH>
, <&gpio1 11 GPIO_ACTIVE_HIGH>
, <&gpio1 10 GPIO_ACTIVE_HIGH>
, <&gpio1 13 GPIO_ACTIVE_HIGH>
, <&gpio1 15 GPIO_ACTIVE_HIGH>
, <&gpio0 3 GPIO_ACTIVE_HIGH>
, <&gpio0 2 GPIO_ACTIVE_HIGH>
, <&gpio0 28 GPIO_ACTIVE_HIGH>
;
};
};
&default_transform {
col-offset = <10>;
};

View file

@ -0,0 +1,54 @@
#
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_ADV360PRO_RIGHT=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
# Enable SPI for LEDS
CONFIG_PINCTRL=y
CONFIG_SPI=y
CONFIG_SPI_NRFX=y
# Enable writing to flash
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
# Enable 32kHz crystal
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM=y
#RGB leds config
CONFIG_WS2812_STRIP=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=0
CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y
#Backlighting configuration
CONFIG_PWM=y
CONFIG_LED_PWM=y
CONFIG_ZMK_BACKLIGHT=y
CONFIG_ZMK_BACKLIGHT_BRT_START=20
CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y
#Misc configuration
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_ZMK_BLE=y

View file

@ -0,0 +1,9 @@
#
# Copyright (c) 2023 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)

View 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")

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

@ -16,14 +16,12 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
zmk,underglow = &led_strip;
};
kscan: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpiob 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
@ -40,26 +38,23 @@
left_encoder: encoder_left {
compatible = "alps,ec11";
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 {
compatible = "alps,ec11";
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 {
compatible = "alps,ec11";
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 +62,7 @@
compatible = "zmk,keymap-sensors";
status = "disabled";
sensors = <>;
triggers-per-rotation = <20>;
};
};
@ -77,7 +73,6 @@
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
@ -110,14 +105,13 @@
apb1-prescaler = <1>;
};
&usb {
zephyr_udc0: &usb {
status = "okay";
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
// Overridden to lower RAM usage.
num-bidir-endpoints = <4>;
};
&rtc {
@ -136,7 +130,6 @@
/* Set 6Kb of storage at the end of the 128Kb of flash */
storage_partition: partition@1e800 {
label = "storage";
reg = <0x0001e800 0x00001800>;
};
};

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: MIT
*/
#undef ZMK_BEHAVIORS_KEEP_ALL
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

View file

@ -5,9 +5,6 @@ CONFIG_SOC_STM32F072XB=y
# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# Floating Point Options
CONFIG_FPU=y
# enable GPIO
CONFIG_GPIO=y
@ -17,9 +14,9 @@ CONFIG_PINCTRL=y
# Poll to avoid interrupt overlap issues
CONFIG_ZMK_KSCAN_DIRECT_POLLING=y
# Needed to reduce this to size that will fit on F072
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_ISR_STACK_SIZE=1024
# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_ZMK_USB=y

View file

@ -0,0 +1,9 @@
file_format: "1"
id: blackpill_f401cc
name: BlackPill F401CC
type: board
arch: arm
outputs:
- usb
url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
exposes: [blackpill]

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

@ -53,5 +53,5 @@
pro_micro_d: &pro_micro {};
pro_micro_i2c: &i2c0 {};
pro_micro_spi: &spi0 {};
pro_micro_spi: &spi1 {};
pro_micro_serial: &uart0 {};

View file

@ -36,4 +36,21 @@
low-power-enable;
};
};
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
<NRF_PSEL(SPIM_MOSI, 0, 28)>,
<NRF_PSEL(SPIM_MISO, 0, 3)>;
};
};
spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
<NRF_PSEL(SPIM_MOSI, 0, 28)>,
<NRF_PSEL(SPIM_MISO, 0, 3)>;
low-power-enable;
};
};
};

View file

@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};
@ -25,20 +24,18 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
ext-power {
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
init-delay-ms = <20>;
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 7>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
@ -69,6 +66,13 @@
pinctrl-names = "default", "sleep";
};
&spi1 {
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
};
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
@ -77,12 +81,8 @@
pinctrl-names = "default", "sleep";
};
&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
@ -97,11 +97,9 @@
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
@ -115,12 +113,10 @@
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};

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

@ -1,5 +1,5 @@
# 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/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View 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")

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

@ -1,5 +1,5 @@
# 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/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -16,25 +16,24 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,matrix-transform = &default_transform;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
triggers-per-rotation = <20>;
};
left_encoder: encoder_left {
compatible = "alps,ec11";
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";
};
@ -43,13 +42,11 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
@ -72,24 +69,8 @@
status = "okay";
};
&i2c0 {
compatible = "nordic,nrf-twi";
sda-pin = <17>;
scl-pin = <20>;
};
&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <6>;
rx-pin = <8>;
};
&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
@ -104,11 +85,9 @@
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
@ -122,12 +101,10 @@
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};

View file

@ -11,7 +11,7 @@
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
};
ansi_transform: keymap_transform_0 {
@ -81,7 +81,8 @@
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
col-gpios

View file

@ -13,15 +13,15 @@
/ {
chosen {
#ifdef ANSI
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
#elif defined(HHKB)
zmk,matrix_transform = &hhkb_transform;
zmk,matrix-transform = &hhkb_transform;
#elif defined(ISO)
zmk,matrix_transform = &iso_transform;
zmk,matrix-transform = &iso_transform;
#elif defined(ALL_1U)
zmk,matrix_transform = &all_1u_transform;
zmk,matrix-transform = &all_1u_transform;
#else
zmk,matrix_transform = &split_transform;
zmk,matrix-transform = &split_transform;
#endif
};
@ -31,7 +31,7 @@
#ifdef ANSI
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |
@ -94,7 +94,7 @@
#elif defined(ISO)
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | # | ENTER |
// | SHIFT | | | Z | X | C | V | B | N | M | , | . | / | SHIFT |
@ -122,7 +122,7 @@
#elif defined(ALL_1U)
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT | UP | 1 |
@ -150,7 +150,7 @@
#else
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP| DEL |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BSPC| DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | 1 |

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

@ -11,7 +11,7 @@
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,matrix-transform = &default_transform;
};
default_transform: keymap_transform_0 {
@ -30,7 +30,8 @@
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
col-gpios

View file

@ -8,7 +8,7 @@
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |

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

@ -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")

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

@ -1,4 +1,5 @@
# 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)

View file

@ -13,7 +13,7 @@
compatible = "polarityworks,bt60_v2";
chosen {
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
};

View file

@ -12,13 +12,13 @@
/ {
chosen {
#ifdef ANSI
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
#elif defined(ISO)
zmk,matrix_transform = &iso_transform;
zmk,matrix-transform = &iso_transform;
#elif defined(ALL_1U)
zmk,matrix_transform = &all_1u_transform;
zmk,matrix-transform = &all_1u_transform;
#elif defined(HHKB)
zmk,matrix_transform = &hhkb_transform;
zmk,matrix-transform = &hhkb_transform;
#else
#error "Layout not defined, please define a layout by uncommenting the appropriate line in bt60_v2.keymap"
#endif
@ -29,7 +29,7 @@
#ifdef ANSI
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |
@ -65,7 +65,7 @@
#elif defined(ISO)
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | # | ENTER |
// | SHIFT | \ | Z | X | C | V | B | N | M | , | . | / | SHIFT |
@ -101,7 +101,7 @@
#elif defined(ALL_1U)
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP | DEL |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHFT |NONE| Z | X | C | V | B | N | M | , | . | / | SHFT | UP | 1 |
@ -118,7 +118,7 @@
};
raise {
// ------------------------------------------------------------------------------------------
// |GRAVE| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |BKSP | DEL |
// |GRAVE| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |BSPC | DEL |
// | TAB | Q | W | E | HUI | HUD | Y | U | INS | O |PSCRN| SLCK| P_B | RGB_TOG |
// | CAPS | A | S | D | BRI | BRD | H | J | K | L | HOME| PGUP| BOOT |
// | SHFT |NONE|VOLDN|VOLUP|MUTE|BLINC|BLDEC| N | M | , | END | PGDN | SHFT|BL_TOG| 1 |
@ -136,7 +136,7 @@
#elif defined(HHKB)
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |

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

@ -13,7 +13,7 @@
compatible = "polarityworks,bt65_v1";
chosen {
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
};

View file

@ -12,13 +12,13 @@
/ {
chosen {
#ifdef ANSI
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
#elif defined(ISO)
zmk,matrix_transform = &iso_transform;
zmk,matrix-transform = &iso_transform;
#elif defined(ALL_1U)
zmk,matrix_transform = &all_1u_transform;
zmk,matrix-transform = &all_1u_transform;
#elif defined(HHKB)
zmk,matrix_transform = &hhkb_transform;
zmk,matrix-transform = &hhkb_transform;
#else
#error "Layout not defined, please define a layout by uncommenting the appropriate line in bt65_v1.keymap"
#endif
@ -29,7 +29,7 @@
#ifdef ANSI
default_layer {
// ------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | INS |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | PGUP|
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PGDN|
@ -37,7 +37,7 @@
// ------------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BKSP &kp DEL
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp INS
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
@ -65,7 +65,7 @@
#elif defined(ISO)
default_layer {
// ------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | INS |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | # | ENTER | PGUP|
// |SHIFT | \ | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PGDN|
@ -73,7 +73,7 @@
// ------------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BKSP &kp DEL
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp INS
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp NON_US_HASH &kp RET &kp PG_UP
&kp LSHFT &kp NON_US_BSLH &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
@ -101,7 +101,7 @@
#elif defined(ALL_1U)
default_layer {
// -------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP | DEL | HOME|
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BSPC | DEL | HOME|
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | END |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | PGUP|
// |SHIFT|NONE | Z | X | C | V | B | N | M | , | . | / |SHIFT|NONE | UP | PGDN|
@ -136,7 +136,7 @@
#elif defined(HHKB)
default_layer {
// ------------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | HOME|
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | END |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | PGUP|
@ -144,7 +144,7 @@
// ------------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BKSP &kp DEL
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp HOME
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp END
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp PG_UP

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

@ -13,7 +13,7 @@
compatible = "polarityworks,bt75_v1";
chosen {
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
};

View file

@ -11,11 +11,11 @@
/ {
chosen {
#ifdef ANSI
zmk,matrix_transform = &ansi_transform;
zmk,matrix-transform = &ansi_transform;
#elif defined(ISO)
zmk,matrix_transform = &iso_transform;
zmk,matrix-transform = &iso_transform;
#elif defined(ALL_1U)
zmk,matrix_transform = &all_1u_transform;
zmk,matrix-transform = &all_1u_transform;
#else
#error "Layout not defined, please define a layout using by uncommenting the appropriate line in bt75_v1.keymap"
#endif
@ -27,7 +27,7 @@
default_layer {
// ------------------------------------------------------------------------------------------------
// | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F9 | F9 | F10 | F11 | F12 |PSCRN|HOME| END |
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL |
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | INS |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | PGUP|
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PGDN|
@ -35,7 +35,7 @@
// ------------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp PSCRN &kp HOME &kp END
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BKSP &kp DEL
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp INS
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
@ -66,7 +66,7 @@
default_layer {
// ------------------------------------------------------------------------------------------------
// | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F9 | F9 | F10 | F11 | F12 |PSCRN|HOME| END |
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | DEL |
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | DEL |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | INS |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | # | ENTER | PGUP|
// |SHIFT | \ | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PGDN|
@ -74,7 +74,7 @@
// ------------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp PSCRN &kp HOME &kp END
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BKSP &kp DEL
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp INS
&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp NON_US_HASH &kp RET &kp PG_UP
&kp LSHFT &kp NON_US_BSLH &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
@ -105,7 +105,7 @@
default_layer {
// -------------------------------------------------------------------------------------------------
// | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F9 | F9 | F10 | F11 | F12 |PSCRN| P_B | INS |
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BKSP | DEL | HOME|
// |GRAVE| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |BSPC | DEL | HOME|
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | END |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | PGUP|
// |SHIFT|NONE | Z | X | C | V | B | N | M | , | . | / |SHIFT|NONE | UP | PGDN|

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,14 +26,16 @@
zmk,battery = &vbatt;
};
sensors {
sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&encoder_1>;
triggers-per-rotation = <20>;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
col-gpios
@ -65,42 +67,38 @@
;
};
ext-power {
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
label = "EXT_POWER";
control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
};
encoder_1: encoder_1 {
compatible = "alps,ec11";
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";
};
encoder_2: encoder_2 {
compatible = "alps,ec11";
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";
};
encoder_3: encoder_3 {
compatible = "alps,ec11";
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";
};
backlight: pwmleds {
compatible = "pwm-leds";
label = "Backlight LEDs";
pwm_led_0 {
pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>;
};
@ -110,13 +108,11 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VBATT";
io-channels = <&adc 2>;
output-ohms = <100000>;
full-ohms = <(100000 + 100000)>;
@ -146,7 +142,7 @@
status = "okay";
};
&usbd {
zephyr_udc0: &usbd {
status = "okay";
};
@ -162,11 +158,9 @@
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
@ -180,12 +174,10 @@
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
@ -200,7 +192,6 @@
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>;

View 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")

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
@ -63,6 +57,13 @@ config IL0323
config ZMK_DISPLAY_BLANK_ON_IDLE
default n
# Needed for the IL0323 driver which allocs memory to clear the display
config HEAP_MEM_POOL_SIZE
default 1024
config LV_Z_MEM_POOL_SIZE
default 4096
endif # ZMK_DISPLAY
menuconfig CUSTOM_WIDGET_BATTERY_STATUS

View file

@ -1,5 +1,5 @@
# 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/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -20,8 +20,7 @@
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,display = &epd;
zephyr,console = &cdc_acm_uart;
zmk,matrix_transform = &default_transform;
zmk,matrix-transform = &default_transform;
};
default_transform: keymap_transform_0 {
@ -76,12 +75,8 @@
status = "okay";
};
&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {
@ -95,11 +90,9 @@
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
@ -113,12 +106,10 @@
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};

View file

@ -11,8 +11,8 @@
/ {
chosen {
zmk,matrix_transform = &default_transform;
// zmk,matrix_transform = &five_column_transform;
zmk,matrix-transform = &default_transform;
// zmk,matrix-transform = &five_column_transform;
};
};
@ -21,9 +21,9 @@
compatible = "zmk,keymap";
default_layer {
label = "QWERTY";
display-name = "QWERTY";
// --------------------------------------------------------------------------------
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP |
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BSPC |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHFT | Z | X | C | V | B | | N | M | , | . | / | ESC |
// | GUI | LWR | SPC | | ENT | RSE | ALT |
@ -36,9 +36,9 @@
};
lower_layer {
label = "NUMBER";
display-name = "NUMBER";
// -----------------------------------------------------------------------------------------
// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BSPC |
// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | |
// | SHFT | | | | | | | | | | | | |
// | GUI | | SPC | | ENT | | ALT |
@ -51,16 +51,16 @@
};
raise_layer {
label = "SYMBOL";
display-name = "SYMBOL";
// -----------------------------------------------------------------------------------------
// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP |
// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BSPC |
// | CTRL | | | | | | | - | = | [ | ] | \ | ` |
// | SHFT | | | | | | | _ | + | { | } | "|" | ~ |
// | GUI | | SPC | | ENT | | ALT |
bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
>;
};

View file

@ -15,7 +15,7 @@
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
row-gpios
@ -39,7 +39,6 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
};
@ -88,9 +87,8 @@
fuelgauge: bq274xx@55 {
compatible = "ti,bq274xx";
label = "BATTERY";
reg = <0x55>;
design-voltage = <3700>; //Battery Design Volatge in mV
design-voltage = <3700>; //Battery Design Voltage in mV
design-capacity = <180>; //Battery Design Capacity in mAh
taper-current = <2>; //Battery Taper current in mAh
terminate-voltage = <2750>; //Battery Terminate Voltage in mV
@ -109,7 +107,6 @@
epd: il0323@0 {
compatible = "gooddisplay,il0323";
reg = <0>;
label = "DISPLAY";
width = <80>;
height = <128>;
spi-max-frequency = <4000000>;

View file

@ -39,9 +39,12 @@ 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
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145

View file

@ -15,7 +15,7 @@
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
row-gpios
@ -39,7 +39,6 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
};
@ -96,9 +95,8 @@
fuelgauge: bq274xx@55 {
compatible = "ti,bq274xx";
label = "BATTERY";
reg = <0x55>;
design-voltage = <3700>; //Battery Design Volatge in mV
design-voltage = <3700>; //Battery Design Voltage in mV
design-capacity = <180>; //Battery Design Capacity in mAh
taper-current = <2>; //Battery Taper current in mAh 2.1
terminate-voltage = <2750>; //Battery Terminate Voltage in mV
@ -117,7 +115,6 @@
epd: il0323@0 {
compatible = "gooddisplay,il0323";
reg = <0>;
label = "DISPLAY";
width = <80>;
height = <128>;
spi-max-frequency = <4000000>;

View file

@ -39,9 +39,12 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=n
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145

View file

@ -15,7 +15,7 @@
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
row-gpios
@ -39,13 +39,11 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 0>;
output-ohms = <1960000>;
full-ohms = <(1960000 + 810000)>;
@ -83,7 +81,6 @@
epd: il0323@0 {
compatible = "gooddisplay,il0323";
reg = <0>;
label = "DISPLAY";
width = <80>;
height = <128>;
spi-max-frequency = <4000000>;

View file

@ -35,9 +35,12 @@ 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
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145

View file

@ -15,7 +15,7 @@
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
wakeup-source;
diode-direction = "col2row";
row-gpios
@ -39,13 +39,11 @@
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
io-channels = <&adc 0>;
output-ohms = <1960000>;
full-ohms = <(1960000 + 810000)>;
@ -90,7 +88,6 @@
epd: il0323@0 {
compatible = "gooddisplay,il0323";
reg = <0>;
label = "DISPLAY";
width = <80>;
height = <128>;
spi-max-frequency = <4000000>;

View file

@ -35,9 +35,12 @@ CONFIG_FLASH_MAP=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM=y
CONFIG_ZMK_USB=n
CONFIG_ZMK_BLE=y
# enable display drivers
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_DPI_DEF=145

View 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")

View file

@ -6,12 +6,12 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/display.h>
#include <zmk/battery.h>
#include "battery_status.h"
#include <zmk/usb.h>
#include <zmk/events/usb_conn_state_changed.h>
@ -66,8 +66,10 @@ void battery_status_update_cb(struct battery_status_state state) {
}
static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) {
const struct zmk_battery_state_changed *ev = as_zmk_battery_state_changed(eh);
return (struct battery_status_state) {
.level = bt_bas_get_battery_level(),
.level = (ev != NULL) ? ev->state_of_charge : zmk_battery_state_of_charge(),
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
.usb_present = zmk_usb_is_powered(),
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */

View file

@ -45,7 +45,7 @@ static void layer_status_update_cb(struct layer_status_state state) {
static struct layer_status_state layer_status_get_state(const zmk_event_t *eh) {
uint8_t index = zmk_keymap_highest_layer_active();
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_label(index)};
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_name(index)};
}
ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, layer_status_update_cb,

View file

@ -6,7 +6,6 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);

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

@ -16,9 +16,8 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,matrix-transform = &default_transform;
};
default_transform: keymap_transform_0 {
@ -36,7 +35,6 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
@ -66,12 +64,8 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(
};
&usb {
zephyr_udc0: &usb {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
&flash0 {
@ -86,7 +80,6 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(
/* Set 6Kb of storage at the end of the 256Kb of flash */
storage_partition: partition@3e800 {
label = "storage";
reg = <0x0003e800 0x00001800>;
};
};

View file

@ -7,7 +7,7 @@
default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP |
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | SHIFT(/) | ^ | DEL |

View file

@ -5,9 +5,6 @@ CONFIG_SOC_STM32F303XC=y
# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
# enable pinmux
CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y
@ -25,3 +22,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

@ -10,6 +10,12 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include <layouts/cuddlykeyboards/ferris.dtsi>
&cuddlykeyboards_ferris_layout {
transform = <&transform>;
};
/ {
model = "Ferris rev0.2";
compatible = "ferris,rev02", "st,stm32f072";
@ -17,9 +23,7 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
zmk,matrix_transform = &transform;
/* TODO: Enable once we support the IC for underglow
zmk,underglow = &led_strip;
*/
@ -40,7 +44,6 @@
kscan: kscan {
compatible = "zmk,kscan-composite";
label = "KSCAN";
rows = <4>;
columns = <10>;
@ -56,7 +59,6 @@
kscan_left: kscan_left {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN_LEFT";
diode-direction = "col2row";
@ -77,7 +79,6 @@
kscan_right: kscan_right {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN_RIGHT";
diode-direction = "row2col";
@ -113,18 +114,24 @@
};
};
&usb {
zephyr_udc0: &usb {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
// Overridden to lower RAM usage.
num-bidir-endpoints = <4>;
};
&clk_hsi {
status = "okay";
};
&clk_hsi48 {
status = "okay";
};
&pll {
prediv = <1>;
mul = <6>;
@ -156,7 +163,6 @@
/* Set 6Kb of storage at the end of the 128Kb of flash */
storage_partition: partition@3e800 {
label = "storage";
reg = <0x0001e800 0x00001800>;
};
};

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: MIT
*/
#undef ZMK_BEHAVIORS_KEEP_ALL
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
@ -14,15 +16,14 @@
#define SYM_L 4
// Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace
&lt { quick_tap_ms = <200>; };
&lt { quick-tap-ms = <200>; };
/ {
behaviors {
hm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
label = "homerow mods";
#binding-cells = <2>;
tapping_term_ms = <200>;
tapping-term-ms = <200>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
@ -34,16 +35,16 @@
default_layer {
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&hm LGUI A &hm LALT S &hm LCTRL D &hm LSHFT F &kp G &kp H &hm RSHFT J &hm RCTRL K &hm LALT L &hm LGUI QUOT
&hm LGUI A &hm LALT S &hm LCTRL D &hm LSHFT F &kp G &kp H &hm RSHFT J &hm RCTRL K &hm LALT L &hm LGUI SQT
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
&lt NAV_L TAB &kp ENTER &lt NUM_L SPACE &lt SYM_L BKSP
&lt NAV_L TAB &kp ENTER &lt NUM_L SPACE &lt SYM_L BSPC
>;
};
nav_layer {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp LARW &kp DARW &kp UARW &kp RARW
&trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT
&trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END
&trans &trans &kp ESC &kp DEL
>;

View file

@ -6,7 +6,7 @@ CONFIG_SOC_STM32F072XB=y
# 48MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
# enable PINMUX
# enable PINCTRL
CONFIG_PINCTRL=y
# enable GPIO

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

View file

@ -0,0 +1,99 @@
/*
* 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;
};
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";
wakeup-source;
diode-direction = "col2row";
debounce-press-ms = <4>;
debounce-release-ms = <20>;
};
};
&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>;
};
};
};

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

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