forked from kofal.net/zmk
Move Zephyr app into subdirectory.
This commit is contained in:
13
app/boards/shields/petejohanson_handwire/Kconfig.defconfig
Normal file
13
app/boards/shields/petejohanson_handwire/Kconfig.defconfig
Normal file
@@ -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
|
||||
5
app/boards/shields/petejohanson_handwire/Kconfig.shield
Normal file
5
app/boards/shields/petejohanson_handwire/Kconfig.shield
Normal file
@@ -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)
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
|
||||
#define CC_RAIS ZC_CSTM(1)
|
||||
#define CC_LOWR ZC_CSTM(2)
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER=y
|
||||
@@ -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)>;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user