feat!: Move to zephyr v4.1 (#3060)

refactor: Move to Zephyr v4.1.0

Move to Zephyr v4.1.0, with various build/compilation fixes needed for
basic use.

refactor(tests): Move to native_sim for tests.

feat(core): (Optionally) use Zephyr keyboard input devices

Add ability to assign a keyboard `input` device to a physical layout,
or use a chosen `zmk,matrix-input`.

fix(pointing): Refactor for changes to input API

Pass NULL user_data to input callbacks.

fix(tests): Fix BLE test to account for Zephyr changes

Handle additional read callback invocation once all matching
characteristic have been read.

fix(sensors): Initialize sensor data to 0 before fetching.

Be sure we don't get back any uninitialized data by initializing
the channel data to 0 before calling into the sensor API.

refactor(input): Adjust split input to input API changes.

Input callbacks now have a user_data parameter, adjust accordingly.

chore(bluetooth): Minor cleanup of split BT code after refactor

Small fixes and remove commented dead code left after the split
refactor.

refactor: Fix up BLE tests after Zephyr upgrade.

Minor changes to snapshots based on newer Zephyr version.

refactor(boards): Move to upstream xiao_ble board ID.

Move to official upstream board definition for the Seeed XIAO BLE.

refactor: Adjust metadata schema for HWMv2 board IDs w/ qualifiers

Adjust our ZMK metadata to allow for board IDs that include qualifiers
with slash delimeters.

refactor!(boards): Move nice!nano to HWMv2, and proper revisioning

Upgrade the nice!nano board to HWMv2, under the proper nicekeyboards
vendor directory, and with proper revisions. Includes a breaking change
to default the `2.0.0` version instead of the much older v1 (`1.0.0`).

fix: Disable Nordic dt-bindings header checks.

Disable the recently added Nordic dt-bindings header checks, which cause
issues for our HID related headers.

fix(studio): Correct `memset` usage.

Use the correct memset call to clear our RPC memory.

fix: Refactor for new Zephyr PM API

Adjustments to our PM code to match Zephyr PM APIs.

refactor(ble): Use correct BT opt for connectable.

Adjust for upstream Zephyr BT API changes for advertising options.

refactor(boards): Move MakerDiary M2 board to HWMv2.

Run the HWMv2 script to convert the MakerDiary M2 board.

fix(studio): Correct usage of thread analyzer API

Fix up the RPC code that invoke the thread analyzer API to account for
API changes.

chore: Remove nanopb module override.

Leverage nanopb version that's used by Zephyr.

feat(core): mapper for magic bootloader values.

To trigger bootloaders that use a magic value in RAM to trigger
bootloader mode, add a mapping retained memory driver that maps
write/read of boot mode values to a special magic value stored
in the actually backing RAM.

feat(behaviors): Add retention boot mode to reset.

Support new generic Zephyr retention boot mode API in the reset
behavior.

feat: Add double tap to enter bootloader functionality

Add ability to enter the bootloader if double tapping reset within the
specified window.

refactor(CI): Move to 4.1 container tags.

Move to the new 4.1 tagged container, to ensure updated SDK, Python
packages, etc.

refactor(boards): Move nRFMicro to HWMv2

Refactor nRFMicro to HWMv2, using proper SoC, revisions, and variants
(for flipped). Also move to devicetree setup of DCDC/HV DCDC.

refactor(boards): Move QMK Proton-C to HWMv2

Move Proton-C to HWMv2 for use with Zephyr 4.1.

chore(ci): Adjust core coverage for new board IDs.

Use correct board IDs, with qualifiers, for our core coverage testing.

refactor(boards): Move BDN9 to HWMv2

Move BDN9 to HWMv2, using the base `bdn9` ID, no longer including the
`_rev2` suffix in the ID.

refactor(boards): Move nice!60 to HWMv2

Migrate nice!60 to HWMv2.

refactor: Adjust how we're searching/loading keymap files

Use new post_boards_shields extension point for loading keymap files
from board/shield directories.

refactor(boards): Move planck rev6 to HWMv2.

Move Planck board definition to HWMv2, including versioning tweaks.

refactor(boards): Move OLKB Preonic to HWMv2

Move Preonic board definition to HWMv2 and remove `_rev3` variant
suffix in favor of board versioning with `3.0.0` as the default.

chore(deps): Pull in Zephyr optional group for nanopb.

Ensure we enable nanopb by adding +optional group filter.

fix(ci): Prevent slash characters in artifact names.

Move to HWMv2 means board IDs often include slashes, so replace those
with underscores when doing file uploads.

fix(usb): Adjust Kconfig settings for USB.

* Ensure USB isn't initialized automatically before we do, which can
  happen if USB CDC logging is used/enabled for a given board.
* Adjust USB HID to initialize the USB class/interface before we enable
  the USB device itself.

fix(display): Fix setting the small font for the mono theme.

Adjust for modified mono theme init function to pass the small font.

chore(ci): Fix changed board IDs for core coverage.

Adjust board IDs for our core coverage after move to HWMv2 and board
versioning consistently.

* planck_rev6 -> planck
* bdn9_rev2 -> bdn9

fix(underglow): Remove use of removed Kconfig WS2812 symbol

refactor(boards): Move PW CKP boards to HWMv2

Migrate the bt60, bt65, and bt75 to HWMv2.

refactor(boards): Move Puchi BLE to HWMv2

Migrate the Puchi BLE to HWMv2.

refactor(boards): Migrate Ferris rev02 to HWMv2.

Move Ferris rev02 to HMWv2, and remove the revision from the ID.

refactor(boards): Move Pillbug to HWMv2

Migrate the MechWild PillBug board to HWMv2.

refactor(boards): Migrate s40nc to HWMv2

Move the ShortyFortyNoCordy (s40nc) to HWMv2.

refactor(boards): Move bluemicro840 board to HWMv2.

Migrate bluemicro840 board to HWMv2, set up boot mode retention.

fix(boards): Retore bootloader support on XIAO BLE.

Set up necessary boot mode/retention to properly set GPREGRET to trigger
Adafruit bootloader to run on the XIAO BLE.

refactor(boards): Move Adv360 Pro to HWMv2.

Migrate Adv360 Pro left/right to HWMv2.

refactor(boards): Move Glove80 to HMWv2

Refactor the MoErgo Glove80 left/right to HWMv2.

refactor(boards): Move Mikoto to HMWv2.

Migrate Mikoto to HWMv2, with non-exact matching, tweaks to I2C
selection to imply it for the 7.2.0 revision for the fuel gauge.

refactor(boards): Move kbdfans Tofu65 2.0 to HMWv2

Move Tofu65 2.0 to HMWv2, with ID of just `tofu65`.

refactor(boards): Remove dz60rgb board

Remove dz60rgb, it's no longer readily available and we have other
current stm32 reference designs for testing.

refactor(boards): Move Corneish Zen to HMWv2

Move Corneish Zen to HMWv2, with IDs of
`corneish_zen_left`/`corneish_zen_right`.

refactor(boards): Migrate Corne-ish Zen status screen

* refactor(boards): Add boot mode to the nice!nano using common dtsi

* Add a new .dtsi for setting up nRF52 boot mode/retained memory
  settings
* Adjust XIAO BLE to use the new include file
* Add boot mode to to the nice!nano

refactor(boards): Add boot mode support to nice!60 board

Enable boot mode for nice!60 board.

refactor(boards): Adjust Zephyr board metadata file locations

Move the ZMK metadata files for upstream Zephyr boards to align with the
HWMv2 directory structure that uses the vendor ID for the parent
directory for a board directory.

fix: Don't enable ZMK Display by default for a few shields

By convention, avoid enabling ZMK Display by default on shields that may
be built with under-resourced controllers (e.g. nRF52833 based ones).

fix: Remove usage of renamed Kconfig from core coverage.

Avoid using WS2812_LED_STRIP, since that Kconfig was renamed/split into
SPI/GPIO/I2S symbols.

refactor(boards): Adjust XIAO RP2040 override names, bootloader support

Adjust the .conf/.overlay files to match the proper naming for the
XIAO rp2040 board. Also add the necessary Kconfig/DTS bits for
supporting bootloader using retained memory/boot mode retention.

fix(display): Adjust stack sizes for display usage.

Updated LVGL is bumping our stack size, so adjust the system work queue
and dedicated display queue stack sizes as needed to account for this.

feat(display): Add thread name to dedicated display queue.

When thread names are enabled, pass a name to the dedicated display
queue for better tracibility when using the thread analyzer.

docs(blog): Add Zephyr upgrade post

docs: Add bootloader integration page

Add a dedicated page to outline steps to set up bootloader integration
using the boot retention mechanism in newer Zephyr versions.

fix(display): port nice!view display code

* remove `lv_` prefix from old LVGL methods

doc: Update local setup docs to use `west packages pip`

Install Zephyr deps using the newer `west packages pip --install`.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>

refactor(split): Adjust BT split code for newer Zephyr APIs.

refactor(boards): Adjust upstream RP2040 boards for boot mode retention

Add necessary DTS/Kconfig settings to upstream RP2040 boards so they can
use the ZMK bootloader functionality using the boot mode retention
infrastructure.

docs: Update Zephyr docs links to 4.1.0 version.

Update all links to the Zephyr docs to the 4.1.0 versions to match our
Zephyr version in use.

docs: Add a note about using CMake v3 for maximum compatibility.

Some optional modules, like libmetal, which is used on nRF5340,
specifically require CMake v3, so add a note in the native toolchain
setup about this.

feat(pointing): Handle INPUT_BTN_TOUCH codes for mouse buttons

Translate INPUT_BTN_TOUCH input codes into button 0 press/release for
HID layer.

chore(pointing): Clean up some warning messages.

Properly check return code from queue-ing messages, and fix up some type
warnings in our logging calls.

* Fix input event codes line numbers

fix(studio): Properly serialize GATT RPC indications.

fix(core): Set a system work queue stack size of 2048 by default

We use a fair amount of stack even without BLE or RP2040, so default to
2048 by default everywhere, and constrained platforms can lowes this if
they really need.

refactor(core): Move away from deprecated DIS Kconfig symbols

Use the correct Device Information Service Kconfig symbols for our model
number and manufacturer.

refactor: Move upstream Zephyr board overrides to extensions dirs

Newer Zephyr supports "board extensions" to formally do what we've added
in ourselves via some hacks, so move all our board overlay/config file
overrides for upstream Zephyr boards into that correct structure.

fix(boards): Add xiao_ble sd_partition label for nosd snippet compat

Upstream xiao_ble uses different naming convention for the partition
labels, so add an additional label for the SD range, so the existing
nrf52840-nosd snippet will still work with the board.

fix(core): Don't force CBPRINTF_NANO, for proper formatting.

The nano CBPRINTF implementation lacks some padded formatting needed to
ensure consistent formatting of BLE addresses, which we use to store
keys as strings in a few places, so use the complete CBPRINTF by default
now.

fix(boards): Remove some references to old nice_nano_v2 board ID.

The nice!nano board definition now properly uses versioning, so avoid
referring to it with old `nice_nano_v2` board ID.

fix(boards): Remove nano overlays for old nice_nano_v2 board ID.

With board versioning in place, we can remove the unused
`nice_nano_v2.overlay` files from shields.

---------

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Nicolas Munnich <munnich@lipn.univ-paris13.fr>
Co-authored-by: snoyer <noyer.stephane@gmail.com>
This commit is contained in:
Pete Johanson
2025-12-09 17:43:22 -07:00
committed by GitHub
parent abb64ba316
commit c06fa48ce5
872 changed files with 3166 additions and 3411 deletions

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,3 +1,2 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,6 +1,5 @@
# Uncomment the following lines to enable the Corne RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Corne OLED Display
# CONFIG_ZMK_DISPLAY=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,6 +1,5 @@
# Uncomment the following lines to enable the Elephant42 RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Elephant42 OLED Display
# CONFIG_ZMK_DISPLAY=y
# CONFIG_ZMK_DISPLAY=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -6,4 +6,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -3,4 +3,3 @@
# Enables RGB functionality (Uncomment lines below to enable.)
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,6 +1,5 @@
# Uncomment the following lines to enable the Jorne RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Jorne OLED Display
# CONFIG_ZMK_DISPLAY=y

View File

@@ -6,4 +6,4 @@ CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Uncomment the following line to enable the Knob Goblin OLED Display
CONFIG_ZMK_DISPLAY=y
# CONFIG_ZMK_DISPLAY=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -7,4 +7,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -7,4 +7,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -7,4 +7,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -47,29 +47,29 @@ Development Environment: [Basic Setup](https://zmk.dev/docs/development/setup)
Build commands for the default keymap of Leeloo v1:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD=leeloo_left
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD=leeloo_right
west build -d build/left -p -b nice_nano -- -DSHIELD=leeloo_left
west build -d build/right -p -b nice_nano -- -DSHIELD=leeloo_right
```
Build commands for the default keymap of Leeloo v2:
```
west build -d build/left_v2 -p -b nice_nano_v2 -- -DSHIELD=leeloo_rev2_left
west build -d build/right_v2 -p -b nice_nano_v2 -- -DSHIELD=leeloo_rev2_right
west build -d build/left_v2 -p -b nice_nano -- -DSHIELD=leeloo_rev2_left
west build -d build/right_v2 -p -b nice_nano -- -DSHIELD=leeloo_rev2_right
```
Build commands for your custom keymap of Leeloo v1:
```
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD=leeloo_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo/config"
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD=leeloo_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo/config"
west build -d build/right -p -b nice_nano -- -DSHIELD=leeloo_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo/config"
west build -d build/left -p -b nice_nano -- -DSHIELD=leeloo_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo/config"
```
Build commands for your custom keymap of Leeloo v2:
```
west build -d build/right_v2 -p -b nice_nano_v2 -- -DSHIELD=leeloo_rev2_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_v2/config"
west build -d build/left_v2 -p -b nice_nano_v2 -- -DSHIELD=leeloo_rev2_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_v2/config"
west build -d build/right_v2 -p -b nice_nano -- -DSHIELD=leeloo_rev2_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_v2/config"
west build -d build/left_v2 -p -b nice_nano -- -DSHIELD=leeloo_rev2_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_v2/config"
```
## Building Leeloo's ZMK Firmware with nice!view Displays
@@ -101,22 +101,22 @@ Save your changes and close the file.
Build commands for the default keymap of Leeloo v1:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD="leeloo_left nice_view_adapter nice_view"
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD="leeloo_right nice_view_adapter nice_view"
west build -d build/left -p -b nice_nano -- -DSHIELD="leeloo_left nice_view_adapter nice_view"
west build -d build/right -p -b nice_nano -- -DSHIELD="leeloo_right nice_view_adapter nice_view"
```
Build commands for the default keymap of Leeloo v2:
```
west build -d build/left_v2 -p -b nice_nano_v2 -- -DSHIELD="leeloo_rev2_left nice_view_adapter nice_view"
west build -d build/right_v2 -p -b nice_nano_v2 -- -DSHIELD="leeloo_rev2_right nice_view_adapter nice_view"
west build -d build/left_v2 -p -b nice_nano -- -DSHIELD="leeloo_rev2_left nice_view_adapter nice_view"
west build -d build/right_v2 -p -b nice_nano -- -DSHIELD="leeloo_rev2_right nice_view_adapter nice_view"
```
Build commands for your custom keymap of Leeloo v2:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD="leeloo_rev2_left nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_v2/config"
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD="leeloo_rev2_right nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_v2/config"
west build -d build/left -p -b nice_nano -- -DSHIELD="leeloo_rev2_left nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_v2/config"
west build -d build/right -p -b nice_nano -- -DSHIELD="leeloo_rev2_right nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_v2/config"
```
# Support

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <37>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -14,9 +14,6 @@
# Uncomment the following line to enable per-key lighting
# CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
# CONFIG_WS2812_STRIP=y
# Keep OLED or nice!view Displays on even when toggling off LEDs
# Change to y if you wish to toggle Displays on and off with LEDs
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
@@ -40,4 +37,4 @@
# Uncomment if you are experiencing connectivity issues; this
# configuration item boosts the BLE transmit power.
# CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
# CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

View File

@@ -30,15 +30,15 @@ Development Environment: [Basic Setup](https://zmk.dev/docs/development/setup)
Build commands for the default keymap of Leeloo-Micro:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD=leeloo_micro_left
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD=leeloo_micro_right
west build -d build/left -p -b nice_nano -- -DSHIELD=leeloo_micro_left
west build -d build/right -p -b nice_nano -- -DSHIELD=leeloo_micro_right
```
Build commands for your custom keymap of Leeloo-Micro:
```
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD=leeloo_micro_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_micro/config"
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD=leeloo_micro_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_micro/config"
west build -d build/right -p -b nice_nano -- -DSHIELD=leeloo_micro_right -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_micro/config"
west build -d build/left -p -b nice_nano -- -DSHIELD=leeloo_micro_left -DZMK_CONFIG="C:/dev/zmk/[yourName]/leeloo_micro/config"
```
## Building Leeloo-Micro's ZMK Firmware with nice!view Displays
@@ -70,15 +70,15 @@ Save your changes and close the file.
Build commands for the default keymap of Leeloo-Micro:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD="leeloo_micro_left nice_view_adapter nice_view"
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD="leeloo_micro_right nice_view_adapter nice_view"
west build -d build/left -p -b nice_nano -- -DSHIELD="leeloo_micro_left nice_view_adapter nice_view"
west build -d build/right -p -b nice_nano -- -DSHIELD="leeloo_micro_right nice_view_adapter nice_view"
```
Build commands for your custom keymap of Leeloo-Micro:
```
west build -d build/left -p -b nice_nano_v2 -- -DSHIELD="leeloo_micro_left nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_micro/config"
west build -d build/right -p -b nice_nano_v2 -- -DSHIELD="leeloo_micro_right nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_micro/config"
west build -d build/left -p -b nice_nano -- -DSHIELD="leeloo_micro_left nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_micro/config"
west build -d build/right -p -b nice_nano -- -DSHIELD="leeloo_micro_right nice_view_adapter nice_view" -DZMK_CONFIG="/workspaces/zmk-config/[yourName]/leeloo_micro/config"
```
# Support

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <20>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -14,9 +14,6 @@
# Uncomment the following line to enable per-key lighting
# CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
# CONFIG_WS2812_STRIP=y
# Keep OLED or nice!view Displays on even when toggling off LEDs
# Change to y if you wish to toggle Displays on and off with LEDs
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
@@ -35,4 +32,4 @@
# Uncomment these two lines to add support for encoders
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,6 +1,5 @@
# Uncomment the following lines to enable the Microdox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Microdox OLED Display
# CONFIG_ZMK_DISPLAY=y

View File

@@ -1,6 +1,5 @@
# Uncomment the following lines to enable the Microdox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to enable the Microdox OLED Display
# CONFIG_ZMK_DISPLAY=y

View File

@@ -6,9 +6,6 @@ if SHIELD_MURPHPAD
config ZMK_KEYBOARD_NAME
default "MurphPad"
config ZMK_DISPLAY
default y
if ZMK_DISPLAY
config I2C

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 31)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 31)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <8>; /* number of SMD LED footprints on PCB */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -6,10 +6,9 @@
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Uncomment to disable OLED
#CONFIG_ZMK_DISPLAY=n
# Uncomment to enable OLED
#CONFIG_ZMK_DISPLAY=y
# Uncomment both to enable underglow
# Note that this will only work if an implementation exists for your board; check under the shield folder for board-specific overlays.
#CONFIG_ZMK_RGB_UNDERGLOW=y
#CONFIG_WS2812_STRIP=y

View File

@@ -8,7 +8,6 @@ If you built your nibble without the LEDs _and_ are using a nice!nano board, you
```
CONFIG_ZMK_RGB_UNDERGLOW=n
CONFIG_WS2812_STRIP=n
```
## Encoder Notes

View File

@@ -1,4 +1,2 @@
# Enable underglow
CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 11)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 11)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -25,7 +25,7 @@ choice ZMK_DISPLAY_STATUS_SCREEN
endchoice
config LV_Z_MEM_POOL_SIZE
default 4096 if ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
default 8192 if ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
imply NICE_VIEW_WIDGET_STATUS
@@ -33,7 +33,7 @@ config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM
config NICE_VIEW_WIDGET_STATUS
bool "Custom nice!view status widget"
select LV_FONT_MONTSERRAT_16
select LV_USE_IMG
select LV_USE_IMAGE
select LV_USE_CANVAS
config NICE_VIEW_WIDGET_INVERTED

View File

@@ -2,3 +2,4 @@
CONFIG_ZMK_DISPLAY=y
# Disable idle blanking
CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096

View File

@@ -111,9 +111,8 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BALLOON u
};
const lv_img_dsc_t balloon = {
.header.cf = LV_IMG_CF_INDEXED_1BIT,
.header.always_zero = 0,
.header.reserved = 0,
.header.cf = LV_COLOR_FORMAT_I1,
.header.w = 140,
.header.h = 68,
.data_size = 1232,
@@ -219,9 +218,8 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_MOUNTAIN
};
const lv_img_dsc_t mountain = {
.header.cf = LV_IMG_CF_INDEXED_1BIT,
.header.always_zero = 0,
.header.reserved = 0,
.header.cf = LV_COLOR_FORMAT_I1,
.header.w = 140,
.header.h = 68,
.data_size = 1232,

View File

@@ -35,9 +35,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BOLT uint
};
const lv_img_dsc_t bolt = {
.header.cf = LV_IMG_CF_INDEXED_2BIT,
.header.always_zero = 0,
.header.reserved = 0,
.header.cf = LV_COLOR_FORMAT_I2,
.header.w = 11,
.header.h = 18,
.data_size = 70,

View File

@@ -41,17 +41,17 @@ static void draw_top(lv_obj_t *widget, lv_color_t cbuf[], const struct status_st
init_rect_dsc(&rect_black_dsc, LVGL_BACKGROUND);
// Fill background
lv_canvas_draw_rect(canvas, 0, 0, CANVAS_SIZE, CANVAS_SIZE, &rect_black_dsc);
canvas_draw_rect(canvas, 0, 0, CANVAS_SIZE, CANVAS_SIZE, &rect_black_dsc);
// Draw battery
draw_battery(canvas, state);
// Draw output status
lv_canvas_draw_text(canvas, 0, 0, CANVAS_SIZE, &label_dsc,
state->connected ? LV_SYMBOL_WIFI : LV_SYMBOL_CLOSE);
canvas_draw_text(canvas, 0, 0, CANVAS_SIZE, &label_dsc,
state->connected ? LV_SYMBOL_WIFI : LV_SYMBOL_CLOSE);
// Rotate canvas
rotate_canvas(canvas, cbuf);
rotate_canvas(canvas);
}
static void set_battery_status(struct zmk_widget_status *widget,
@@ -112,11 +112,11 @@ int zmk_widget_status_init(struct zmk_widget_status *widget, lv_obj_t *parent) {
lv_obj_set_size(widget->obj, 160, 68);
lv_obj_t *top = lv_canvas_create(widget->obj);
lv_obj_align(top, LV_ALIGN_TOP_RIGHT, 0, 0);
lv_canvas_set_buffer(top, widget->cbuf, CANVAS_SIZE, CANVAS_SIZE, LV_IMG_CF_TRUE_COLOR);
lv_canvas_set_buffer(top, widget->cbuf, CANVAS_SIZE, CANVAS_SIZE, CANVAS_COLOR_FORMAT);
lv_obj_t *art = lv_img_create(widget->obj);
bool random = sys_rand32_get() & 1;
lv_img_set_src(art, random ? &balloon : &mountain);
lv_image_set_src(art, random ? &balloon : &mountain);
lv_obj_align(art, LV_ALIGN_TOP_LEFT, 0, 0);
sys_slist_append(&widgets, &widget->node);

View File

@@ -46,7 +46,7 @@ struct wpm_status_state {
uint8_t wpm;
};
static void draw_top(lv_obj_t *widget, lv_color_t cbuf[], const struct status_state *state) {
static void draw_top(lv_obj_t *widget, const struct status_state *state) {
lv_obj_t *canvas = lv_obj_get_child(widget, 0);
lv_draw_label_dsc_t label_dsc;
@@ -61,7 +61,7 @@ static void draw_top(lv_obj_t *widget, lv_color_t cbuf[], const struct status_st
init_line_dsc(&line_dsc, LVGL_FOREGROUND, 1);
// Fill background
lv_canvas_draw_rect(canvas, 0, 0, CANVAS_SIZE, CANVAS_SIZE, &rect_black_dsc);
lv_canvas_fill_bg(canvas, LVGL_BACKGROUND, LV_OPA_COVER);
// Draw battery
draw_battery(canvas, state);
@@ -86,15 +86,15 @@ static void draw_top(lv_obj_t *widget, lv_color_t cbuf[], const struct status_st
break;
}
lv_canvas_draw_text(canvas, 0, 0, CANVAS_SIZE, &label_dsc, output_text);
canvas_draw_text(canvas, 0, 0, CANVAS_SIZE, &label_dsc, output_text);
// Draw WPM
lv_canvas_draw_rect(canvas, 0, 21, 68, 42, &rect_white_dsc);
lv_canvas_draw_rect(canvas, 1, 22, 66, 40, &rect_black_dsc);
canvas_draw_rect(canvas, 0, 21, 68, 42, &rect_white_dsc);
canvas_draw_rect(canvas, 1, 22, 66, 40, &rect_black_dsc);
char wpm_text[6] = {};
snprintf(wpm_text, sizeof(wpm_text), "%d", state->wpm[9]);
lv_canvas_draw_text(canvas, 42, 52, 24, &label_dsc_wpm, wpm_text);
canvas_draw_text(canvas, 42, 52, 24, &label_dsc_wpm, wpm_text);
int max = 0;
int min = 256;
@@ -118,13 +118,13 @@ static void draw_top(lv_obj_t *widget, lv_color_t cbuf[], const struct status_st
points[i].x = 2 + i * 7;
points[i].y = 60 - (state->wpm[i] - min) * 36 / range;
}
lv_canvas_draw_line(canvas, points, 10, &line_dsc);
canvas_draw_line(canvas, points, 10, &line_dsc);
// Rotate canvas
rotate_canvas(canvas, cbuf);
rotate_canvas(canvas);
}
static void draw_middle(lv_obj_t *widget, lv_color_t cbuf[], const struct status_state *state) {
static void draw_middle(lv_obj_t *widget, const struct status_state *state) {
lv_obj_t *canvas = lv_obj_get_child(widget, 1);
lv_draw_rect_dsc_t rect_black_dsc;
@@ -141,7 +141,7 @@ static void draw_middle(lv_obj_t *widget, lv_color_t cbuf[], const struct status
init_label_dsc(&label_dsc_black, LVGL_BACKGROUND, &lv_font_montserrat_18, LV_TEXT_ALIGN_CENTER);
// Fill background
lv_canvas_draw_rect(canvas, 0, 0, CANVAS_SIZE, CANVAS_SIZE, &rect_black_dsc);
lv_canvas_fill_bg(canvas, LVGL_BACKGROUND, LV_OPA_COVER);
// Draw circles
int circle_offsets[NICEVIEW_PROFILE_COUNT][2] = {
@@ -152,33 +152,33 @@ static void draw_middle(lv_obj_t *widget, lv_color_t cbuf[], const struct status
bool selected = i == state->active_profile_index;
if (state->profiles_connected[i]) {
lv_canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13, 0, 360,
&arc_dsc);
canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13, 0, 360,
&arc_dsc);
} else if (state->profiles_bonded[i]) {
const int segments = 8;
const int gap = 20;
for (int j = 0; j < segments; ++j)
lv_canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13,
360. / segments * j + gap / 2.0,
360. / segments * (j + 1) - gap / 2.0, &arc_dsc);
canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13,
360. / segments * j + gap / 2.0,
360. / segments * (j + 1) - gap / 2.0, &arc_dsc);
}
if (selected) {
lv_canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 9, 0, 359,
&arc_dsc_filled);
canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 9, 0, 359,
&arc_dsc_filled);
}
char label[2];
snprintf(label, sizeof(label), "%d", i + 1);
lv_canvas_draw_text(canvas, circle_offsets[i][0] - 8, circle_offsets[i][1] - 10, 16,
(selected ? &label_dsc_black : &label_dsc), label);
canvas_draw_text(canvas, circle_offsets[i][0] - 8, circle_offsets[i][1] - 10, 16,
(selected ? &label_dsc_black : &label_dsc), label);
}
// Rotate canvas
rotate_canvas(canvas, cbuf);
rotate_canvas(canvas);
}
static void draw_bottom(lv_obj_t *widget, lv_color_t cbuf[], const struct status_state *state) {
static void draw_bottom(lv_obj_t *widget, const struct status_state *state) {
lv_obj_t *canvas = lv_obj_get_child(widget, 2);
lv_draw_rect_dsc_t rect_black_dsc;
@@ -187,7 +187,7 @@ static void draw_bottom(lv_obj_t *widget, lv_color_t cbuf[], const struct status
init_label_dsc(&label_dsc, LVGL_FOREGROUND, &lv_font_montserrat_14, LV_TEXT_ALIGN_CENTER);
// Fill background
lv_canvas_draw_rect(canvas, 0, 0, CANVAS_SIZE, CANVAS_SIZE, &rect_black_dsc);
lv_canvas_fill_bg(canvas, LVGL_BACKGROUND, LV_OPA_COVER);
// Draw layer
if (state->layer_label == NULL || strlen(state->layer_label) == 0) {
@@ -195,13 +195,13 @@ static void draw_bottom(lv_obj_t *widget, lv_color_t cbuf[], const struct status
sprintf(text, "LAYER %i", state->layer_index);
lv_canvas_draw_text(canvas, 0, 5, 68, &label_dsc, text);
canvas_draw_text(canvas, 0, 5, 68, &label_dsc, text);
} else {
lv_canvas_draw_text(canvas, 0, 5, 68, &label_dsc, state->layer_label);
canvas_draw_text(canvas, 0, 5, 68, &label_dsc, state->layer_label);
}
// Rotate canvas
rotate_canvas(canvas, cbuf);
rotate_canvas(canvas);
}
static void set_battery_status(struct zmk_widget_status *widget,
@@ -212,7 +212,7 @@ static void set_battery_status(struct zmk_widget_status *widget,
widget->state.battery = state.level;
draw_top(widget->obj, widget->cbuf, &widget->state);
draw_top(widget->obj, &widget->state);
}
static void battery_status_update_cb(struct battery_status_state state) {
@@ -250,8 +250,8 @@ static void set_output_status(struct zmk_widget_status *widget,
widget->state.profiles_bonded[i] = state->profiles_bonded[i];
}
draw_top(widget->obj, widget->cbuf, &widget->state);
draw_middle(widget->obj, widget->cbuf2, &widget->state);
draw_top(widget->obj, &widget->state);
draw_middle(widget->obj, &widget->state);
}
static void output_status_update_cb(struct output_status_state state) {
@@ -288,7 +288,7 @@ static void set_layer_status(struct zmk_widget_status *widget, struct layer_stat
widget->state.layer_index = state.index;
widget->state.layer_label = state.label;
draw_bottom(widget->obj, widget->cbuf3, &widget->state);
draw_bottom(widget->obj, &widget->state);
}
static void layer_status_update_cb(struct layer_status_state state) {
@@ -313,7 +313,7 @@ static void set_wpm_status(struct zmk_widget_status *widget, struct wpm_status_s
}
widget->state.wpm[9] = state.wpm;
draw_top(widget->obj, widget->cbuf, &widget->state);
draw_top(widget->obj, &widget->state);
}
static void wpm_status_update_cb(struct wpm_status_state state) {
@@ -334,13 +334,13 @@ int zmk_widget_status_init(struct zmk_widget_status *widget, lv_obj_t *parent) {
lv_obj_set_size(widget->obj, 160, 68);
lv_obj_t *top = lv_canvas_create(widget->obj);
lv_obj_align(top, LV_ALIGN_TOP_RIGHT, 0, 0);
lv_canvas_set_buffer(top, widget->cbuf, CANVAS_SIZE, CANVAS_SIZE, LV_IMG_CF_TRUE_COLOR);
lv_canvas_set_buffer(top, widget->cbuf, CANVAS_SIZE, CANVAS_SIZE, CANVAS_COLOR_FORMAT);
lv_obj_t *middle = lv_canvas_create(widget->obj);
lv_obj_align(middle, LV_ALIGN_TOP_LEFT, 24, 0);
lv_canvas_set_buffer(middle, widget->cbuf2, CANVAS_SIZE, CANVAS_SIZE, LV_IMG_CF_TRUE_COLOR);
lv_canvas_set_buffer(middle, widget->cbuf2, CANVAS_SIZE, CANVAS_SIZE, CANVAS_COLOR_FORMAT);
lv_obj_t *bottom = lv_canvas_create(widget->obj);
lv_obj_align(bottom, LV_ALIGN_TOP_LEFT, -44, 0);
lv_canvas_set_buffer(bottom, widget->cbuf3, CANVAS_SIZE, CANVAS_SIZE, LV_IMG_CF_TRUE_COLOR);
lv_canvas_set_buffer(bottom, widget->cbuf3, CANVAS_SIZE, CANVAS_SIZE, CANVAS_COLOR_FORMAT);
sys_slist_append(&widgets, &widget->node);
widget_battery_status_init();

View File

@@ -14,9 +14,9 @@
struct zmk_widget_status {
sys_snode_t node;
lv_obj_t *obj;
lv_color_t cbuf[CANVAS_SIZE * CANVAS_SIZE];
lv_color_t cbuf2[CANVAS_SIZE * CANVAS_SIZE];
lv_color_t cbuf3[CANVAS_SIZE * CANVAS_SIZE];
uint8_t cbuf[CANVAS_BUF_SIZE];
uint8_t cbuf2[CANVAS_BUF_SIZE];
uint8_t cbuf3[CANVAS_BUF_SIZE];
struct status_state state;
};

View File

@@ -10,18 +10,14 @@
LV_IMG_DECLARE(bolt);
void rotate_canvas(lv_obj_t *canvas, lv_color_t cbuf[]) {
static lv_color_t cbuf_tmp[CANVAS_SIZE * CANVAS_SIZE];
memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp));
lv_img_dsc_t img;
img.data = (void *)cbuf_tmp;
img.header.cf = LV_IMG_CF_TRUE_COLOR;
img.header.w = CANVAS_SIZE;
img.header.h = CANVAS_SIZE;
void rotate_canvas(lv_obj_t *canvas) {
uint8_t *buf = lv_canvas_get_draw_buf(canvas)->data;
static uint8_t buf_copy[CANVAS_BUF_SIZE];
memcpy(buf_copy, buf, sizeof(buf_copy));
lv_canvas_fill_bg(canvas, LVGL_BACKGROUND, LV_OPA_COVER);
lv_canvas_transform(canvas, &img, 900, LV_IMG_ZOOM_NONE, -1, 0, CANVAS_SIZE / 2,
CANVAS_SIZE / 2, true);
const uint32_t stride = lv_draw_buf_width_to_stride(CANVAS_SIZE, CANVAS_COLOR_FORMAT);
lv_draw_sw_rotate(buf_copy, buf, CANVAS_SIZE, CANVAS_SIZE, stride, stride,
LV_DISPLAY_ROTATION_270, CANVAS_COLOR_FORMAT);
}
void draw_battery(lv_obj_t *canvas, const struct status_state *state) {
@@ -30,16 +26,16 @@ void draw_battery(lv_obj_t *canvas, const struct status_state *state) {
lv_draw_rect_dsc_t rect_white_dsc;
init_rect_dsc(&rect_white_dsc, LVGL_FOREGROUND);
lv_canvas_draw_rect(canvas, 0, 2, 29, 12, &rect_white_dsc);
lv_canvas_draw_rect(canvas, 1, 3, 27, 10, &rect_black_dsc);
lv_canvas_draw_rect(canvas, 2, 4, (state->battery + 2) / 4, 8, &rect_white_dsc);
lv_canvas_draw_rect(canvas, 30, 5, 3, 6, &rect_white_dsc);
lv_canvas_draw_rect(canvas, 31, 6, 1, 4, &rect_black_dsc);
canvas_draw_rect(canvas, 0, 2, 29, 12, &rect_white_dsc);
canvas_draw_rect(canvas, 1, 3, 27, 10, &rect_black_dsc);
canvas_draw_rect(canvas, 2, 4, (state->battery + 2) / 4, 8, &rect_white_dsc);
canvas_draw_rect(canvas, 30, 5, 3, 6, &rect_white_dsc);
canvas_draw_rect(canvas, 31, 6, 1, 4, &rect_black_dsc);
if (state->charging) {
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
lv_canvas_draw_img(canvas, 9, -1, &bolt, &img_dsc);
lv_draw_image_dsc_t img_dsc;
lv_draw_image_dsc_init(&img_dsc);
canvas_draw_img(canvas, 9, -1, &bolt, &img_dsc);
}
}
@@ -67,3 +63,68 @@ void init_arc_dsc(lv_draw_arc_dsc_t *arc_dsc, lv_color_t color, uint8_t width) {
arc_dsc->color = color;
arc_dsc->width = width;
}
void canvas_draw_line(lv_obj_t *canvas, const lv_point_t points[], uint32_t point_cnt,
lv_draw_line_dsc_t *draw_dsc) {
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
for (uint32_t i = 1; i < point_cnt; ++i) {
draw_dsc->p1.x = points[i - 1].x;
draw_dsc->p1.y = points[i - 1].y;
draw_dsc->p2.x = points[i].x;
draw_dsc->p2.y = points[i].y;
lv_draw_line(&layer, draw_dsc);
}
lv_canvas_finish_layer(canvas, &layer);
}
void canvas_draw_rect(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h,
lv_draw_rect_dsc_t *draw_dsc) {
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
lv_area_t coords = {x, y, x + w - 1, y + h - 1};
lv_draw_rect(&layer, draw_dsc, &coords);
lv_canvas_finish_layer(canvas, &layer);
}
void canvas_draw_arc(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t r,
int32_t start_angle, int32_t end_angle, lv_draw_arc_dsc_t *draw_dsc) {
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
draw_dsc->center.x = x;
draw_dsc->center.y = y;
draw_dsc->radius = r;
draw_dsc->start_angle = start_angle;
draw_dsc->end_angle = end_angle;
lv_draw_arc(&layer, draw_dsc);
lv_canvas_finish_layer(canvas, &layer);
}
void canvas_draw_text(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t max_w,
lv_draw_label_dsc_t *draw_dsc, const char *txt) {
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
draw_dsc->text = txt;
lv_area_t coords = {x, y, x + max_w, y + CANVAS_SIZE};
lv_draw_label(&layer, draw_dsc, &coords);
lv_canvas_finish_layer(canvas, &layer);
}
void canvas_draw_img(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, const lv_image_dsc_t *src,
lv_draw_image_dsc_t *draw_dsc) {
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
draw_dsc->src = src;
lv_area_t coords = {x, y, x + src->header.w - 1, y + src->header.h - 1};
lv_draw_image(&layer, draw_dsc, &coords);
lv_canvas_finish_layer(canvas, &layer);
}

View File

@@ -11,6 +11,10 @@
#define NICEVIEW_PROFILE_COUNT 5
#define CANVAS_SIZE 68
#define CANVAS_COLOR_FORMAT LV_COLOR_FORMAT_L8 // smallest type supported by sw_rotate
#define CANVAS_BUF_SIZE \
LV_CANVAS_BUF_SIZE(CANVAS_SIZE, CANVAS_SIZE, LV_COLOR_FORMAT_GET_BPP(CANVAS_COLOR_FORMAT), \
LV_DRAW_BUF_STRIDE_ALIGN)
#define LVGL_BACKGROUND \
IS_ENABLED(CONFIG_NICE_VIEW_WIDGET_INVERTED) ? lv_color_black() : lv_color_white()
@@ -42,10 +46,21 @@ struct battery_status_state {
#endif
};
void rotate_canvas(lv_obj_t *canvas, lv_color_t cbuf[]);
void rotate_canvas(lv_obj_t *canvas);
void draw_battery(lv_obj_t *canvas, const struct status_state *state);
void init_label_dsc(lv_draw_label_dsc_t *label_dsc, lv_color_t color, const lv_font_t *font,
lv_text_align_t align);
void init_rect_dsc(lv_draw_rect_dsc_t *rect_dsc, lv_color_t bg_color);
void init_line_dsc(lv_draw_line_dsc_t *line_dsc, lv_color_t color, uint8_t width);
void init_arc_dsc(lv_draw_arc_dsc_t *arc_dsc, lv_color_t color, uint8_t width);
void canvas_draw_line(lv_obj_t *canvas, const lv_point_t points[], uint32_t point_cnt,
lv_draw_line_dsc_t *draw_dsc);
void canvas_draw_rect(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h,
lv_draw_rect_dsc_t *draw_dsc);
void canvas_draw_arc(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t r,
int32_t start_angle, int32_t end_angle, lv_draw_arc_dsc_t *draw_dsc);
void canvas_draw_text(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, lv_coord_t max_w,
lv_draw_label_dsc_t *draw_dsc, const char *txt);
void canvas_draw_img(lv_obj_t *canvas, lv_coord_t x, lv_coord_t y, const lv_image_dsc_t *src,
lv_draw_image_dsc_t *draw_dsc);

View File

@@ -7,5 +7,5 @@ To use this shield, you should add this shield to your list of shields _before_
The nice!view will use the SDA/SCL pins of the OLED, and then the adapter expects a final pin to be "bodged" from your microcontroller to the nice!view CS pin. This adapter assumes that the CS pin bodged is the `&pro_micro 1` pin or "D1", which is the top left pin when looking at the front of the board. If you can't use this pin, you'll need to override the `cs-gpios` for the `&nice_view_spi` bus (in your `zmk-config` keymap for example) or you will want to define your own `&nice_view_spi` bus without using this adapter.
```
west build -b nice_nano_v2 -- -DSHIELD="lily58_left nice_view_adapter nice_view"
west build -b nice_nano -- -DSHIELD="lily58_left nice_view_adapter nice_view"
```

View File

@@ -1,35 +0,0 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 25)>;
low-power-enable;
};
};
};
nice_view_spi: &spi0 {
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>;
};
&pro_micro_i2c {
status = "disabled";
};

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,3 +1,2 @@
# Uncomment the following lines to enable the Redox RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,47 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <9>; /* 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>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,3 +1,2 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <11>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,3 +1,2 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,52 +0,0 @@
/*
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <4>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -4,4 +4,3 @@
# Uncomment the following two lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,3 +1,2 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 10)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 10)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -12,6 +12,5 @@
# Uncomment the following lines to enable the RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP=5
# CONFIG_ZMK_RGB_UNDERGLOW_SPD_START=1
# CONFIG_ZMK_RGB_UNDERGLOW_SPD_START=1

View File

@@ -43,10 +43,4 @@ endchoice
endif # LVGL
if ZMK_RGB_UNDERGLOW
config WS2812_STRIP
default y
endif
endif

View File

@@ -1,50 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <36>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE
>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -16,10 +16,6 @@ if SHIELD_SPLITKB_AURORA_CORNE_LEFT || SHIELD_SPLITKB_AURORA_CORNE_RIGHT
config ZMK_SPLIT
default y
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
config ZMK_DISPLAY
if ZMK_DISPLAY

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -16,10 +16,6 @@ if SHIELD_SPLITKB_AURORA_HELIX_LEFT || SHIELD_SPLITKB_AURORA_HELIX_RIGHT
config ZMK_SPLIT
default y
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
if ZMK_DISPLAY
config SSD1306

View File

@@ -1,45 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <6>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -16,10 +16,6 @@ if SHIELD_SPLITKB_AURORA_LILY58_LEFT || SHIELD_SPLITKB_AURORA_LILY58_RIGHT
config ZMK_SPLIT
default y
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
config ZMK_DISPLAY
if ZMK_DISPLAY

View File

@@ -1,45 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <5>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -16,10 +16,6 @@ if SHIELD_SPLITKB_AURORA_SOFLE_LEFT || SHIELD_SPLITKB_AURORA_SOFLE_RIGHT
config ZMK_SPLIT
default y
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
if ZMK_DISPLAY
config SSD1306

View File

@@ -1,45 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <6>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -16,10 +16,6 @@ if SHIELD_SPLITKB_AURORA_SWEEP_LEFT || SHIELD_SPLITKB_AURORA_SWEEP_RIGHT
config ZMK_SPLIT
default y
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
config ZMK_DISPLAY
if ZMK_DISPLAY

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -3,5 +3,3 @@
# Enable underglow
CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
CONFIG_WS2812_STRIP=y

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 8)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 8)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -7,8 +7,6 @@ CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# Uncomment to enable underglow
#CONFIG_ZMK_RGB_UNDERGLOW=y
# Use the STRIP config specific to the LEDs you're using
#CONFIG_WS2812_STRIP=y
# Uncomment to enable the display
# Note that an I2C OLED cannot be used at the same time as encoder 3.

View File

@@ -1,46 +0,0 @@
#include <dt-bindings/led/led.h>
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>;
low-power-enable;
};
};
};
&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>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View File

@@ -3,7 +3,6 @@
# Uncomment the following lines to enable RGB Underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y
# Uncomment the following line to turn on logging, and set ZMK logging to debug output
# CONFIG_ZMK_USB_LOGGING=y
# CONFIG_ZMK_USB_LOGGING=y

View File

@@ -16,10 +16,6 @@ config SHIELD_SSD1306_128X64
config SHIELD_SSD1306_128X32
select ZMK_DISPLAY
config ZMK_RGB_UNDERGLOW
select WS2812_STRIP
select SPI
config ZMK_PM_SOFT_OFF
default y if BOARD_NRF52840DK_NRF52840