summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-06-11 23:38:04 -0400
committerPete Johanson <peter@peterjohanson.com>2020-06-11 23:38:04 -0400
commit0ee01390bd07f43462e2ef54df9d8ae42b49dede (patch)
treebe444792243596add24f32205caadd866773cff4 /app
parent7614e7e52bd2fbed9d878e1618363586fb44385d (diff)
Initial handwire proton-c shield for testing.
Diffstat (limited to 'app')
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/Kconfig.defconfig13
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/Kconfig.shield5
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/keymaps/default/include/keymap.h5
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.c34
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.overlay42
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf0
-rw-r--r--app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay17
7 files changed, 116 insertions, 0 deletions
diff --git a/app/boards/shields/petejohanson_proton_handwire/Kconfig.defconfig b/app/boards/shields/petejohanson_proton_handwire/Kconfig.defconfig
new file mode 100644
index 0000000..196c636
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/Kconfig.defconfig
@@ -0,0 +1,13 @@
+
+if SHIELD_PETEJOHANSON_PROTON_HANDWIRE
+
+config ZMK_KEYBOARD_NAME
+ default "Pete's Proton Handwire"
+
+config ZMK_USB
+ default y
+
+config ZMK_ACTION_MOD_TAP
+ default y
+
+endif
diff --git a/app/boards/shields/petejohanson_proton_handwire/Kconfig.shield b/app/boards/shields/petejohanson_proton_handwire/Kconfig.shield
new file mode 100644
index 0000000..e43f57d
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/Kconfig.shield
@@ -0,0 +1,5 @@
+# Copyright (c) 2020 Pete Johanson
+# SPDX-License-Identifier: MIT
+
+config SHIELD_PETEJOHANSON_PROTON_HANDWIRE
+ def_bool $(shields_list_contains,petejohanson_proton_handwire)
diff --git a/app/boards/shields/petejohanson_proton_handwire/keymaps/default/include/keymap.h b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/include/keymap.h
new file mode 100644
index 0000000..01cd9e5
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/include/keymap.h
@@ -0,0 +1,5 @@
+
+#include <dt-bindings/zmk/keys.h>
+
+#define CC_RAIS ZC_CSTM(1)
+#define CC_LOWR ZC_CSTM(2) \ No newline at end of file
diff --git a/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.c b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.c
new file mode 100644
index 0000000..067cd08
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.c
@@ -0,0 +1,34 @@
+
+#include <zmk/keys.h>
+#include <zmk/keymap.h>
+#include <keymap.h>
+
+bool zmk_handle_key_user(struct zmk_key_event *key_event)
+{
+ switch (key_event->key)
+ {
+ case CC_LOWR:
+ if (key_event->pressed)
+ {
+ zmk_keymap_layer_activate(1);
+ }
+ else
+ {
+ zmk_keymap_layer_deactivate(1);
+ }
+
+ return false;
+ case CC_RAIS:
+ if (key_event->pressed)
+ {
+ zmk_keymap_layer_activate(2);
+ }
+ else
+ {
+ zmk_keymap_layer_deactivate(2);
+ }
+ return false;
+ }
+
+ return true;
+};
diff --git a/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.overlay b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.overlay
new file mode 100644
index 0000000..c1bd542
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.overlay
@@ -0,0 +1,42 @@
+#include <dt-bindings/zmk/keys.h>
+#include <keymap.h>
+
+/ {
+ chosen {
+ zmk,keymap = &keymap0;
+ };
+ keymap0: keymap {
+ compatible = "zmk,keymap";
+ label ="Default keymap";
+ layers = <&default &lower &raise>;
+ };
+
+ layers {
+ compatible = "zmk,layers";
+
+ default: layer_0 {
+ label = "DEFAULT";
+ keys =
+ <
+ KC_A MT(MOD_LSFT, KC_B)
+ CC_RAIS CC_LOWR
+ >;
+ };
+
+ lower: layer_1 {
+ label = "LOWER";
+ keys = <
+ KC_MPLY KC_MNXT
+ ZC_TRNS ZC_TRNS
+ >;
+ };
+
+ raise: layer_2 {
+ label = "RAISE";
+ keys = <
+ KC_C KC_D
+ ZC_TRNS ZC_TRNS
+ >;
+ };
+ };
+};
diff --git a/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf b/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf
diff --git a/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay b/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay
new file mode 100644
index 0000000..5deaa42
--- /dev/null
+++ b/app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay
@@ -0,0 +1,17 @@
+
+/ {
+ chosen {
+ zmk,kscan = &kscan0;
+ };
+
+ kscan0: kscan {
+ compatible = "gpio-kscan";
+ label = "KSCAN";
+
+ diode-direction = "row2col";
+ row-gpios = <&pro_micro_pins 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
+ <&pro_micro_pins 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ col-gpios = <&pro_micro_pins 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
+ <&pro_micro_pins 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ };
+};