diff options
author | iangus <iangus97@gmail.com> | 2022-01-30 14:48:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 13:48:35 -0600 |
commit | 4039a50ec344bff10d9798a350e244351ec02f8b (patch) | |
tree | 57dcf462c0c47f89847ddd23031cd16db6fb6489 | |
parent | 2ad8f687c05dcbe2cc759a01174263d641554d16 (diff) |
Add Contra shield (#633)
* Add Contra Shield (#1)
* Add bluetooth control layer to contra keymap (#2)
* fix contra keymap issues
* add bluetooth control layer
* clean up contra files
* add contra.conf file
* add missing bracket for default_layer
* update copyright year to 2021
* add contra metadata file
* refactor pro micro overlay for new syntax
-rw-r--r-- | app/boards/shields/contra/Kconfig.defconfig | 9 | ||||
-rw-r--r-- | app/boards/shields/contra/Kconfig.shield | 5 | ||||
-rw-r--r-- | app/boards/shields/contra/contra.conf | 0 | ||||
-rw-r--r-- | app/boards/shields/contra/contra.keymap | 46 | ||||
-rw-r--r-- | app/boards/shields/contra/contra.overlay | 39 | ||||
-rw-r--r-- | app/boards/shields/contra/contra.zmk.yml | 8 |
6 files changed, 107 insertions, 0 deletions
diff --git a/app/boards/shields/contra/Kconfig.defconfig b/app/boards/shields/contra/Kconfig.defconfig new file mode 100644 index 0000000..8fde097 --- /dev/null +++ b/app/boards/shields/contra/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_CONTRA + +config ZMK_KEYBOARD_NAME + default "Contra Keyboard" + +endif
\ No newline at end of file diff --git a/app/boards/shields/contra/Kconfig.shield b/app/boards/shields/contra/Kconfig.shield new file mode 100644 index 0000000..59412ff --- /dev/null +++ b/app/boards/shields/contra/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2021 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_CONTRA + def_bool $(shields_list_contains,contra)
\ No newline at end of file diff --git a/app/boards/shields/contra/contra.conf b/app/boards/shields/contra/contra.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/boards/shields/contra/contra.conf diff --git a/app/boards/shields/contra/contra.keymap b/app/boards/shields/contra/contra.keymap new file mode 100644 index 0000000..e24b502 --- /dev/null +++ b/app/boards/shields/contra/contra.keymap @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include <behaviors.dtsi> +#include <dt-bindings/zmk/keys.h> +#include <dt-bindings/zmk/bt.h> + +#define DEFAULT 0 +#define NUM_MODS 1 +#define BT_CTRL 2 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC + &kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ENTER + &kp LCTRL &kp LGUI &kp LALT &kp BSLH &to DEFAULT &kp SPACE &trans &to NUM_MODS &kp LEFT &kp RIGHT &kp UP &kp DOWN + >; + }; + + num_mods { + bindings = < + &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL + &kp TAB &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp MINUS &kp PG_UP &kp LBKT &kp RBKT &kp BSLH + &kp LSHFT &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp EQUAL &kp PG_DN &kp HOME &kp END &kp ENTER + &kp LCTRL &kp LGUI &kp LALT &reset &to DEFAULT &kp SPACE &trans &mo BT_CTRL &kp LEFT &kp RIGHT &kp UP &kp DOWN + >; + }; + + bt_control { + bindings = < + &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 &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 &bt BT_PRV &bt BT_NXT &trans &trans + >; + }; + }; +};
\ No newline at end of file diff --git a/app/boards/shields/contra/contra.overlay b/app/boards/shields/contra/contra.overlay new file mode 100644 index 0000000..21e1942 --- /dev/null +++ b/app/boards/shields/contra/contra.overlay @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + col-gpios + = <&pro_micro 21 GPIO_ACTIVE_HIGH> + , <&pro_micro 20 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + , <&pro_micro 8 GPIO_ACTIVE_HIGH> + , <&pro_micro 7 GPIO_ACTIVE_HIGH> + , <&pro_micro 6 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 3 GPIO_ACTIVE_HIGH> + , <&pro_micro 2 GPIO_ACTIVE_HIGH> + , <&pro_micro 0 GPIO_ACTIVE_HIGH> + , <&pro_micro 1 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +};
\ No newline at end of file diff --git a/app/boards/shields/contra/contra.zmk.yml b/app/boards/shields/contra/contra.zmk.yml new file mode 100644 index 0000000..da3a944 --- /dev/null +++ b/app/boards/shields/contra/contra.zmk.yml @@ -0,0 +1,8 @@ +file_format: "1" +id: contra +name: Contra +type: shield +url: https://github.com/ai03-2725/Contra +requires: [pro_micro] +features: + - keys |