Browse Source

Merge pull request #198 from reizero00/romac_plus

RoMac+ v4 Support for nice!nano v1
xmkb
Pete Johanson 4 years ago committed by GitHub
parent
commit
6ecf62a9ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/workflows/build.yml
  2. 9
      app/boards/shields/romac_plus/Kconfig.defconfig
  3. 5
      app/boards/shields/romac_plus/Kconfig.shield
  4. 28
      app/boards/shields/romac_plus/boards/nice_nano.overlay
  5. 6
      app/boards/shields/romac_plus/romac_plus.conf
  6. 56
      app/boards/shields/romac_plus/romac_plus.dtsi
  7. 49
      app/boards/shields/romac_plus/romac_plus.keymap
  8. 37
      app/boards/shields/romac_plus/romac_plus.overlay

1
.github/workflows/build.yml

@ -19,6 +19,7 @@ jobs:
- iris_left - iris_left
- iris_right - iris_right
- romac - romac
- romac_plus
- settings_reset - settings_reset
include: include:
- board: proton_c - board: proton_c

9
app/boards/shields/romac_plus/Kconfig.defconfig

@ -0,0 +1,9 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_ROMAC_PLUS
config ZMK_KEYBOARD_NAME
default "RoMac+ v4"
endif

5
app/boards/shields/romac_plus/Kconfig.shield

@ -0,0 +1,5 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_ROMAC_PLUS
def_bool $(shields_list_contains,romac_plus)

28
app/boards/shields/romac_plus/boards/nice_nano.overlay

@ -0,0 +1,28 @@
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
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 = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

6
app/boards/shields/romac_plus/romac_plus.conf

@ -0,0 +1,6 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
# Uncomment to enable encoder
#CONFIG_EC11=y
#CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

56
app/boards/shields/romac_plus/romac_plus.dtsi

@ -0,0 +1,56 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix-transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <3>;
rows = <4>;
map = <
RC(0,0) RC(0,1) RC(0,2)
RC(1,0) RC(1,1) RC(1,2)
RC(2,0) RC(2,1) RC(2,2)
RC(3,0) RC(3,1) RC(3,2)
>;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
row-gpios
= <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
a-gpios = <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro_d 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
resolution = <4>;
status = "disabled";
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder>;
};
// TODO: per-key RGB node(s)?
};

49
app/boards/shields/romac_plus/romac_plus.keymap

@ -0,0 +1,49 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// --------------------------
// | 7 | 8 | 9 |
// | 4 | 5 | 6 |
// | 1 | 2 | 3 |
// | M_PLAY | 0 | MO(1) |
// --------------------------
bindings = <
&kp NUM_7 &kp NUM_8 &kp NUM_9
&kp NUM_4 &kp NUM_5 &kp NUM_6
&kp NUM_1 &kp NUM_2 &kp NUM_3
&cp M_PLAY &kp NUM_0 &mo 1
>;
sensor-bindings = <&inc_dec_cp M_NEXT M_PREV>;
};
nav_layer {
// --------------------------
// | BT_CLR | HOME | PGUP |
// | _ | END | PGDN |
// | _ | _ | _ |
// | _ | _ | _ |
// --------------------------
bindings = <
&bt BT_CLR &kp HOME &kp PGUP
&trans &kp END &kp PGDN
&trans &trans &trans
&trans &trans &trans
>;
sensor-bindings = <&inc_dec_kp A B>;
};
};
};

37
app/boards/shields/romac_plus/romac_plus.overlay

@ -0,0 +1,37 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include "romac_plus.dtsi"
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 2 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 3 GPIO_ACTIVE_HIGH>
;
};
bt_unpair_combo: bt_unpair_combo {
compatible = "zmk,bt-unpair-combo";
key-positions = <0 11>;
};
};
&left_encoder {
status = "okay";
};
Loading…
Cancel
Save