Commit Graph

2328 Commits

Author SHA1 Message Date
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