Skip to content

Commit

Permalink
add keyboard based on mini 4 pin DIN (#4)
Browse files Browse the repository at this point in the history
* add new keyboard based on mini din connector
* updated with photos of keyboard of 4 pin mini-din
* keymap updated to support aerospace window manager
* updated license
* add qmk files
  • Loading branch information
axhixh authored Feb 2, 2024
1 parent e1e28ca commit f43bb8b
Show file tree
Hide file tree
Showing 32 changed files with 38,032 additions and 48 deletions.
63 changes: 37 additions & 26 deletions firmware/kmk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
keyboard.modules.append(Layers())

# comment one of these on each side
split_side = SplitSide.LEFT
#split_side = SplitSide.RIGHT
#split_side = SplitSide.LEFT
split_side = SplitSide.RIGHT
split = Split(
data_pin=board.GP1,
uart_flip=True,
Expand Down Expand Up @@ -72,46 +72,57 @@

keyboard.extensions.append(MediaKeys())

# cleaner key names
_______ = KC.TRNS
XXXXXXX = KC.NO

# layer taps
L1_ESC = KC.LT(1, KC.ESC)
L1_TAB = KC.LT(1, KC.TAB)
L2_SPC = KC.LT(2, KC.SPC)
L3_BSPC = KC.LT(3, KC.BSPC)
L3_ESC = KC.LT(3, KC.ESC)

# shortcuts
BREAK = KC.LCTRL(KC.C)
LOCK = KC.LCTRL(KC.LGUI(KC.Q))

UNDO = KC.LGUI(KC.Z)
CUT = KC.LGUI(KC.X)
COPY = KC.LGUI(KC.C)
PASTE = KC.LGUI(KC.V)

FSCRN = KC.LCTRL(KC.LALT(KC.F))# rectangle - full screen without maximizing or creating new desktop
WM_LEADER = KC.LCTRL(KC.LALT)
SSHOT = KC.LGUI(KC.LSFT(KC.N4)) # screenshot
PRV_TAB = KC.LGUI(KC.LSFT(KC.LBRC))
NXT_TAB = KC.LGUI(KC.LSFT(KC.RBRC))
PRV_WND = KC.LGUI(KC.GRV)
ZOOM_P = KC.LGUI(KC.EQL)
ZOOM_0 = KC.LGUI(KC.N0)
ZOOM_M = KC.LGUI(KC.MINS)

# aerospace window manager shortcuts
WM_UP = KC.LALT(KC.UP)
WM_DOWN = KC.LALT(KC.DOWN)
WM_LEFT = KC.LALT(KC.LEFT)
WM_RIGHT = KC.LALT(KC.RIGHT)

WM_SRVC = KC.LSFT(KC.LALT(KC.SCLN))
WM_JOIN = KC.LSFT(KC.LALT(KC.SLSH))
WM_NEXT = KC.LALT(KC.TAB)
WM_NEXT_MNTR = KC.LSFT(KC.LALT(KC.TAB))
WM_INC = KC.LSFT(KC.LALT(KC.EQL))
WM_DEC = KC.LSFT(KC.LALT(KC.MINS))
WM_STACK = KC.LCTRL(KC.LALT(KC.COMM))
WM_TILE = KC.LCTRL(KC.LALT(KC.SLSH))

WM_0 = KC.LCTRL(KC.LALT(KC.N0))
WM_1 = KC.LCTRL(KC.LALT(KC.N1))
WM_2 = KC.LCTRL(KC.LALT(KC.N2))
WM_3 = KC.LCTRL(KC.LALT(KC.N3))
WM_4 = KC.LCTRL(KC.LALT(KC.N4))
WM_5 = KC.LCTRL(KC.LALT(KC.N5))
WM_6 = KC.LCTRL(KC.LALT(KC.N6))
WM_7 = KC.LCTRL(KC.LALT(KC.N7))

keyboard.keymap = [
[
KC.Q, KC.W, KC.F, KC.P, KC.B, KC.J, KC.L, KC.U, KC.Y, KC.QUOT,
KC.A, KC.R, KC.S, KC.T, KC.G, KC.M, KC.N, KC.E, KC.I, KC.O,
KC.Z, KC.X, KC.C, KC.D, KC.V, KC.K, KC.H, KC.COMM, KC.DOT, KC.SLSH,
OS_LGUI, KC.ENT, L1_ESC, L3_BSPC, L2_SPC, OS_LSFT
OS_LGUI, KC.ENT, L1_TAB, L3_ESC, L2_SPC, OS_LSFT
],
[
LOCK, KC.MB_RMB, KC.MS_UP, KC.MB_LMB, KC.MW_UP, KC.PGUP, KC.HOME, KC.UP, KC.END, KC.DEL,
PRV_WND, KC.MS_LT, KC.MS_DN, KC.MS_RT, KC.MW_DN, KC.PGDN, KC.LEFT, KC.DOWN, KC.RGHT, KC.BSPC,
KC.CW, BREAK, OS_LALT, OS_LCTL, WM_LEADER, PRV_TAB, NXT_TAB, FSCRN, KC.INS, UNDO,
KC.RESET, KC.NO, KC.TRNS, SSHOT, KC.TAB, KC.CW
KC.HYPR, KC.MS_LT, KC.MS_DN, KC.MS_RT, KC.MW_DN, KC.PGDN, KC.LEFT, KC.DOWN, KC.RGHT, KC.BSPC,
ZOOM_P, ZOOM_M, OS_LALT, OS_LCTL, KC.CW, PRV_TAB, NXT_TAB, PRV_WND, KC.INS, SSHOT,
KC.RESET, KC.NO, KC.TRNS, KC.VOLU, KC.MUTE, KC.VOLD
],
[
KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.PLUS, KC.EQL, KC.ASTR, KC.UNDS, KC.TILD,
Expand All @@ -120,12 +131,12 @@
KC.AMPR, KC.SCLN, KC.COLN, KC.NO, KC.TRNS, KC.RESET
],
[
KC.F1, KC.F2, KC.F3, KC.F4, ZOOM_P, KC.VOLU, KC.BRIU, KC.NO, KC.NO, KC.NO,
KC.F5, KC.F6, KC.F7, KC.F8, ZOOM_0, KC.MUTE, KC.NO, KC.NO, KC.NO, KC.NO,
KC.F9, KC.F10, KC.F11, KC.F12, ZOOM_M, KC.VOLD, KC.BRID, KC.NO, KC.NO, KC.NO,
CUT, COPY, PASTE, KC.TRNS, KC.NO, KC.RESET
KC.F1, KC.F2, KC.F3, KC.F4, WM_SRVC, WM_UP, WM_0, WM_1, WM_2, WM_3,
KC.F5, KC.F6, KC.F7, KC.F8, WM_JOIN, WM_DOWN, WM_4, WM_5, WM_6, WM_7,
KC.F9, KC.F10, KC.F11, KC.F12, WM_NEXT, WM_LEFT, WM_RIGHT, WM_INC, WM_DEC, WM_NEXT_MNTR,
WM_STACK, WM_TILE, KC.LSFT, KC.TRNS, KC.NO, KC.RESET
]
]

if __name__ == "__main__":
keyboard.go()
keyboard.go()
11 changes: 11 additions & 0 deletions firmware/qmk/keyboards/mini_kbd/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2024 Ashish Shrestha (@axhixh)
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U

#define SERIAL_USART_TX_PIN GP1

#define EE_HANDS
83 changes: 83 additions & 0 deletions firmware/qmk/keyboards/mini_kbd/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"manufacturer": "Ashish Shrestha",
"keyboard_name": "mini-kbd",
"url": "https://github.com/axhixh/mini-kbd",
"maintainer": "axhixh",
"bootloader": "rp2040",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true
},
"matrix_pins": {
"direct": [
["GP15", "GP26", "GP27", "GP28", "GP29"],
["GP10", "GP11", "GP12", "GP13", "GP14"],
["GP3", "GP4", "GP5", "GP8", "GP9"],
[null, null, "GP7", "GP6", "GP2"]
]
},
"split": {
"matrix_pins": {
"right": {
"direct": [
["GP29", "GP28", "GP27", "GP26", "GP15"],
["GP14", "GP13", "GP12", "GP11", "GP10"],
["GP9", "GP8", "GP5", "GP4", "GP3"],
["GP2", "GP6", "GP7", null, null]
]
}
}
},
"processor": "RP2040",
"usb": {
"device_version": "1.0.0",
"pid": "0x0211",
"vid": "0xCAFE"
},
"layouts": {
"LAYOUT_split_3x5_3": {
"layout": [
{ "matrix": [0, 0], "x": 0, "y": 0.25 },
{ "matrix": [0, 1], "x": 1, "y": 0.25 },
{ "matrix": [0, 2], "x": 2, "y": 0.125 },
{ "matrix": [0, 3], "x": 3, "y": 0 },
{ "matrix": [0, 4], "x": 4, "y": 0.125 },
{ "matrix": [4, 0], "x": 8, "y": 0.25 },
{ "matrix": [4, 1], "x": 9, "y": 0.125 },
{ "matrix": [4, 2], "x": 10, "y": 0 },
{ "matrix": [4, 3], "x": 11, "y": 0.125 },
{ "matrix": [4, 4], "x": 12, "y": 0.25 },
{ "matrix": [1, 0], "x": 0, "y": 1.25 },
{ "matrix": [1, 1], "x": 1, "y": 1.25 },
{ "matrix": [1, 2], "x": 2, "y": 1.125 },
{ "matrix": [1, 3], "x": 3, "y": 1 },
{ "matrix": [1, 4], "x": 4, "y": 1.125 },
{ "matrix": [5, 0], "x": 8, "y": 1.25 },
{ "matrix": [5, 1], "x": 9, "y": 1.125 },
{ "matrix": [5, 2], "x": 10, "y": 1 },
{ "matrix": [5, 3], "x": 11, "y": 1.125 },
{ "matrix": [5, 4], "x": 12, "y": 1.25 },
{ "matrix": [2, 0], "x": 0, "y": 2.25 },
{ "matrix": [2, 1], "x": 1, "y": 2.25 },
{ "matrix": [2, 2], "x": 2, "y": 2.125 },
{ "matrix": [2, 3], "x": 3, "y": 2 },
{ "matrix": [2, 4], "x": 4, "y": 2.125 },
{ "matrix": [6, 0], "x": 8, "y": 2.25 },
{ "matrix": [6, 1], "x": 9, "y": 2.125 },
{ "matrix": [6, 2], "x": 10, "y": 2 },
{ "matrix": [6, 3], "x": 11, "y": 2.125 },
{ "matrix": [6, 4], "x": 12, "y": 2.25 },
{ "matrix": [3, 2], "x": 3.5, "y": 3.25 },
{ "matrix": [3, 3], "x": 4.5, "y": 3.5 },
{ "matrix": [3, 4], "x": 4.5, "y": 3.75 },
{ "matrix": [7, 0], "x": 7.5, "y": 3.75 },
{ "matrix": [7, 1], "x": 8.5, "y": 3.5 },
{ "matrix": [7, 2], "x": 8.5, "y": 3.25 }
]
}
}
}

26 changes: 26 additions & 0 deletions firmware/qmk/keyboards/mini_kbd/keymaps/axhixh/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include QMK_KEYBOARD_H


/* THIS FILE WAS GENERATED!
*
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_split_3x5_3(KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_LGUI), LT(1,KC_ENT), LCTL_T(KC_TAB), LT(3,KC_ESC), LT(2,KC_SPC), OSM(MOD_LSFT)),
[1] = LAYOUT_split_3x5_3(C(G(KC_Q)), KC_BTN2, KC_MS_U, KC_BTN1, KC_WH_U, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, QK_REP, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, LGUI(KC_EQL), LGUI(KC_MINS), OSM(MOD_LALT), OSM(MOD_LCTL), KC_CAPS, SGUI(KC_LBRC), SGUI(KC_RBRC), LGUI(KC_GRV), KC_INS, SGUI(KC_4), QK_BOOT, KC_TRNS, KC_NO, KC_VOLU, KC_MUTE, KC_VOLD),
[2] = LAYOUT_split_3x5_3(KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_PLUS, KC_EQL, KC_ASTR, KC_UNDS, KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_LCBR, KC_LPRN, KC_MINS, KC_GRV, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, KC_RPRN, KC_RPRN, KC_PIPE, KC_BSLS, KC_AMPR, KC_SCLN, KC_COLN, KC_NO, KC_TRNS, QK_BOOT),
[3] = LAYOUT_split_3x5_3(KC_F1, KC_F2, KC_F3, KC_F4, LSA(KC_SCLN), LALT(KC_UP), LCA(KC_0), LCA(KC_1), LCA(KC_2), LCA(KC_3), KC_F5, KC_F6, KC_F7, KC_F8, LSA(KC_SLSH), LALT(KC_DOWN), LCA(KC_4), LCA(KC_5), LCA(KC_6), LCA(KC_7), KC_F9, KC_F10, KC_F11, KC_F12, LALT(KC_TAB), LALT(KC_LEFT), LALT(KC_RGHT), LSA(KC_EQL), LSA(KC_MINS), LSA(KC_TAB), LCA(KC_COMM), LCA(KC_SLSH), KC_LSFT, KC_TRNS, KC_NO, QK_BOOT)
};

#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {

};
#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)




2 changes: 2 additions & 0 deletions firmware/qmk/keyboards/mini_kbd/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPLIT_KEYBOARD = yes
SERIAL_DRIVER = vendor
19 changes: 19 additions & 0 deletions firmware/qmk/readme.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
= QMK firmware for mini-kbd

This is the code necessary to use QMK on mini-kbd. Please use this
until I get it merged into QMK. This was tested with QMK with
git commit a4b124e906de105189415f061d7e64a00e2271d9.

Please copy `keyboards` to the `qmk_firmware` folder where you
have checked out the code for QMK.

Use the following command to build and flash the microcontroller.

```
qmk flash -kb mini_kbd -km axhixh -bl uf2-split-right
qmk flash -kb mini_kbd -km axhixh -bl uf2-split-left
```

Please press the `BOOT` button on RP2040-Zero to it in bootloader
mode. Once you have QMK you can do this by double tapping the
`reset` button if you have set one in the keymap.
Binary file added images/keyboard_4_pin_din.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mini-din-mini-pcb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pcb_using_4_pin_din.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/right_half.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 3 additions & 12 deletions license
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
Copyright 2023, Ashish Shrestha
mini-kbd
© 2024 by Ashish Shrestha is licensed under CC BY-NC-SA 4.0.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
Loading

0 comments on commit f43bb8b

Please sign in to comment.