Update pockettype setup / cleanup older dongle code that will be put together differently

This commit is contained in:
KemoNine 2020-12-31 04:26:13 +00:00
parent 4bab811ea0
commit 440b6063f1
10 changed files with 28 additions and 97 deletions

View file

@ -12,13 +12,9 @@ west build --board nrf52840_mdk_dongle -d build/mdk_dongle -- -DSHIELD=mdk_dongl
west build --board nice_nano -d build/tidbit -- -DSHIELD=tidbit -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/pockettype/default -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/pockettype -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/pockettype/peripheral -- -DSHIELD=pockettype_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/tg4x/default -- -DSHIELD=tg4x -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/tg4x/peripheral -- -DSHIELD=tg4x_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/tg4x -- -DSHIELD=tg4x -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
west build --board nice_nano -d build/lily58/left -- -DSHIELD=lily58_left -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config

View file

@ -4,4 +4,3 @@
#
target_sources(app PRIVATE pockettype_pwr_led.c)
target_sources(app PRIVATE mdk_pwr_led.c)

View file

@ -3,24 +3,3 @@
Standard setup for the [PocketType!](https://mechboards.co.uk/shop/kits/pockettype/) mini keyboard.
The `keymap` directory contains the keyboard layout and were created by [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/). Please note: the zmk keymap is slightly adjusted from the default shown on the main PocketType! pages and QMK.
## Alternate Builds
The `pockettype_mdk` shield is setup to use the MakerDiary MDK board as a dongle for the Pockettype!. This will setup the PocketType! as a split ZMK keyboard. The "peripheral half" will be the Pockettype! and the "controller half" will be the MDK.
## Build Commands
Below are the three commands that can be used to build ZMK for the Pockettype! as a stand alone board or with a MakerDiary MDK as a dongle.
``` sh
# Stand alone build
west build --board nice_nano -d build/pockettype/default -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
# MDK Dongle build
west build --board nrf52840_mdk -d build/pockettype/mdk -- -DSHIELD=pockettype_mdk -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
# Pockettype as a peripheral to the MDK
west build --board nice_nano -d build/pockettype/peripheral -- -DSHIELD=pockettype_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config
```

View file

@ -12,16 +12,14 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include "pockettype_transform.dtsi"
/ {
leds {
compatible = "gpio-leds";
act_led: led_a {
actled: led_a {
gpios = <&pro_micro_a 3 GPIO_ACTIVE_HIGH>;
label = "ACT LED";
};
power_led: led_p {
powerled: led_p {
gpios = <&pro_micro_a 2 GPIO_ACTIVE_HIGH>;
label = "PWR LED";
};
@ -55,4 +53,22 @@
, <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
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(1,0) 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(2,0) 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(3,0) 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)
>;
};
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
};

View file

@ -1,2 +0,0 @@
CONFIG_USB=y
CONFIG_ZMK_SPLIT=y

View file

@ -1,8 +0,0 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/
#include "pockettype.overlay"
#include "pockettype.keymap"

View file

@ -9,7 +9,7 @@
#include <devicetree.h>
#include <drivers/gpio.h>
#define PWR_LED_NODE DT_ALIAS(led_p)
#define PWR_LED_NODE DT_ALIAS(powerled)
#if DT_NODE_HAS_STATUS(PWR_LED_NODE, okay)
#define PWR_LED DT_GPIO_LABEL(PWR_LED_NODE, gpios)
@ -22,25 +22,17 @@
#define FLAGS 0
#endif
static int pwr_led_init(const struct device *_arg) {
ARG_UNUSED(_arg);
const struct device *dev;
int ret;
static int pwr_led_init(const struct device *dev) {
dev = device_get_binding(PWR_LED);
if (dev == NULL) {
return;
return -EIO;
}
ret = gpio_pin_configure(dev, PWR_LED_PIN, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return;
if (gpio_pin_configure(dev, PWR_LED_PIN, GPIO_OUTPUT) < 0) {
return -EIO;
}
gpio_pin_set(dev, PIN, (int)true);
return 0;
return gpio_pin_set(dev, PIN, (int)true);
}
SYS_INIT(pwr_led_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);

View file

@ -1,27 +0,0 @@
/*
* 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 = <12>;
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(1,0) 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(2,0) 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(3,0) 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)
>;
};
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
};

View file

@ -1,2 +0,0 @@
CONFIG_USB=y
CONFIG_ZMK_SPLIT=y

View file

@ -1,12 +0,0 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/
#include "tg4x.dtsi"
#include "tg4x.keymap"
&default_transform {
col-offset = <0>;
};