diff --git a/app/boards/shields/revlp/Kconfig.defconfig b/app/boards/shields/revlp/Kconfig.defconfig new file mode 100644 index 00000000..ab2c2f69 --- /dev/null +++ b/app/boards/shields/revlp/Kconfig.defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_REVLP + +config ZMK_KEYBOARD_NAME + default "revlp" + +if ZMK_BACKLIGHT + +config LED_GPIO + default y + +endif # ZMK_BACKLIGHT + +endif diff --git a/app/boards/shields/revlp/Kconfig.shield b/app/boards/shields/revlp/Kconfig.shield new file mode 100644 index 00000000..114bfb30 --- /dev/null +++ b/app/boards/shields/revlp/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_REVLP + def_bool $(shields_list_contains,revlp) diff --git a/app/boards/shields/revlp/boards/nice_nano_v2.conf b/app/boards/shields/revlp/boards/nice_nano_v2.conf new file mode 100644 index 00000000..32190ef9 --- /dev/null +++ b/app/boards/shields/revlp/boards/nice_nano_v2.conf @@ -0,0 +1,2 @@ +CONFIG_PWM=y +CONFIG_LED_PWM=y diff --git a/app/boards/shields/revlp/boards/nice_nano_v2.overlay b/app/boards/shields/revlp/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..626bc33c --- /dev/null +++ b/app/boards/shields/revlp/boards/nice_nano_v2.overlay @@ -0,0 +1,20 @@ +&pwm0 { + status = "okay"; + ch0-pin = <9>; + /* ch0-inverted; */ +}; + +/ { + pwm_backlight: pwmleds { + compatible = "pwm-leds"; + label = "Backlight LEDs"; + pwm_led_0 { + pwms = <&pwm0 45>; + label = "Backlight LED 0"; + }; + }; + + chosen { + zmk,backlight = &pwm_backlight; + }; +}; diff --git a/app/boards/shields/revlp/revlp.conf b/app/boards/shields/revlp/revlp.conf new file mode 100644 index 00000000..289f070b --- /dev/null +++ b/app/boards/shields/revlp/revlp.conf @@ -0,0 +1,3 @@ +# Uncomment the following lines to enable RGB underglow +# CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y diff --git a/app/boards/shields/revlp/revlp.keymap b/app/boards/shields/revlp/revlp.keymap new file mode 100644 index 00000000..af74a812 --- /dev/null +++ b/app/boards/shields/revlp/revlp.keymap @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include + + +#define NAV_L 1 +#define OTH_L 2 +#define NUM_L 3 +#define SYM_L 4 +#define FUN_L 5 +#define MED_L 6 +/ { + combos { + compatible = "zmk,combos"; + + caps_word_combo { + timeout-ms = <50>; + key-positions = <16 19>; + bindings = <&caps_word>; + }; + }; + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "homerow mods"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------------------------------------------------------------------------- +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP | +// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHFT | Z | X | C | V | B | | N | M | , | . | / | SHFT(RET) | +// | ALT | LWR | SPC | RSE | ALT | + bindings = < +&bl BL_TOG &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp QUOT &bootloader +&none &hm LGUI A &hm LALT R &hm LCTRL S &hm LSHFT T &kp G &kp M &hm RSHFT N &hm RCTRL E &hm LALT I &hm LGUI O &none +&none &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH &none + < NAV_L TAB < OTH_L RET &kp RET < NUM_L SPACE < SYM_L BKSP + >; + }; + + nav_layer { + label = "Nav"; + bindings = < +&none &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &none +&none &trans &trans &trans &trans &trans &trans &kp LARW &kp DARW &kp UARW &kp RARW &none +&none &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END &none + &trans &trans &trans &kp ESC &kp DEL + >; + }; + + other_layer { + label = "Other"; + bindings = < +&none &trans &trans &trans &trans &trans &trans &trans &trans &trans &bt BT_CLR &none +&none &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &none +&none &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 &none + &trans &trans &trans &trans &trans + >; + }; + + num_layer { + label = "Num"; + bindings = < +&none &kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &trans &trans &trans &trans &trans &none +&none &kp SEMI &kp N4 &kp N5 &kp N6 &kp EQUAL &trans &trans &trans &trans &trans &none +&none &kp GRAVE &kp N1 &kp N2 &kp N3 &kp BSLH &trans &trans &trans &trans &trans &none + &kp N0 &kp MINUS &trans &trans &trans + >; + }; + + sym_layer { + label = "Sym"; + bindings = < +&none &kp LBRC &kp LS(N7) &kp LS(N8) &kp LS(N9) &kp RBRC &trans &trans &trans &trans &trans &none +&none &kp COLON &kp LS(N4) &kp LS(N5) &kp LS(N6) &kp PLUS &trans &trans &trans &trans &trans &none +&none &kp TILDE &kp LS(N1) &kp LS(N2) &kp LS(N3) &kp LS(BSLH) &trans &trans &trans &trans &trans &none + &kp LS(N0) &kp UNDER &trans &trans &trans + >; + }; + + }; +}; diff --git a/app/boards/shields/revlp/revlp.overlay b/app/boards/shields/revlp/revlp.overlay new file mode 100644 index 00000000..226db682 --- /dev/null +++ b/app/boards/shields/revlp/revlp.overlay @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + zmk,backlight = &backlight; + }; + + backlight: leds { + compatible = "gpio-leds"; + led_mosfet { + gpios = <&pro_micro 10 GPIO_ACTIVE_HIGH>; + label = "Backlight LED 0"; + }; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <6>; + rows = <7>; + + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) +RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(5,0) RC(5,1) RC(5,2) RC(5,3) RC(5,4) RC(5,5) + RC(6,0) RC(6,1) RC(6,2) RC(6,3) RC(6,4) + >; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 6 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + , <&pro_micro 8 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; diff --git a/app/boards/shields/revlp/revlp.zmk.yml b/app/boards/shields/revlp/revlp.zmk.yml new file mode 100644 index 00000000..34895ed0 --- /dev/null +++ b/app/boards/shields/revlp/revlp.zmk.yml @@ -0,0 +1,9 @@ +file_format: "1" +id: revlp +name: revlp +type: shield +url: https://github.com/cyril279/keyboards/tree/main/revlp +requires: [pro_micro] +features: + - keys + - backlight