Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leeloo v2 and Leeloo-Micro v1 updates to support Zephyr 3.2 #1762

Merged
merged 20 commits into from Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d03848f
Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2
ClicketySplit Apr 20, 2023
b964048
Leeloo-Micro v1 updates to support Zephyr 3.2
ClicketySplit Apr 20, 2023
e3af7f4
Resolving base conflict.
ClicketySplit Apr 26, 2023
cd979ae
Resolve base conflict.
ClicketySplit Apr 26, 2023
a538c5b
Resolve base conflict.
ClicketySplit Apr 26, 2023
82e396c
Resolve base conflict.
ClicketySplit Apr 26, 2023
47f63ab
Resolve base conflict.
ClicketySplit Apr 26, 2023
2b1e91f
Clean up of white space.
ClicketySplit Apr 26, 2023
6cadaa7
Updates from pre-commit.
ClicketySplit Apr 26, 2023
3364c96
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jun 4, 2023
1010c88
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jun 5, 2023
efdfe99
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jun 6, 2023
ed754e9
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jun 20, 2023
6f2066f
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jun 23, 2023
f8d6495
Merge branch 'zmkfirmware:main' into leeloo_micro_v1_branch
ClicketySplit Jul 7, 2023
d83caf4
Update app/boards/shields/leeloo_micro/README.md
ClicketySplit Jul 7, 2023
44f09fc
Updated based on recommendations.
ClicketySplit Jul 7, 2023
e9937f9
Merge branch 'leeloo_micro_v1_branch' of https://github.com/ClicketyS…
ClicketySplit Jul 7, 2023
32bd6b6
Refactored for new Encoder Configuration
ClicketySplit Jul 7, 2023
4a3f26f
Adjust pulses to 120 and steps to 30.
ClicketySplit Jul 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions app/boards/shields/leeloo/Kconfig.defconfig
@@ -1,6 +1,16 @@
# Copyright (c) 2022 The ZMK Contributors
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_LEELOO_REV2_LEFT

config ZMK_KEYBOARD_NAME
default "Leeloo v2"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_LEELOO_LEFT

config ZMK_KEYBOARD_NAME
Expand All @@ -11,7 +21,7 @@ config ZMK_SPLIT_ROLE_CENTRAL

endif

if SHIELD_LEELOO_LEFT || SHIELD_LEELOO_RIGHT
if SHIELD_LEELOO

config ZMK_SPLIT
default y
Expand All @@ -31,7 +41,6 @@ endif # ZMK_DISPLAY

if LVGL


config LV_Z_VDB_SIZE
default 64

Expand Down
15 changes: 14 additions & 1 deletion app/boards/shields/leeloo/Kconfig.shield
@@ -1,8 +1,21 @@
# Copyright (c) 2022 The ZMK Contributors
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_LEELOO
bool

config SHIELD_LEELOO_LEFT
caksoylar marked this conversation as resolved.
Show resolved Hide resolved
def_bool $(shields_list_contains,leeloo_left)
select SHIELD_LEELOO

config SHIELD_LEELOO_RIGHT
def_bool $(shields_list_contains,leeloo_right)
select SHIELD_LEELOO

config SHIELD_LEELOO_REV2_LEFT
def_bool $(shields_list_contains,leeloo_rev2_left)
select SHIELD_LEELOO

config SHIELD_LEELOO_REV2_RIGHT
def_bool $(shields_list_contains,leeloo_rev2_right)
select SHIELD_LEELOO
120 changes: 101 additions & 19 deletions app/boards/shields/leeloo/README.md
@@ -1,41 +1,123 @@
# Clickety Split | Leeloo
# Clickety Split | Leeloo v2

![Leeloo](https://cdn.shopify.com/s/files/1/0599/3460/5491/files/Leeloo-rev1.0-w.jpg?v=1646798726)
![Leeloo v2](https://github.com/ClicketySplit/build-guides/blob/main/leeloo/images/gallery/Leeloo-v2-ZMK.jpg)

Keyboard Designer: [clicketysplit.ca](https://clicketysplit.ca)
GitHub: [ClicketySplit](https://github.com/ClicketySplit)
Hardware Supported: Pro Micro, Elite-C, nice!nano v2
Hardware Supported: Pro Micro, Elite-C, and nice!nano v2

Albeit, there is no doubt where Leeloo's heritage is derived from—Lily58, and Corne. It is not a copy-paste-modify implementation.
Leeloo v2 has been designed from scratch—again. Everything from the wiring schematic to its case. Leeloo v2 still keeps the column stagger that it's known for, along with its low profile design.

Leeloo has been designed from scratch; everything from the schematic to its PCB footprints, and column stagger. There are some subtle differences that may not be apparent; however, its subtle changes enable an interesting future.
## Features/Differences from Leeloo v1

Features:
- Support for Kailh Low Profile Choc switches with 18mm x 18mm spacing.
- A version for Kailh Box/MX switches with 19.05mm x 19.05mm spacing will be available in the future.
- All switch locations are socketed.
- Rotary encoder locations are socketed.
- One of two locations on each side can be used for a rotary encoder.
- OLED Displays and nice!view Displays are natively supported, socketed, and no extra wiring is required.
- Support for per-switch RGB underglow.
- Better location for 110mAh or 700mAh batteries.
- Different location for soldering battery leads.
- Support for Alps Alpine Micro On/off switches.

# Leeloo v1

![Leeloo](https://github.com/ClicketySplit/build-guides/blob/main/leeloo/images/gallery/Leeloo-v1.jpg)

## Features

- 4x6x5m Split Keyboard
- Support for MX/Box or Low Profile Choc switches.
- 90% of the switches are socketed; with the exception to the rotary encoder positions—6 positions require soldering.
- Support for 128x32 OLED Displays.
- The option to select one of three positions for an EC11 rotary encoder on each half.
- Support for Alps Alpine Micro Switch
- Support for 3.7v 301230 LiPo Battery
- Support for both Low Profile Choc switches, and Box/MX switches; 19.05mm x 19.05mm spacing.
- 90% of the switches are socketed; with the exception to the rotary encoder positions.
- Support for Alps Alpine EC11 Rotary Encoders—one on each side, in one of three locations.
- Support for OLED Displays or nice!view Displays.
- nice!view displays require a wire to be soldered from the CS Pin on nice!view display to P0.22 or D4 on the nice!nano.
- Support for both 110mAh or 700mAh batteries.
- Solder pads for battery leads.
- Support for Alps Alpine Micro On/off switches.

# Building Your Firmware
# Building Leeloo's ZMK Firmware

ZMK Firmware: [Introduction to ZMK](https://zmk.dev/docs/)
Installation: [Installing ZMK](https://zmk.dev/docs/user-setup)
Customization: [Customizing ZMK](https://zmk.dev/docs/customization)
Development Environment: [Basic Setup](https://zmk.dev/docs/development/setup)

Build command for the default keymap of Leeloo:
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
```

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
```

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"
```

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"
```

## Building Leeloo's ZMK Firmware with nice!view Displays

There are a couple of files that need to be adjusted before the build commands can be run.

### Edit the leeloo[_rev2].keymap File

Near the top 3rd of the leeloo[_rev2].keymap file, locate the following code block:

```
//nice_view_spi: &spi0 {
// cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
//};
```

Remove the forward slashes to resemble the following:

caksoylar marked this conversation as resolved.
Show resolved Hide resolved
```
nice_view_spi: &spi0 {
cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
};
```

Save your changes and close the file.

### Sample Build Commands for nice!view Displays

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"
```

Build commands for the default keymap of Leeloo v2:

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_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"
```

Build command for your custom keymap of Leeloo:
Build commands for your custom keymap of Leeloo v2:

west build -d build/right -p -b nice_nano_v2 -- -DSHIELD=leeloo_right -DZMK_CONFIG="C:/dev/zmk/[yourNmae]/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/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"
```

# Support

Expand Down
47 changes: 47 additions & 0 deletions app/boards/shields/leeloo/boards/nice_nano_v2.overlay
@@ -0,0 +1,47 @@
#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";
label = "WS2812";

/* 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;
};
};
11 changes: 9 additions & 2 deletions app/boards/shields/leeloo/leeloo.conf
@@ -1,9 +1,16 @@
# Copyright (c) 2022 The ZMK Contributors
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

# Uncomment the following line to enable the OLED Display
# CONFIG_ZMK_DISPLAY=y

# Uncomment to turn off WPM Status.
# CONFIG_ZMK_WIDGET_WPM_STATUS=n

# Uncomment to invert colour when using nice!view Displays
# CONFIG_ZMK_DISPLAY_INVERT=y


# Uncomment these two lines to add support for encoders
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
85 changes: 2 additions & 83 deletions app/boards/shields/leeloo/leeloo.dtsi
@@ -1,87 +1,6 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* Copyright (c) 2023 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
rows = <5>;
// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 |
// | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 | SW29 | | SW29 | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 |
// | SW25 | SW26 | SW27 | SW28 | | SW28 | SW27 | SW26 | SW25 |
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
};

right_encoder: encoder_right {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
};

sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
};
};

&pro_micro_i2c {
status = "okay";

oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
prechargep = <0x22>;
};
};
#include "leeloo_common.dtsi"