Initial handwire proton-c shield for testing.

This commit is contained in:
Pete Johanson 2020-06-11 23:38:04 -04:00
parent 7614e7e52b
commit 0ee01390bd
7 changed files with 116 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

@ -0,0 +1,5 @@
#include <dt-bindings/zmk/keys.h>
#define CC_RAIS ZC_CSTM(1)
#define CC_LOWR ZC_CSTM(2)

View file

@ -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;
};

View file

@ -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
>;
};
};
};

View file

@ -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)>;
};
};