Browse Source

Initial handwire proton-c shield for testing.

xmkb
Pete Johanson 5 years ago
parent
commit
0ee01390bd
  1. 13
      app/boards/shields/petejohanson_proton_handwire/Kconfig.defconfig
  2. 5
      app/boards/shields/petejohanson_proton_handwire/Kconfig.shield
  3. 5
      app/boards/shields/petejohanson_proton_handwire/keymaps/default/include/keymap.h
  4. 34
      app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.c
  5. 42
      app/boards/shields/petejohanson_proton_handwire/keymaps/default/keymap.overlay
  6. 0
      app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf
  7. 17
      app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay

13
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

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

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

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

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

0
app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.conf

17
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)>;
};
};
Loading…
Cancel
Save