Compare commits

..

2 commits

Author SHA1 Message Date
KemoNine 2b9253affb Rough implementation of a dongle form of the pockettype + mdk dongle 2020-12-31 18:14:47 +00:00
KemoNine 5217edc3a0 cleanup pockettype sources lightly 2020-12-31 17:34:45 +00:00
12 changed files with 214 additions and 7 deletions

View file

@ -3,4 +3,4 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
# #
target_sources(app PRIVATE pockettype_pwr_led.c) target_sources_ifdef(CONFIG_SHIELD_POCKETTYPE app PRIVATE pockettype_pwr_led.c)

View file

@ -4,12 +4,6 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h> #include <dt-bindings/zmk/matrix_transform.h>
/ { / {

View file

@ -0,0 +1,29 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if POCKETTYPE_CENTRAL
config ZMK_KEYBOARD_NAME
default "Pockettype Dongle"
config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y
endif
if POCKETTYPE_PERIPHERAL
config ZMK_KEYBOARD_NAME
default "Pockettype"
endif
if POCKETTYPE_CENTRAL || POCKETTYPE_PERIPHERAL
config ZMK_SPLIT
default y
config USB
default y
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config POCKETTYPE_CENTRAL
def_bool $(shields_list_contains,pockettype_central)
config POCKETTYPE_PERIPHERAL
def_bool $(shields_list_contains,pockettype_peripheral)

View file

@ -0,0 +1,7 @@
# WARNING
**WARNING** **DANGER** **WARNING**
THIS IS EXPERIMENTAL CODE IT SHOULD **NOT** BE USED IN ANY CAPACITY. ANY ATTEMPTS TO USE THIS CODE IS WHOLLY UNSUPPORTED AND VERY UNWISE.
YOU'VE BEEN WARNED!

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "pockettype_dongle.overlay"
/ {
kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>
;
};
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
};

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
/ {
behaviors {
rst: boot_reset {
compatible = "zmk,behavior-hold-tap";
label = "Hold Tap Bootloader-Reset";
#binding-cells = <2>;
tapping_term_ms = <150>;
flavor = "balanced";
bindings = <&bootloader>, <&reset>;
};
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&rst B R
&kp ESCAPE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp ENTER
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SQT &kp RSHFT
&kp LCTRL &kp LGUI &kp LALT &kp CAPS &mo 1 &kp DEL &kp SPACE &mo 2 &kp LEFT &kp UP &kp DOWN &kp RIGHT
>;
};
lower_layer {
bindings = <
&none
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL
&kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &trans &trans
&bt BT_CLR &bt BT_PRV &bt BT_NXT &trans &trans &kp LBKT &kp RBKT &kp SLASH &kp BSLH &kp PIPE &bootloader &reset
>;
};
raise_layer {
bindings = <
&none
&kp PRINTSCREEN &trans &trans &trans &trans &trans &trans &kp PG_UP &kp UP &kp PG_DN &trans &trans
&trans &trans &trans &trans &trans &trans &kp HOME &kp LEFT &kp DOWN &kp RIGHT &kp END &trans
&kp LC(Z) &kp LC(X) &kp LC(C) &kp LC(V) &trans &trans &trans &trans &trans &kp C_VOL_UP &kp C_VOL_DN &kp C_PP
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <13>;
rows = <4>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12)
RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12)
RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12)
RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,12)
>;
};
chosen {
zmk,matrix_transform = &default_transform;
};
};

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
#include "pockettype_dongle.overlay"
&default_transform {
col-offset = <1>;
};
/ {
leds {
compatible = "gpio-leds";
actled: led_a {
gpios = <&pro_micro_a 3 GPIO_ACTIVE_HIGH>;
label = "ACT LED";
};
powerled: led_p {
gpios = <&pro_micro_a 2 GPIO_ACTIVE_HIGH>;
label = "PWR LED";
};
};
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro_a 1 GPIO_ACTIVE_HIGH>
, <&pro_micro_a 0 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 15 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 14 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 16 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 10 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 8 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 7 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 5 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 4 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 3 GPIO_ACTIVE_HIGH>
, <&pro_micro_d 0 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
};