feat(shields): Add a Reviung5 shield
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
This commit is contained in:
parent
6e99a48696
commit
58f8c97d3c
6 changed files with 117 additions and 0 deletions
9
app/boards/shields/reviung5/Kconfig.defconfig
Normal file
9
app/boards/shields/reviung5/Kconfig.defconfig
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
if SHIELD_REVIUNG5
|
||||||
|
|
||||||
|
config ZMK_KEYBOARD_NAME
|
||||||
|
default "Reviung5"
|
||||||
|
|
||||||
|
endif
|
4
app/boards/shields/reviung5/Kconfig.shield
Normal file
4
app/boards/shields/reviung5/Kconfig.shield
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Copyright (c) 2022 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
config SHIELD_REVIUNG5
|
||||||
|
def_bool $(shields_list_contains,reviung5)
|
3
app/boards/shields/reviung5/reviung5.conf
Normal file
3
app/boards/shields/reviung5/reviung5.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Encoder support. Uncomment to enable.
|
||||||
|
# CONFIG_EC11=y
|
||||||
|
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
38
app/boards/shields/reviung5/reviung5.keymap
Normal file
38
app/boards/shields/reviung5/reviung5.keymap
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <dt-bindings/zmk/bt.h>
|
||||||
|
#include <dt-bindings/zmk/outputs.h>
|
||||||
|
|
||||||
|
#define BASE 0
|
||||||
|
#define BLE 1
|
||||||
|
|
||||||
|
/ {
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
|
||||||
|
base_layer {
|
||||||
|
label = "BASE";
|
||||||
|
bindings = <
|
||||||
|
// ╭─────────────┬──────────────┬──────────────────┬─────────────┬─────────────╮
|
||||||
|
&mo BLE &kp C_PREVIOUS &kp C_PLAY_PAUSE &kp C_NEXT &kp C_MUTE
|
||||||
|
// ╰─────────────┴──────────────┴──────────────────┴─────────────┴─────────────╯
|
||||||
|
>;
|
||||||
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||||
|
};
|
||||||
|
|
||||||
|
ble_layer {
|
||||||
|
label = "BLE";
|
||||||
|
bindings = <
|
||||||
|
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
|
||||||
|
&trans &out OUT_TOG &bt BT_PRV &bt BT_NXT &bt BT_CLR
|
||||||
|
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
54
app/boards/shields/reviung5/reviung5.overlay
Normal file
54
app/boards/shields/reviung5/reviung5.overlay
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 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 = <5>;
|
||||||
|
rows = <1>;
|
||||||
|
|
||||||
|
map = <RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,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>
|
||||||
|
;
|
||||||
|
|
||||||
|
row-gpios
|
||||||
|
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
encoder: encoder {
|
||||||
|
compatible = "alps,ec11";
|
||||||
|
label = "encoder";
|
||||||
|
a-gpios = <&pro_micro 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
b-gpios = <&pro_micro 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
resolution = <4>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
sensors {
|
||||||
|
compatible = "zmk,keymap-sensors";
|
||||||
|
sensors = <&encoder>;
|
||||||
|
};
|
||||||
|
};
|
9
app/boards/shields/reviung5/reviung5.zmk.yml
Normal file
9
app/boards/shields/reviung5/reviung5.zmk.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
file_format: "1"
|
||||||
|
id: reviung5
|
||||||
|
name: REVIUNG5
|
||||||
|
type: shield
|
||||||
|
url: https://github.com/gtips/reviung/tree/master/reviung5
|
||||||
|
requires: [pro_micro]
|
||||||
|
features:
|
||||||
|
- keys
|
||||||
|
- encoder
|
Loading…
Add table
Reference in a new issue