Skip to content

Commit

Permalink
Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ClicketySplit committed Apr 26, 2023
1 parent 0239f18 commit d03848f
Show file tree
Hide file tree
Showing 16 changed files with 541 additions and 26 deletions.
13 changes: 11 additions & 2 deletions app/boards/shields/leeloo/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Copyright (c) 2022 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
20 changes: 20 additions & 0 deletions app/boards/shields/leeloo/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_LEELOO
bool

config SHIELD_LEELOO_LEFT
<<<<<<< HEAD
def_bool $(shields_list_contains,leeloo_left)

config SHIELD_LEELOO_RIGHT
def_bool $(shields_list_contains,leeloo_right)
=======
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
>>>>>>> 69308eaf (Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2)
131 changes: 121 additions & 10 deletions app/boards/shields/leeloo/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# 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

<<<<<<< HEAD
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.
>>>>>>> 69308eaf (Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2)
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
* 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.

<<<<<<< HEAD
Features:

- 4x6x5m Split Keyboard
Expand All @@ -22,20 +37,116 @@ Features:

# Building Your Firmware

=======
# Leeloo v1

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

## Features
* 4x6x5m Split Keyboard
* 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 Leeloo's ZMK Firmware
>>>>>>> 69308eaf (Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2)
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/[yourNmae]/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/[yourNmae]/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 {
// compatible = "nordic,nrf-spim";
// pinctrl-0 = <&spi0_default>;
// pinctrl-1 = <&spi0_sleep>;
// pinctrl-names = "default", "sleep";
// cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
//};
```

Remove the forward slashes to resemble the following:
```
nice_view_spi: &spi0 {
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
};
```

Save your changes and close the file.

### Edit the leeloo[_rev2].conf file:
Near the top of the leeloo[_rev2].conf file, locate the following line items:

```
# Uncomment the following line to enable the OLED Display or nice!view Display
# CONFIG_ZMK_DISPLAY=y
```

Remove the # character in front of the CONFIG_ZMK_DISPLAY configuration item to resemble the following:
```
# Uncomment the following line to enable the OLED Display or nice!view Display
CONFIG_ZMK_DISPLAY=y
```

Save your changes and close the file.

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
### 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 command for your custom keymap of Leeloo:
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/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"
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/[yourNmae]/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/[yourNmae]/leeloo_v2/config"
```

# Support

Expand Down
47 changes: 47 additions & 0 deletions app/boards/shields/leeloo/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

# Uncomment the following line to enable the OLED Display
# Uncomment the following line to enable the OLED Display or nice!view Display
# CONFIG_ZMK_DISPLAY=y

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

# Uncomment to invert colour, if using nice!view Displays
# CONFIG_LVGL_USE_THEME_MONO=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
6 changes: 5 additions & 1 deletion app/boards/shields/leeloo/leeloo.dtsi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
<<<<<<< HEAD
#include <dt-bindings/zmk/matrix_transform.h>

/ {
Expand Down Expand Up @@ -85,3 +85,7 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7)
prechargep = <0x22>;
};
};
=======

#include "leeloo_common.dtsi"
>>>>>>> 69308eaf (Leeloo v2 and Leeloo v1 updates to support Zephyr 3.2)
36 changes: 27 additions & 9 deletions app/boards/shields/leeloo/leeloo.keymap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/keys.h>
Expand All @@ -13,46 +13,64 @@
#define LOWER 1 // lower_layer
#define RAISE 2 // raise_layer

/*
* Assign the cs-gpios pin to 4.
* Uncomment these next few lines if implementing nice!view Displays
* A wire from the nice!view CS display needs to be connected to the
* High Frequency P0.22, also known as D4 if you choose to refer to
* the pins with Arduino Labels.
*/
//nice_view_spi: &spi0 {
// compatible = "nordic,nrf-spim";
// pinctrl-0 = <&spi0_default>;
// pinctrl-1 = <&spi0_sleep>;
// pinctrl-names = "default", "sleep";
// cs-gpios = <&pro_micro 4 GPIO_ACTIVE_HIGH>;
//};

/ {

keymap {
compatible = "zmk,keymap";

default_layer {
label = " QWERTY";
bindings = <
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSLH
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp GRAV
&kp CAPS &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&kp LALT &kp LCTRL &lt 1 RET &lt 2 MINUS &kp LGUI &kp LGUI &lt 2 EQUAL &lt 1 SPACE &kp BSPC &kp DEL
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LGUI &kp LGUI &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&kp LALT &kp LCTRL &lt 1 RET &lt 2 MINUS &lt 2 EQUAL &lt 1 SPACE &kp BSPC &kp DEL
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};

lower_layer {
label = " Lower";
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &trans &trans &trans &trans &kp PG_UP &kp HOME &kp UP &kp END &trans &kp F12
&trans &trans &trans &trans &trans &trans &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};

raise_layer {
label = " Raise";
bindings = <
&trans &trans &trans &trans &trans &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &sys_reset &bootloader
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &sys_reset &bootloader
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &bt BT_CLR &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &bt BT_CLR &trans
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};

};
};
};
Loading

0 comments on commit d03848f

Please sign in to comment.