* 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.
* 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.
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.
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.
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.
* 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.
* 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.
* 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.
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".
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
* 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.
* 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.
* 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.
* 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.
* 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.
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>
* 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>
* 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.
* 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
* 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.
* 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.
* 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.
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)
* 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.
* 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>
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
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
* 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.
* 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.
* 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.
* 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.
* 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.
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>
* 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.