Commit Graph

1520 Commits

Author SHA1 Message Date
Peter Johanson 8ed556df62 chore(studio): Only clear settings for overridden key positions. 2024-10-21 14:53:31 -06:00
Peter Johanson 369a009d99 chore(shields): Add studio feature to qaz metadata 2024-10-21 10:08:51 -06:00
Zack Forbing 200d98f623
feat(shields): QAZ: added three physical layouts
* added three physical layouts

---------

Co-authored-by: Zack Forbing <zforbing@vertafore.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-10-21 11:53:06 -04:00
Peter Johanson ea1a09bf99 fix: Optimize layout changes by doing runtime mapping
* To avoid tons of migration, extra flash writes, etc, we keep
  the keymaps and settings using a key position index that's tied
  to the stock layout, and at runtime mapping key positions as
  needed.
2024-10-18 15:30:13 -06:00
Peter Johanson 10868c72f7 chore: Tag studio enabled boards/shields. 2024-10-17 10:20:30 -06:00
honorless 7dfc6ab31d refactor(shields): MurphPad
* Added matrix transforms and physical layouts for three typical
  configurations.

* Tweaked default keymap to be more immediately useful for ZMK and more
  closely resemble the default keymaps of non-ZMK firmware.

* Board-specific Kconfig settings migrated to main shield file, so they
  will be exposed to end-users through the setup script.

* Tidied formatting and shortened overlong layer labels.

* Aligned encoder configuration with current standards.

* Corrected default number of RGB LEDs.

* Enabled OLED by default in a less authoritarian way.
2024-10-16 18:21:40 -06:00
Alexander Krikun 11537ebee6 feat(shields): add physical layouts and update keymap for Jiran
Add physical layouts and update the keymap for Ladniy's Jiran.
Layouts are added for all three possible transforms:
- Full (with additional pinky key and number row)
- Jian (with additional pinky key), re-uses Jian layout
- 6 column (Corne), re-uses Jian layout

Keymap update includes &studio_unlock.
2024-10-16 17:04:39 -06:00
Alexander Krikun 218a2fff8d feat(shields): add physical layouts and update keymap for Jian
Add physical layouts and update the keymap for King of Hedgehogs' Jian.
Layouts are added for all three possible transforms:
- Full (with additional pinky key)
- 6 column (Corne)
- 5 column (Minidox)

The layouts are added to be re-usable for the Jiran and other custom boards/shields.

Keymap update includes, small guide clarifications, output selection,
tri-layer and &studio_unlock.
2024-10-16 17:04:39 -06:00
Alexander Krikun bbe4f64bb2 feat(shields): add physical layouts and update keymap for Jorne
Add physical layouts and update the keymap for Joric's Jorne.
Layouts are added for all three possible transforms:
- Full (with additional pinky key)
- 6 column (Corne), re-uses Corne layout
- 5 column (Minidox), re-uses Corne layout

Keymap update includes quick-tap-ms (essential for this keymap), small
guide clarifications, output selection, tri-layer and &studio_unlock.
2024-10-16 17:04:39 -06:00
angweekiat 0adb80c02b
fix(usb): detect USB power mode to fallback to BLE
* Add tracking to see if we ever hit a configured status before
  suspend, so we can properly track "is connected" even when
  connected to a suspended/asleep host.
2024-10-14 19:15:45 -04:00
Pete Johanson d3f2895744
refactor: Give position map children labels. (#2544)
* To make is easier to reuse layouts and override the position
  maps for them, add labels to all the position map children in our
  shared layouts.
2024-10-10 13:03:32 -04:00
Pete Johanson dab4b2cdf3
fix(studio): Reduce stack usage. (#2547)
* Imply nanopb setting for reduced stack usage.
2024-10-10 12:49:51 -04:00
Pete Johanson 78513af73e
feat(studio): Move to nanopb with minor optimizations. (#2505)
* Reduced stack size.
2024-10-10 12:36:27 -04:00
Allister MacLeod 4aea919a4d
fix(display): Adding length check to layer_label in nice_view status widget. 2024-10-08 12:27:01 -04:00
Peter Johanson 47a17c64d7 fix: Defer auto enabling of kscan sideband.
* Now that device init of kscan sideband is in POST_KERNEL stage,
  use a separate SYS_INIT for auto enabling the device so processing
  of early/initial presses from referenced toggle mode kscan devices
  occurs at the proper time during init.
2024-10-08 10:20:39 -06:00
Peter Johanson 29b39f2b9f feat: A few enhancements to our RPC messages.
* More fine grained status reporting when saving changes. Needed to we
  can notify the client if we've got errors saving settings due to
  running out of space, etc.
* Return the max layer name lenght in the keymap payload, for the UI to
  leverage.
2024-10-03 15:10:58 -06:00
Nicolas Munnich c05aed2f19 fix(boards): Corneish-zen physical layout 2024-10-03 08:57:18 -06:00
Joel Spadin 60a8f29340 feat(boards)!: refactor Corne layouts
Split up the Corne layout files to match the previous commit.
2024-10-02 18:48:18 -06:00
Joel Spadin 36f146226e feat(boards)!: refactor common layouts
Removed the combined .dtsi file for each group of common layouts, and
split the position map across the files in each group. This makes
reading the position maps slightly more difficult, but it aligns the
common layouts with the keyboard-specific ones such as
foostan/corne.dtsi in that simply including each header adds the
layout, with no need to set status = "okay".
2024-10-02 18:48:18 -06:00
Peter Johanson 73ca365530 feat(boards): PM RP2040 flash settings support. 2024-10-01 01:57:08 -06:00
Peter Johanson ce04352e2f feat: Add reviung41 physical layout. 2024-09-30 12:00:21 -06:00
Peter Johanson 8c21e7766d feat: Add physical layout to BDN9 rev2. 2024-09-30 12:00:21 -06:00
Peter Johanson 7276fd525f feat: Build asserts for requires studio layout bits.
* When building with ZMK Studio, assert that we have physical layouts,
  and those layouts have key information set.
2024-09-30 12:00:21 -06:00
Cem Aksoylar 59c82ef27a refactor(shields): Use space not hyphen for layout names 2024-09-30 11:30:10 -06:00
Cem Aksoylar 608b6458a9 feat(boards): Add physical layout to Corne-ish Zen 2024-09-30 11:30:10 -06:00
Cem Aksoylar 907b1caaa6 refactor(shields): Add physical layout chosen nodes for consistency 2024-09-30 11:30:10 -06:00
Cem Aksoylar 552d665f58 feat(boards): Add glove80 and adv360pro layouts 2024-09-30 11:30:10 -06:00
Cem Aksoylar dafdc44b22 feat(shields): Use new shared layouts 2024-09-30 11:30:10 -06:00
Cem Aksoylar f618871f53 feat(shields): Add more shared layouts 2024-09-30 11:30:10 -06:00
ReFil e68abe57d8 feat(shields): Shield physical layouts 2024-09-26 11:53:24 -06:00
ReFil e80b1584de feat(boards): Preonic physical layout 2024-09-26 11:53:24 -06:00
ReFil 91e1a7cfef feat(boards): Planck physical layout 2024-09-26 11:53:24 -06:00
ReFil 026be009a6 feat(boards): CKP physical layout 2024-09-26 11:53:24 -06:00
ReFil a8f7888f4d feat(boards): BT60 V1 Physical Layout 2024-09-26 11:53:24 -06:00
ReFil a47f1fe2e1 feat(boards): nice!60 physical layout 2024-09-26 11:53:24 -06:00
ReFil ec32c566ce feat(boards): Tofu65 V2 Physical layout 2024-09-26 11:53:24 -06:00
ReFil 0a25fa2f95 feat(boards): add common keyboard layouts 2024-09-26 11:53:24 -06:00
Peter Johanson 4a8ceba0db chore: Fix keymap const warning. 2024-09-25 20:23:19 -06:00
Peter Johanson 5d4b6df6a7 feat(studio): Log entry into all RPC. 2024-09-25 17:46:50 -06:00
Peter Johanson 21e1b2acad feat: Add RPC thread analysis support. 2024-09-25 17:46:50 -06:00
ReFil 17f0a4d307
feat(ble): Set device name at runtime
This allows for the device name to be set at runtime, possible uses for this include a custom display screen that lets you type it in using the keycode state event, future configuration in zmk studio, or altering it per profile as per #1169
2024-09-25 15:35:42 -04:00
ReFil 58dcf5c285
feat(power): Support multiple ext_power GPIOS 2024-09-25 15:30:45 -04:00
Peter Johanson 33e3b02ddb feat: Split physical layout selection sync.
* Ensure the split peripherals have the same selected physical
  layout on connection and change.
2024-09-23 15:12:22 -06:00
Peter Johanson f992352936 chore: Formatting fix. 2024-09-23 10:31:43 -06:00
Cem Aksoylar fb18a4d871 refactor: Condition source props on CONFIG_ZMK_SPLIT 2024-09-23 10:17:29 -06:00
Cem Aksoylar b249135742 feat(sensors): Make sensors always trigger on central (for now) 2024-09-23 10:17:29 -06:00
Cem Aksoylar 4fdfb01b6a feat(split): Make combos invoke behaviors with locality
TODO: Currently the source is hardcoded to central for source local behaviors
2024-09-23 10:17:29 -06:00
Cem Aksoylar 9e36ebd525 feat(split): Make locality work nested behavior invocations
Co-authored-by: Tokazio <tokazio@hotmail.com>
2024-09-23 10:17:29 -06:00
Peter Johanson 11f600d9e5 fix(display): Check layer name length too. 2024-09-20 22:59:44 -06:00
Peter Johanson cca637d66e fix: Properly calculate highest active layer for display. 2024-09-20 22:59:44 -06:00
Peter Johanson de38676afd fix(core): Warn only with layouts + chosen transform
* Instead of erroring out, simply ignore physical layouts if we
  detect a chosen matrix transform, and warn instead.
2024-09-19 13:12:17 -06:00
Peter Johanson 1baf18d671 chore: Better errno formatting in logs. 2024-09-19 01:15:13 -06:00
Peter Johanson 6ae07d222a feat: Bit of extra studio keymap logging. 2024-09-18 13:08:35 -06:00
XiNGRZ 62900c62be fix(studio): Ensure null-termination of layer name read from settings
This fixes the string leak when a layer name is changed to a longer one,
but is discarded and reverted to the original shorter one from ZMK Studio.
2024-09-18 10:53:23 -06:00
Andrew Kannan c8c8835a19 fix(studio): Update position map querying 2024-09-17 23:29:08 -06:00
Peter Johanson a9167b2275 fix: Reduce RAM usage in the keymap
* When not building with runtime keymap support, make the keymap
  const.
2024-09-16 23:20:14 -06:00
Peter Johanson 32d0a4bf41 fix: Fix wakeup from kscan wrapped in sideband.
* If using a sideband kscan device to wrap a native kscan device,
  ensure the inner kscan device is also wakeup enabled to it can
  be waken from a deep sleep state by key press.
2024-09-16 15:17:26 -06:00
Abe Nonym 92745903c9
fix(ble): Properly compile with clear bonds on start 2024-09-16 12:06:34 -04:00
Maxime Vincent 67d595f29f pre-commit: re-format using clang-format hook (v18.1.8) 2024-09-13 16:04:26 -06:00
Peter Johanson 6b4d591c37 fix(bt): Fix compilation failure for clearing bonds.
* Refactor broke the build when clearing bonds on start.
2024-09-09 11:26:53 -06:00
Pete Johanson d52bb04090 Revert "feat: Split physical layout selection sync."
This reverts commit 03b5b38bc4.
2024-09-07 00:22:01 -06: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
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 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
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
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
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
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
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
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 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 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
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
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
Horu 7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -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
Xudong Zheng 849eca7228 refactor(underglow): fix uninitialized variable warning 2024-04-09 15:57:34 -07:00
Tobias Arndt fe509c466f fix(kscan): Enable charlieplex interrupts for single compatible device
Fixes #2201
2024-03-30 19:13:39 -07: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
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
Peter Johanson bb94a7aafe fix: Fixes for building soft off without deep sleep. 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
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
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