Commit Graph

1313 Commits

Author SHA1 Message Date
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
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
Xudong Zheng
4a5806ac73 feat(core): enable FPU if CPU has FPU 2024-01-29 17:54:34 -08: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
honorless
6b547019c2 refactor: use zmk,matrix-transform instead of zmk,matrix_transform
* Align codebase with documentation.
2024-01-23 23:02:35 -06:00
Peter Johanson
f71458aca0 fix(shields): Fix battery warnings for custom widgets. 2024-01-16 16:39:28 -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
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
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
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
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
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
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
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
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
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
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
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
Peter Johanson
55aed8e89d feat(tests): Add ability to auto-accept test diff. 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
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
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
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
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
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
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
Diogo Doreto
6af22424f1 feat(shields): add right encoders support to waterfowl 2023-10-09 11:46:05 -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
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
Andrew Rae
11996ff7f0 refactor(behaviors): Final global-quick-tap deprecation. 2023-10-03 01:12:47 -07:00
Andrew Rae
f0f6d61e79 fix(tests): Updating old tests includes 2023-10-03 01:12:47 -07:00
Andrew Rae
b85ffa4b6c refactor(behaviors): global-quick-tap -> require-prior-idle
Renaming global-quick-tap-ms to require-prior-idle.
2023-10-03 01:12:47 -07:00
Andrew Rae
77eb44ba9b feat(behaviors): Adding global-quick-tap-ms for combos
This brings the 'global-quick-tap' functionality to combos by filtering
out candidate combos that fell within their own quick tap term.

I also replaced `return 0` with `return ZMK_EV_EVENT_BUBBLE` where appropriate.
(I assume this was done in past as it is similar to errno returning, but
being that this is to signify an event type I find this more clear)
2023-10-03 01:12:47 -07:00
Andrew Rae
2f6abff3bc refactor(behaviors): Giving global-quick-tap its own term
Detaching the global-quick-tap functionality from the quick-tap term.
This makes way for two improvements:

1. This functionality can be added to combos under a unified name
   'global-quick-tap-ms'.

2. This allows users to set a lower term for the 'global-quick-tap'
   (typically ~100ms), and a higher term for the regular
   quick-tap (typically ~200ms)

This deprecates the global-quick-tap option, however if it is set, the
quick-tap-ms value will be copied to global-quick-tap-ms.
2023-10-03 01:12:47 -07:00
Flo Kempenich
aa4cb143bf
fix(combos)Fix bug with overlapping combos timeouts (#1945)
* Fix bug with overlapping combos timeouts

* Fix trailing whitespace

* Fix log format
2023-10-03 04:03:59 -04:00
Joel Spadin
6a3cc914fc fix: Fix nice_view display widgets 2023-10-02 22:03:08 -07:00
Joel Spadin
b17d896c5c fix: Address review comments 2023-10-02 22:03:08 -07:00
Joel Spadin
651ed05e9a refactor: Split endpoint to transport and instance
Changed the endpoints code to rename the existing endpoint types to
"transport" and add the concept of "endpoint instances". A transport is
the method by which data is sent, while instances allow describing
multiple endpoints that use the same transport (e.g. bluetooth profiles)

Also added new APIs to get the total number of possible endpoint
instances and assign each instance a unique index, which can be used
for tracking separate state for each endpoint in other code files.
2023-10-02 22:03:08 -07:00
Andrew Rae
2f05ad55ca fix(core): Prevent pre-releasing explicit mods. 2023-10-02 12:28:02 -07:00
Andrew Rae
dffdb2365e test(core): Adding coverage for key pre-releasing.
Added cases for the two use cases I know of:
    1. Rolling with key-repeat behavior
    2. Rolling symbols that have the same base key, eg `+=`
2023-10-02 12:28:02 -07:00
Andrew Rae
933e369d7c feat(core): Adding pre-release for keys that were already pressed.
This fixes #1207 and #1076 (and maybe more?).
2023-10-02 12:28:02 -07:00
ReFil
c1ebadcd2a
feat(hid): Add apple globe keycode
* feat(hid): Add apple globe keycode
* Update docs/src/data/hid.js

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
Co-authored-by: Nick Coutsos <nick@coutsos.com>
2023-09-29 13:14:31 -07:00
zhiayang
9b3d2cb99f
fix(driver): Fix broken compilation for MAX7318 driver 2023-09-28 12:19:14 -04:00
ClicketySplit
07c82836e0
fix(shields): Leeloo-Micro set status disabled for encoders. 2023-09-28 11:54:08 -04:00
zhiayang
8abc449cc2
feat(drivers): add driver for MAX17048 fuel gauge
Add driver for MAX17048 fuel gauge for battery reporting.
2023-09-25 21:04:03 -04:00
Peter Johanson
28ce23d489 chore(tests): Move to proper header name. 2023-09-16 11:52:40 -07:00
Peter Johanson
0ca7f69b6d refactor: Promote debounce to exposed mod lib.
* Promote previously local debounce code from kscan drivers to exposed
  module lib, for use with other drivers as needed.
* Refactor existing kscan driver to new "public" API.
2023-09-16 11:52:40 -07:00
Peter Johanson
c28ef1b61e refactor(drivers): Use proper init stage/priority.
* Avoid APPLICATION stage and use the proper earlier stage for
  kscan drivers.
2023-09-16 11:52:40 -07:00
Peter Johanson
690bc1bb44 refactor: Move drivers into properly module.
* Align our driver module layout to properly match Zephyr conventions,
  allowing proper CMake setup to amend the library for each type of driver.
2023-09-16 11:52:40 -07:00
Cem Aksoylar
7f9e9f8c64 fix(boards): Disable QSPI for Xiao BLE
The GD25Q16 flash connected via QSPI seems to be causing issues
with excessive battery use and inability to sleep. Since ZMK doesn't
use it, disable it.

Resolves #1901
2023-09-05 22:40:25 -07:00
Peter Johanson
718500543b feat(split): Use directed advertising.
* Split centrals to scan with their identity so they receive direct
  advertising packets.
* Split peripherals to use direct advertising if they have an existing
  bond to a split central.
2023-09-04 13:54:07 -07:00
Peter Johanson
647945d9f8 feat(shields): Add splitkb.com Aurora Helix
* Add new shield for splitkb.com Aurora Helix, supporting
  keys, encoder(s), displays, and RGB.
2023-09-03 22:39:10 -07:00
フィルターペーパー
ac0691471f feat(shields): Add Bluetooth bindings to kyria keymaps
Bluetooth bindings are useful for handling pairings with hosts. This
change adds the header and a few default commands as template for
new users to work with.
2023-09-02 23:08:17 -07:00
Xudong Zheng
544612c8c0 fix(split): reserve peripheral slot before stopping scanning
In the event that the peripheral MAC address does not match, this allows
scanning to continue.
2023-09-02 23:06:41 -07:00
Mikhail Stralenia
185457bc11
fix(shields): leeloo - proper encoder status for split encoders. 2023-08-29 08:53:30 -07:00
Peter Johanson
a92a4967aa fix(sensors): Only accept data once per behavior.
* Don't accept data for the same behavior on multiple layers more than
  once, to avoid duplicate/extraneous triggers.
2023-08-27 19:52:03 -07:00
Stephen Wan
9d44229800 feature(split): add support for sensors from peripheral
This commit adds a new GATT characteristics on the peripheral side
and wires it up to read sensor values. The central side subscribes
to this new characteristics and replays sensor values on its side.

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2023-08-27 19:52:03 -07:00
Xudong Zheng
e65a7e3075 fix(battery): change nRF52 ADC gain
With ADC pin, maximum 3.6V input needs gain 1/6 to be less than the 0.6V
reference.

With VDDHDIV5, maximum 6V input corresponds to 1.2V so gain 1/2 will be less
than the 0.6V reference and be slightly more precise.
2023-07-29 23:04:35 -07:00
Xudong Zheng
cb9c573b53 refactor(underglow): turn underglow off in low priority work queue 2023-07-24 17:04:51 -07:00
Xudong Zheng
9a963abfc8 refactor: use low priority workqueue for underglow and battery reporting
Blocking operations on the high priority system workqueue may result in
deadlocks, particularly when Bluetooth is in use.
2023-07-24 17:04:51 -07:00
Peter Johanson
f743d57ff1 feat(shields): Add splitkb.com Aurora Sofle
* Add new shield for splitkb.com Aurora Sofle, supporting
  keys, encoder(s), displays, and RGB.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-07-22 23:16:49 -07:00
Peter Johanson
147f7f23dc fix(shields): Make settings_reset more flexible.
* Don't reference `pro_micro` nexus node in settings_reset
  so it can be used with other controllers.
* Use mock kscan node instead.
2023-07-21 10:41:23 -07:00
Peter Johanson
5f6a13413b fix(bluetooth): Split improvements
* Proper usage of bt_uuid_cmp.
* Central's don't start scanning for peripherals if
  `ZMK_BLE_CLEAR_BONDS_ON_START` is enabled.
* Split peripherals don't advertize if
  `ZMK_BLE_CLEAR_BONDS_ON_START` is enabled.
2023-07-21 10:41:23 -07:00
Peter Johanson
54c2e8e155 feat: Add more logging to peripheral settings. 2023-07-21 10:41:23 -07:00
Peter Johanson
ed400c4feb fix(bluetooth): Corrected use of bt_addr_le_cmp
* Properly compare to zero when comparing LE addresses.
2023-07-21 10:41:23 -07:00
Peter Johanson
73e1b526d5 fix(bluetooth): Properly clear peripheral slots
* When the clear bonds Kconfig is set, also clear peripheral
  address slots addresses from settings as well.
2023-07-21 10:41:23 -07:00
Cem Aksoylar
ee1e135104
fix: Proper battery sensor Kconfig dependencies.
Properly make the battery sensor Kconfig symbols depend
on `SENSOR` config, and minor battery reporting Kconfig
symbol dependency fix.
2023-07-19 02:21:09 -04:00
Nick Winans
51a4be8935 fix(displays): Don't enable built-in widget configs by default 2023-07-19 00:13:16 -06:00
Nick Winans
18a2b76bf0 feat(nice!view): Custom widgets 2023-07-19 00:13:16 -06:00
ClicketySplit
aaf9958d86
feat(boards): Leeloo v2 and V2 Zephyr 3.2 fixes
* Add Leeloo v2
* Leeloo-Micro v1 updates to support Zephyr 3.2
* Refactored for new Encoder Configuration

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-07-17 17:26:27 -04:00
Kyle McCreery
3772ecb04e
fix(boards): Update pillbug_defconfig to enable pinctrl 2023-07-05 10:50:19 -06:00
Peter Johanson
b259d5a22e fix(sensors): Sensor rotate behavior fix for layers.
* Properly return transparent value when processing mode
  for higher disabled layers means the processing is ignored.
2023-06-20 17:36:37 -06:00
Peter Johanson
805dd4a53b feat(behaviors): Support parameterized macros.
* Add two new compatibles for macros that
  take one or two parameters when bound in
  a keymap.
* Use `&macro_param_1to1`, `&macro_param_1to2`, `&macro_param_2to1`,
  and `&macro_param_2to2` control entries in the bindings for the macro
  to have the next binding entry have it's values substituted.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-06-20 11:19:28 -06:00
Xudong Zheng
e686fce4d9 refactor(split): allow central to define connection parameters
Fixes #1614
2023-06-19 20:48:31 -06:00
Peter Johanson
753802cd79 fix(sensors): Clean ups based on code review. 2023-06-18 20:45:06 -06:00
Peter Johanson
3a91b32513 refactor(sensors): Use "sensor index" consistently 2023-06-18 20:45:06 -06:00
Peter Johanson
8b29f6d345 refactor(sensors): Split data handling from triggers.
* All sensor behaviors should see sensor data, then selectively
  only have some trigger their behaviors.
2023-06-18 20:45:06 -06:00
Peter Johanson
d781ec795b refactor(bluetooth): Add battery reporting config.
* Add dedicated battery reporting Kconfig that is `imply`d by
  enabling ZMK_BLE.
2023-06-18 20:45:06 -06:00
Peter Johanson
f8aaaff556 refactor(shields): Updated ZMK Uno encoder config.
* Move to new steps/triggers-per-rotation config.
* Leverage QDEC Nordic driver when used on Nordic DK.
2023-06-18 20:45:06 -06:00
Peter Johanson
621d946d29 refactor(bluetooth): Bump HoG stack size.
* Bump the default stack size for the HoG processing thread
  to avoid issues w/ some pathways.
2023-06-18 20:45:06 -06:00
Peter Johanson
f0f7e2081b refactor(config): Select SENSOR as needed.
* Don't force on SENSOR Kconfig setting unless
  needed based on the detected DT.
2023-06-18 20:45:06 -06:00
Peter Johanson
295ed83409 refactor(sensors): ec11 rotation sensor value in degrees.
* Add new `steps` property to the `aips,ec11` binding, to make
  the driver properly report degrees in the rotation delta channel.
* Handle old sensor values in sensor rotate behavior.
2023-06-18 20:45:06 -06:00
Peter Johanson
2244bd3d81 refactor(sensors): Sensor event channel data, resolution tweaks.
* Refactor sensor events to include channel data,
  necessary for prop split encoders, and avoiding duplicate calls,
  to fetch channel data twice, etc.
* More consistent behavior driver API.
* Allow setting triggers per resolution at the behavior level optionally.
2023-06-18 20:45:06 -06:00
Joel Spadin
dcf5e75fa6 fix(boards): Bump nRF5340 DK I2C buffer size
Increased the I2C buffer size again, since it needs to be at least 641
to support 128x64 displays.
2023-06-18 14:57:06 -06:00
Joel Spadin
9ff1eaeb5a fix: Enable BT_TINYCRYPT_ECC when using HCI
BT_TINYCRYPT_ECC is required for BT_SMP_SC_PAIR_ONLY to work on setups
that use BT HCI like the nRF5340.
2023-06-18 14:52:45 -06:00
Xudong Zheng
5d9ae8fffa feat(split): allow central to connect to multiple peripherals 2023-06-05 16:22:41 -06:00
Peter Johanson
f08802eaa7 fix(boards): Proper i2c pinctrl for BlueMicro840
* Use the proper pin assignmets after the move to pinctrl for the
  Zephyr 3.2 migration.
2023-06-05 00:05:44 -06:00
Peter Johanson
19d883cdfe fix(bluetooth): Passkey pairing improvements.
* Capture the last 6 entered digits, and then require pressing
   Enter/Return to submit the entered digits. This matches the
   messaging shown on hosts regarding how to complete pairing.
* Fix the wording on the Kconfig menu item to accurately describe
  the feature.
2023-06-05 00:01:44 -06:00
Joel Spadin
b276a3bfb0 refactor(kscan): batch GPIO reads by port
Changed the GPIO matrix and direct GPIO key scan drivers to do a single
read per port instead of one read per pin. This is much more efficient
for some types of GPIO drivers, such as I2C GPIO expanders.

To accomplish this with minimal overhead, we now sort input pins by port
at driver init. if we iterate through the pins in the sorted order, all
pins on the same port are consecutive, so we only need to read each port
once the first time we see it.
2023-05-28 23:33:34 -06:00
Xudong Zheng
1adfcf92bf refactor(split): fix inconsistency in Kconfig names 2023-05-28 22:58:31 -06:00
Peter Johanson
5aac2743b1 fix(bluetooth): Improved checking for conn status.
* Check the actual connection status before considering
  a discovered connection as connected.
2023-05-22 23:09:40 -06:00
Cem Aksoylar
864394b40a feat(display): Add setting to invert display colors
Add CONFIG_ZMK_DISPLAY_INVERT Kconfig to invert colors
(black-on-white to white-on-black) on monochrome screens.
Currently applies only if CONFIG_LV_USE_THEME_MONO is selected,
which is the default unless user overrides it.
2023-05-21 21:51:36 -06:00
Cem Aksoylar
7e29166c6c refactor(display): Clean up unused theme Kconfig 2023-05-21 21:51:36 -06:00
Cem Aksoylar
b021d19255 fix(display): Imply LVGL mono theme when display is enabled
All displays currently used with ZMK are monochrome so it makes sense
to enable the mono theme by default, which can be disabled by the user
since we use the "imply" statement.

Without this theme setting, the small font size selection for widgets
at the bottom of the stock status screen does not work.
2023-05-21 21:51:36 -06:00
digger vermont
89d71ed2c2
feat(boards): Add KBDfans Tofu65 2.0 board
* Initial commit of Tofu65 2.0 board

---------

Co-authored-by: Pete Johanson <peter@peterjohanson.com>
2023-05-18 17:47:36 -06:00
Alexander Krikun
94789a092c fix(boards): unify board I2C configuration, use TWI driver 2023-05-04 22:51:54 -07:00
Cem Aksoylar
0239f18b61 feat(boards): Add Corne-ish Zen v1 2023-04-25 23:57:16 -07:00