Skip to content

Commit

Permalink
Leeloo-Micro 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 d03848f commit b964048
Show file tree
Hide file tree
Showing 11 changed files with 558 additions and 0 deletions.
49 changes: 49 additions & 0 deletions app/boards/shields/leeloo_micro/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_LEELOO_MICRO_LEFT

config ZMK_KEYBOARD_NAME
default "Leeloo-Micro"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_LEELOO_MICRO

config ZMK_SPLIT
default y

if ZMK_DISPLAY

config I2C
default y

config SSD1306
default y

config SSD1306_REVERSE_MODE
default y

endif # ZMK_DISPLAY

if LVGL

config LV_Z_VDB_SIZE
default 64

config LV_Z_DPI
default 148

config LV_Z_BITS_PER_PIXEL
default 1

choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1
endchoice

endif # LVGL

endif
13 changes: 13 additions & 0 deletions app/boards/shields/leeloo_micro/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_LEELOO_MICRO
bool

config SHIELD_LEELOO_MICRO_LEFT
def_bool $(shields_list_contains,leeloo_micro_left)
select SHIELD_LEELOO_MICRO

config SHIELD_LEELOO_MICRO_RIGHT
def_bool $(shields_list_contains,leeloo_micro_right)
select SHIELD_LEELOO_MICRO
102 changes: 102 additions & 0 deletions app/boards/shields/leeloo_micro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Clickety Split | Leeloo-Micro

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

Keyboard Designer: [clicketysplit.ca](https://clicketysplit.ca)
GitHub: [ClicketySplit](https://github.com/ClicketySplit)
Hardware Supported: nice!nano v2, nice!view v1

Leeloo-Micro is a 3x5x5m derivative of Leeloo v2; inheriting the column stagger and modifiers row, yet, reducing the number of switches by removing the top row and outside columns. With Leeloo-Micro's inaugural release being wireless, it leverages nice!nanos and nice!views for its microcontrollers and displays.

## Features
* 3x5x5m Split Keyboard
* Support for Kailh Low Profile Choc switches with 18mm x 18mm spacing.
* All switch locations are socketed.
* Support for Alps Alpine EC11 Rotary Encoders—one on each side, in one of two locations.
- Rotary encoder locations are socketed.
* nice!view Displays are inherently supported, socketed, and no extra wiring is required.
* Support for per-switch RGB underglow.
* Support for both 110mAh or 700mAh batteries.
* Support for Alps Alpine Micro On/off switches.

# Building Leeloo-Micro 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 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
```

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/[yourNmae]/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"
```

## Building Leeloo-Micro'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_micro.keymap File
Near the top 3rd of the leeloo_micro.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_micro.conf file:
Near the top of the leeloo_micro.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.

### Sample Build Commands for nice!view Displays
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"
```

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/[yourNmae]/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/[yourNmae]/leeloo_micro/config"
```

# Support
If you have any questions with regards to Leeloo-Micro, please [Contact Us](https://clicketysplit.ca/pages/contact-us).

Clickety Split
For the love of split keyboards.
47 changes: 47 additions & 0 deletions app/boards/shields/leeloo_micro/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 = <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;
};
};
38 changes: 38 additions & 0 deletions app/boards/shields/leeloo_micro/leeloo_micro.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT

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

# Turn off LEDs when idle.
# Change to n if you wish to keep LEDs on even when idle.
# CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y

# When USB is disconnected, turn off LEDs
# Change to n if you wish to keep LEDs on even when USB is unpluged.
# CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_USB=y

# Start LEDs off at 75%
# CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=75


# Uncomment these two lines to add support for encoders
# CONFIG_EC11=y
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
6 changes: 6 additions & 0 deletions app/boards/shields/leeloo_micro/leeloo_micro.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) 2022 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/

#include "leeloo_micro_common.dtsi"
Loading

0 comments on commit b964048

Please sign in to comment.