diff options
Diffstat (limited to 'app/boards/shields')
7 files changed, 143 insertions, 0 deletions
diff --git a/app/boards/shields/petejohanson_handwire/Kconfig.defconfig b/app/boards/shields/petejohanson_handwire/Kconfig.defconfig new file mode 100644 index 0000000..7da09ac --- /dev/null +++ b/app/boards/shields/petejohanson_handwire/Kconfig.defconfig @@ -0,0 +1,13 @@ + +if SHIELD_PETEJOHANSON_HANDWIRE + +config ZMK_KEYBOARD_NAME + default "Pete's Handwire Breadboard" + +config ZMK_BLE + default y + +config ZMK_ACTION_MOD_TAP + default y + +endif diff --git a/app/boards/shields/petejohanson_handwire/Kconfig.shield b/app/boards/shields/petejohanson_handwire/Kconfig.shield new file mode 100644 index 0000000..f6e8a3f --- /dev/null +++ b/app/boards/shields/petejohanson_handwire/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2019 Linaro Limited +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_PETEJOHANSON_HANDWIRE + def_bool $(shields_list_contains,petejohanson_handwire) diff --git a/app/boards/shields/petejohanson_handwire/keymaps/default/include/keymap.h b/app/boards/shields/petejohanson_handwire/keymaps/default/include/keymap.h new file mode 100644 index 0000000..01cd9e5 --- /dev/null +++ b/app/boards/shields/petejohanson_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_handwire/keymaps/default/keymap.c b/app/boards/shields/petejohanson_handwire/keymaps/default/keymap.c new file mode 100644 index 0000000..067cd08 --- /dev/null +++ b/app/boards/shields/petejohanson_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_handwire/keymaps/default/keymap.overlay b/app/boards/shields/petejohanson_handwire/keymaps/default/keymap.overlay new file mode 100644 index 0000000..d87363f --- /dev/null +++ b/app/boards/shields/petejohanson_handwire/keymaps/default/keymap.overlay @@ -0,0 +1,41 @@ +#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) ZC_NO ZC_NO + CC_RAIS CC_LOWR ZC_NO ZC_NO + >; + }; + + lower: layer_1 { + label = "LOWER"; + keys = < + KC_MPLY KC_MNXT ZC_NO ZC_NO + ZC_TRNS ZC_TRNS ZC_NO ZC_NO + >; + }; + + raise: layer_2 { + label = "RAISE"; + keys = < + KC_C KC_D ZC_NO ZC_NO + ZC_TRNS ZC_TRNS ZC_NO ZC_NO>; + }; + }; +}; diff --git a/app/boards/shields/petejohanson_handwire/petejohanson_handwire.conf b/app/boards/shields/petejohanson_handwire/petejohanson_handwire.conf new file mode 100644 index 0000000..63829ba --- /dev/null +++ b/app/boards/shields/petejohanson_handwire/petejohanson_handwire.conf @@ -0,0 +1 @@ +CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER=y diff --git a/app/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay b/app/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay new file mode 100644 index 0000000..d65b3b1 --- /dev/null +++ b/app/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay @@ -0,0 +1,44 @@ + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-composite"; + label = "KSCAN_COMP"; + rows = <2>; + columns = <4>; + + left { + kscan = <&left_hand>; + }; + + right { + kscan = <&right_hand>; + column-offset = <2>; + }; + }; + + left_hand: kscan_1 { + compatible = "gpio-kscan"; + label = "KSCAN_LEFT"; + + diode-direction = "row2col"; + row-gpios = <&arduino_header 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + col-gpios = <&arduino_header 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + right_hand: kscan_2 { + compatible = "gpio-kscan"; + label = "KSCAN_RIGHT"; + + diode-direction = "row2col"; + row-gpios = <&arduino_header 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + col-gpios = <&arduino_header 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; +}; |