Adding dactyl manuform

This commit is contained in:
Bartosz Nowak 2021-04-25 01:51:04 +02:00
parent fadb508671
commit 029a7eb9fc
7 changed files with 237 additions and 0 deletions

View file

@ -0,0 +1,36 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_DACTYLMANUFORM
config ZMK_KEYBOARD_NAME
default "dactyl_manuform"
# TODO: MOVE TO PARTICLE BOARD
config BUILD_OUTPUT_UF2
default y
# TODO: MOVE TO PARTICLE BOARD
config FLASH_LOAD_OFFSET
default 0x26000
config BT_CTLR
default BT
config ZMK_BLE
default y
config ZMK_USB
default y
config USB_NRFX
default y
config USB_DEVICE_STACK
default y
# TODO: ADD SUPPORT FOR ZMK
# config ZMK_BATTERY_VOLTAGE_DIVIDER
# default y
endif # SHIELD_DACTYLMANUFORM

View file

@ -0,0 +1,6 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_DACTYLMANUFORM
def_bool $(shields_list_contains,dactyl_manuform)

View file

@ -0,0 +1,51 @@
=================
Dactyl Manuform
=================
This shield is basing on this project:
https://github.com/abstracthat/dactyl-manuform
-------------------
Board
-------------------
I ported the Dactyl Manuform, where instead of using Pro Pico board I picked Particle Xenon.
This board is quite cheap and easy to find in many stores.
Other supported boards was too pricy or unavailable in my country.
^^^^^^^^^^^^^^^^^^^
Bootloader
^^^^^^^^^^^^^^^^^^^
To make it works you need to flash your Particle with:
https://github.com/adafruit/Adafruit_nRF52_Bootloader
Why Adafruit bootloader you may ask?
* MCUBOOT:
This bootloader is hard to use and require installation of quite big amount of tools.
* Particle:
Default bootloader in other hands, require special version of nrftool and you need to use more then one button to trigger boot mode.
It should support binary generated here.
* Adafruit:
It has all MCUBOOT functionality and also support UF2 binary format.
Here you can find the step by step tutorial how to flash it.
https://docs.particle.io/tutorials/learn-more/xenon-circuit-python/
https://learn.adafruit.com/circuitpython-on-the-nrf52/nrf52840-bootloader
-------------------
Building
-------------------
west build -p auto -b particle_xenon -- -DSHIELD='dactyl_manuform'
-----------------------
Flashing with Adafruit
-----------------------
To flash device you need to trigger dfu mode on this bootloader. To do, so double click reset button.
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/zephyr/zmk.hex dfu-package.zip
adafruit-nrfutil dfu serial --package dfu-package.zip -p /dev/ttyACM0 -b 115200

View file

@ -0,0 +1,50 @@
/delete-node/ &storage_partition;
/delete-node/ &boot_partition;
adafriut_flash: &flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
/*
* The flash starting at 0x000ec000 and ending at
* 0x000f3fff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};
/ {
chosen {
zephyr,flash = &adafriut_flash;
zephyr,code-partition = &code_partition;
};
};

View file

@ -0,0 +1,16 @@
# SPDX-License-Identifier: MIT
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

View file

@ -0,0 +1,27 @@
/*
* 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>
#include <dt-bindings/zmk/outputs.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp W &kp E &kp R &kp T
&kp Q &kp S &kp D &kp F &kp G
&kp A &kp X &kp C &kp V &kp B
&kp Z &kp EQUAL &kp MINUS &kp SPACE &kp ESC
&kp LGUI &kp BSPC
&kp LCTRL &kp LALT
>;
};
};
};

View file

@ -0,0 +1,51 @@
/*
* Copyright (c) 2020 Bartosz Nowak
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <5>;
rows = <5>;
map = <
RC(0,1) RC(0,2) RC(0,3) RC(0,4)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4)
RC(4,3) RC(4,4)
RC(4,1) RC(4,2)
>;
};
// TODO: Switch form mesh_header to arduino header think of better way
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "row2col";
row-gpios
= <&mesh_header 18 (GPIO_ACTIVE_HIGH)>
, <&mesh_header 17 (GPIO_ACTIVE_HIGH)>
, <&mesh_header 16 (GPIO_ACTIVE_HIGH)>
, <&mesh_header 15 (GPIO_ACTIVE_HIGH)>
, <&mesh_header 14 (GPIO_ACTIVE_HIGH)>
;
col-gpios
= <&mesh_header 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&mesh_header 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&mesh_header 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&mesh_header 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&mesh_header 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};