Skip to content

Commit

Permalink
add bleu60
Browse files Browse the repository at this point in the history
  • Loading branch information
mechlovin committed Oct 28, 2024
1 parent 8ed556d commit 5fd5eb5
Show file tree
Hide file tree
Showing 13 changed files with 469 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/boards/arm/bleu60/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Mechlovin'
# SPDX-License-Identifier: MIT

config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_BLEU60
6 changes: 6 additions & 0 deletions app/boards/arm/bleu60/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Mechlovin'
# SPDX-License-Identifier: MIT

config BOARD_BLEU60
bool "bleu60"
depends on SOC_NRF52840_QIAA
19 changes: 19 additions & 0 deletions app/boards/arm/bleu60/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2024 Mechlovin'
# SPDX-License-Identifier: MIT

if BOARD_BLEU60

config ZMK_KEYBOARD_NAME
default "bleu60"

if USB_DEVICE_STACK

config USB_NRFX
default y

endif # USB_DEVICE_STACK

config BT_CTLR
default BT

endif # BOARD_BLEU60
11 changes: 11 additions & 0 deletions app/boards/arm/bleu60/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# bleu60
![bleu60]()

The bleu60 base on Zed60 platform, power by ZMK firmware.
https://mechlovin.studio

## Building bleu60 ZMK firmware

```
west build -p -b bleu60
```
80 changes: 80 additions & 0 deletions app/boards/arm/bleu60/bleu60-layouts.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#include <physical_layouts.dtsi>
/ {
sixty_percent_ansi: sixty_percent_ansi {
compatible = "zmk,physical-layout";
display-name = "60% ANSI";
transform = <&sixty_percent_ansi_transform>;
keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 400 0 0 0 0>
, <&key_physical_attrs 100 100 500 0 0 0 0>
, <&key_physical_attrs 100 100 600 0 0 0 0>
, <&key_physical_attrs 100 100 700 0 0 0 0>
, <&key_physical_attrs 100 100 800 0 0 0 0>
, <&key_physical_attrs 100 100 900 0 0 0 0>
, <&key_physical_attrs 100 100 1000 0 0 0 0>
, <&key_physical_attrs 100 100 1100 0 0 0 0>
, <&key_physical_attrs 100 100 1200 0 0 0 0>
, <&key_physical_attrs 200 100 1300 0 0 0 0>
, <&key_physical_attrs 150 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 150 100 0 0 0>
, <&key_physical_attrs 100 100 250 100 0 0 0>
, <&key_physical_attrs 100 100 350 100 0 0 0>
, <&key_physical_attrs 100 100 450 100 0 0 0>
, <&key_physical_attrs 100 100 550 100 0 0 0>
, <&key_physical_attrs 100 100 650 100 0 0 0>
, <&key_physical_attrs 100 100 750 100 0 0 0>
, <&key_physical_attrs 100 100 850 100 0 0 0>
, <&key_physical_attrs 100 100 950 100 0 0 0>
, <&key_physical_attrs 100 100 1050 100 0 0 0>
, <&key_physical_attrs 100 100 1150 100 0 0 0>
, <&key_physical_attrs 100 100 1250 100 0 0 0>
, <&key_physical_attrs 150 100 1350 100 0 0 0>
, <&key_physical_attrs 175 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 175 200 0 0 0>
, <&key_physical_attrs 100 100 275 200 0 0 0>
, <&key_physical_attrs 100 100 375 200 0 0 0>
, <&key_physical_attrs 100 100 475 200 0 0 0>
, <&key_physical_attrs 100 100 575 200 0 0 0>
, <&key_physical_attrs 100 100 675 200 0 0 0>
, <&key_physical_attrs 100 100 775 200 0 0 0>
, <&key_physical_attrs 100 100 875 200 0 0 0>
, <&key_physical_attrs 100 100 975 200 0 0 0>
, <&key_physical_attrs 100 100 1075 200 0 0 0>
, <&key_physical_attrs 100 100 1175 200 0 0 0>
, <&key_physical_attrs 225 100 1275 200 0 0 0>
, <&key_physical_attrs 225 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 225 300 0 0 0>
, <&key_physical_attrs 100 100 325 300 0 0 0>
, <&key_physical_attrs 100 100 425 300 0 0 0>
, <&key_physical_attrs 100 100 525 300 0 0 0>
, <&key_physical_attrs 100 100 625 300 0 0 0>
, <&key_physical_attrs 100 100 725 300 0 0 0>
, <&key_physical_attrs 100 100 825 300 0 0 0>
, <&key_physical_attrs 100 100 925 300 0 0 0>
, <&key_physical_attrs 100 100 1025 300 0 0 0>
, <&key_physical_attrs 100 100 1125 300 0 0 0>
, <&key_physical_attrs 275 100 1225 300 0 0 0>
, <&key_physical_attrs 125 100 0 400 0 0 0>
, <&key_physical_attrs 125 100 125 400 0 0 0>
, <&key_physical_attrs 125 100 250 400 0 0 0>
, <&key_physical_attrs 625 100 375 400 0 0 0>
, <&key_physical_attrs 125 100 1000 400 0 0 0>
, <&key_physical_attrs 125 100 1125 400 0 0 0>
, <&key_physical_attrs 125 100 1250 400 0 0 0>
, <&key_physical_attrs 125 100 1375 400 0 0 0>
;
};
position_map {
compatible = "zmk,physical-layout-position-map";

ansi {
physical-layout = <&sixty_percent_ansi>;
positions = <61 13 52 62>;
};

};
};
19 changes: 19 additions & 0 deletions app/boards/arm/bleu60/bleu60-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2022 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/

&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 27)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 27)>;
low-power-enable;
};
};
};
177 changes: 177 additions & 0 deletions app/boards/arm/bleu60/bleu60.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/*
* Copyright (c) 2024 Mechlovin'
*
* SPDX-License-Identifier: MIT
*/

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>

#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>

#include <layouts/common/60percent/ansi.dtsi>

#include "bleu60-pinctrl.dtsi"

/ {
model = "bleu60";
compatible = "bleu,60";

chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,battery = &vbatt;
zmk,kscan = &kscan0;
zmk,physical-layout = &layout_60_ansi;
zmk,underglow = &led_strip;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <14>;
rows = <5>;
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(0,12) RC(0,13) RC(1,13)
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(1,12) RC(2,12)
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(2,13)
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(3,12) RC(3,13)
RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,10) RC(4,11) RC(4,12) RC(4,13)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
= <&gpio0 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 27 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
col-gpios
= <&gpio0 7 GPIO_ACTIVE_HIGH>
, <&gpio0 6 GPIO_ACTIVE_HIGH>
, <&gpio0 5 GPIO_ACTIVE_HIGH>
, <&gpio1 8 GPIO_ACTIVE_HIGH>
, <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 11 GPIO_ACTIVE_HIGH>
, <&gpio0 26 GPIO_ACTIVE_HIGH>
, <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio0 17 GPIO_ACTIVE_HIGH>
, <&gpio0 16 GPIO_ACTIVE_HIGH>
, <&gpio0 23 GPIO_ACTIVE_HIGH>
, <&gpio0 12 GPIO_ACTIVE_HIGH>
, <&gpio0 11 GPIO_ACTIVE_HIGH>
, <&gpio0 19 GPIO_ACTIVE_HIGH>
;
};

leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
};

// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
control-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 2>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};

&adc {
status = "okay";
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&spi3 {
compatible = "nordic,nrf-spim";

pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
status = "okay";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;

/* WS2812 */
chain-length = <12>; /* LED strip length */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

zephyr_udc0: &usbd {
status = "okay";
};

&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

sd_partition: partition@0 {
reg = <0x00000000 0x00001000>;
};

code_partition: partition@1000 {
reg = <0x00001000 0x000d3000>;
};

/*
* The flash starting at 0x000d4000 and ending at
* 0x000f3fff is reserved for use by the application.
*/

/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@d4000 {
reg = <0x000d4000 0x00020000>;
};

boot_partition: partition@f4000 {
reg = <0x000f4000 0x0000c000>;
};
};
};

&layout_60_ansi {
transform = <&default_transform>;
};
68 changes: 68 additions & 0 deletions app/boards/arm/bleu60/bleu60.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2024 Mechlovin'
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/bt.h>
#define DEFAULT 0
#define LOWER 1
#define RAISE 2
/ {
keymap {
compatible = "zmk,keymap";

default_layer {
// ------------------------------------------------------------------------------------------
// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC |DEL|
// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" |
// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT |
// | CTL | WIN | ALT | SPACE | ALT | WIN | MO(1) | CTL |
// ------------------------------------------------------------------------------------------
bindings = <
&kp ESC &kp N1 &studio_unlock &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL
&studio_unlock &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH
&lt LOWER CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET
&kp LSHFT &kp NON_US_HASH &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo RAISE
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RALT &kp RGUI &kp RCTRL
>;
};

2nd_layer {
// ------------------------------------------------------------------------------------------
// | boot | BT CLR | BT1 | BT2 | BT3 | BT4 | BT5 | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | UP | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | LEFT | DOWN | RGHT | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// ------------------------------------------------------------------------------------------
bindings = <
&kp GRAVE &bt BT_CLR &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 &kp UP &trans &bootloader &trans &kp INS &trans &trans &trans &trans &trans &trans &trans
&trans &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
>;
};

3nd_layer {
// ------------------------------------------------------------------------------------------
// | boot | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | TRNS |
// | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | VOL_DN | VOL_UP | PREV | NEXT | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
// | TRNS | TRNS | TRNS | PLAY/PAUS | TRNS | TRNS | TRNS | TRNS |
// ------------------------------------------------------------------------------------------
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp INS &kp HOME &kp PG_UP &trans
&trans &trans &kp C_VOL_DN &trans &trans &kp C_NEXT &trans &trans &trans &kp DEL &kp END &kp PG_DN &kp C_VOL_UP &trans
&trans &trans &trans &kp C_PP &trans &kp C_PREV &kp C_VOL_DN &kp K_NEXT
>;
};
};
};
Loading

0 comments on commit 5fd5eb5

Please sign in to comment.