Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Karn Keyboard #19846

Merged
merged 19 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions keyboards/karn/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define DIRECT_PINS {{NO_PIN, A15,A8, B15, B14, B13}, \
{B10, B1, B0, A7, A6, A5 }, \
{NO_PIN, B3, B4, B5, B8, B9 }, \
{A4, A3, A2, NO_PIN, NO_PIN, NO_PIN}}

#define DIRECT_PINS_RIGHT {{B13, B14, B15, A8, A15, NO_PIN}, \
{A5, A6, A7, B0, B1, B10}, \
{B9, B8, B5, B4, B3, NO_PIN}, \
{A2, A3, A4, NO_PIN, NO_PIN, NO_PIN}}

#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
#define SERIAL_USART_TX_PIN B6 // USART TX pin
#define SERIAL_USART_RX_PIN B7 // USART RX pin

/* Top left key on left half */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 1
/* Top right key on right half */
#define BOOTMAGIC_LITE_ROW_RIGHT 4
#define BOOTMAGIC_LITE_COLUMN_RIGHT 4

robcmills marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions keyboards/karn/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define HAL_USE_SERIAL TRUE

#include_next <halconf.h>
69 changes: 69 additions & 0 deletions keyboards/karn/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"manufacturer": "Robert Mills",
"keyboard_name": "karn",
"maintainer": "robcmills",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"development_board": "blackpill_f401",
"url": "https://github.com/robcmills/karn-keyboard",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
robcmills marked this conversation as resolved.
Show resolved Hide resolved
"community_layouts": ["split_3x6_3"],
"layouts": {
"LAYOUT_split_3x6_3": {
"layout": [
{ "matrix": [0, 0], "x": 0, "y": 0 },
{ "matrix": [0, 1], "x": 1, "y": 0 },
{ "matrix": [0, 2], "x": 2, "y": 0 },
{ "matrix": [0, 3], "x": 3, "y": 0 },
{ "matrix": [0, 4], "x": 4, "y": 0 },
{ "matrix": [0, 5], "x": 5, "y": 0},
{ "matrix": [4, 0], "x": 8, "y": 0},
{ "matrix": [4, 1], "x": 9, "y": 0 },
{ "matrix": [4, 2], "x": 10, "y": 0 },
{ "matrix": [4, 3], "x": 11, "y": 0 },
{ "matrix": [4, 4], "x": 12, "y": 0},
{ "matrix": [4, 5], "x": 13, "y": 0},
{ "matrix": [1, 0], "x": 0, "y": 1},
{ "matrix": [1, 1], "x": 1, "y": 1},
{ "matrix": [1, 2], "x": 2, "y": 1 },
{ "matrix": [1, 3], "x": 3, "y": 1 },
{ "matrix": [1, 4], "x": 4, "y": 1 },
{ "matrix": [1, 5], "x": 5, "y": 1},
{ "matrix": [5, 0], "x": 8, "y": 1},
{ "matrix": [5, 1], "x": 9, "y": 1 },
{ "matrix": [5, 2], "x": 10, "y": 1 },
{ "matrix": [5, 3], "x": 11, "y": 1 },
{ "matrix": [5, 4], "x": 12, "y": 1},
{ "matrix": [5, 5], "x": 13, "y": 1},
{ "matrix": [2, 0], "x": 0, "y": 2},
{ "matrix": [2, 1], "x": 1, "y": 2},
{ "matrix": [2, 2], "x": 2, "y": 2 },
{ "matrix": [2, 3], "x": 3, "y": 2 },
{ "matrix": [2, 4], "x": 4, "y": 2 },
{ "matrix": [2, 5], "x": 5, "y": 2},
{ "matrix": [6, 0], "x": 8, "y": 2},
{ "matrix": [6, 1], "x": 9, "y": 2 },
{ "matrix": [6, 2], "x": 10, "y": 2 },
{ "matrix": [6, 3], "x": 11, "y": 2 },
{ "matrix": [6, 4], "x": 12, "y": 2},
{ "matrix": [6, 5], "x": 13, "y": 2},
{ "matrix": [3, 0], "x": 3.5, "y": 3.25 },
{ "matrix": [3, 1], "x": 4.5, "y": 3.5 },
{ "matrix": [3, 2], "x": 5.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": 9.5, "y": 3.25 }
]
}
}
}
11 changes: 11 additions & 0 deletions keyboards/karn/keymaps/colemak/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2023 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0-or-later

// Equivalent to zmk behavior-hold-tap tap-preferred flavor
robcmills marked this conversation as resolved.
Show resolved Hide resolved
// Do not force the mod-tap key press to be handled as a modifier
// if any other key was pressed while the mod-tap key is held down.
#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY

// Equivalent to zmk behavior-hold-tap hold-preferred flavor
#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY

96 changes: 96 additions & 0 deletions keyboards/karn/keymaps/colemak/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// Copyright 2023 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0

#include QMK_KEYBOARD_H

// Tap Dance declarations
enum {
TD_F1_F11,
TD_F2_F12,
};

// Tap Dance definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// Tap once for F1, twice for F11
[TD_F1_F11] = ACTION_TAP_DANCE_DOUBLE(KC_F1, KC_F11),
[TD_F2_F12] = ACTION_TAP_DANCE_DOUBLE(KC_F2, KC_F12),
};

bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case SFT_T(KC_Z): // Special case for Shift
return true; // Immediately select the hold action when another key is pressed.
case SFT_T(KC_ESC):
return true;
default:
return false; // Do not select the hold action when another key is pressed.
}
}

bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case CTL_T(KC_X):
return true;
case ALT_T(KC_C):
return true;
case CMD_T(KC_V):
return true;
case CMD_T(KC_M):
return true;
case ALT_T(KC_COMM):
return true;
case CTL_T(KC_DOT):
return true;
case KC_X:
return true;
case KC_C:
return true;
case KC_V:
return true;
case KC_M:
return true;
case KC_COMM:
return true;
case KC_DOT:
return true;
default:
return false;
}
}

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


// default (colemak)
[0] = LAYOUT_split_3x6_3(
KC_NO, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_NO,
HYPR_T(KC_TAB),KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, HYPR_T(KC_ENT),
KC_NO, SFT_T(KC_Z),CTL_T(KC_X),ALT_T(KC_C),CMD_T(KC_V),KC_B, KC_K, CMD_T(KC_M),ALT_T(KC_COMM),CTL_T(KC_DOT),RSFT_T(KC_SLSH),KC_NO,
MO(1), SFT_T(KC_ESC),MO(3), KC_BSPC,KC_SPC,MO(2)
),

// symbols
[1] = LAYOUT_split_3x6_3(
_______, KC_BSLS, KC_GRV, KC_QUOT, KC_DQT, KC_LCBR, KC_RCBR, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______,
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, KC_DEL, _______, _______
),

// nav
[2] = LAYOUT_split_3x6_3(
_______, _______, KC_Q, _______, _______, KC_VOLU, _______, _______, _______, KC_SCLN, _______, _______,
_______, C(KC_UP),C(KC_DOWN),G(KC_GRV), G(KC_TAB), KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS, _______,
_______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______
),

// numbers
[3] = LAYOUT_split_3x6_3(
_______, TD(TD_F1_F11), TD(TD_F2_F12), KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______
)
};

58 changes: 58 additions & 0 deletions keyboards/karn/keymaps/colemak/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
```
/*
* ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
* │ Q │ W │ F │ P │ G │ BASE │ J │ L │ U │ Y │ ; │
* │ │ │ │ │ │ LAYER │ │ │ │ │ │
* ┌─────┼─────┼─────┼─────┼─────┼─────┤ ┌─────┐ ├─────┼─────┼─────┼─────┼─────┼─────┐
* │ TAB │ A │ R │ S │ T │ D │ │ TAP │ │ H │ N │ E │ I │ O │ ENT │
* │ HYP │ │ │ │ │ │ │ HOLD│ │ │ │ │ │ │ HYP │
* └─────┼─────┼─────┼─────┼─────┼─────┤ └─────┘ ├─────┼─────┼─────┼─────┼─────┼─────┘
* │ Z │ X │ C │ V │ B │ │ K │ M │ , │ . │ / │
* │ SFT │ CTL │ ALT │ CMD │ │ │ │ CMD │ ALT │ CTL │ SFT │
* └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘
* │ │ ESC │ │ │ BAK │ SPC │ │
* │ SYM │ SFT │ NUM │ │ │ │ NAV │
* └─────┴─────┴─────┘ └─────┴─────┴─────┘
* ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
* │ \ │ ` │ ' │ " │ { │ SYM │ } │ - │ = │ [ │ ] │
* │ │ │ │ │ │ LAYER │ │ │ │ │ │
* ┌─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┐
* │ │ ! │ @ │ # │ $ │ % │ │ ^ │ & │ * │ ( │ ) │ │
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
* └─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┘
* │ │ │ │ │ │ │ │ │ │ │ │
* │ │ │ │ │ │ │ │ │ │ │ │
* └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘
* │ │ │ │ │ DEL │ │ │
* │ │ │ │ │ │ │ │
* └─────┴─────┴─────┘ └─────┴─────┴─────┘
* ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
* │ │ │ │ │ VOL │ NAV │ │ │ │ │ │
* │ │ │ │ │ UP │ LAYER │ │ │ │ │ │
* ┌─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┐
* │ │ CTL │ CTL │ CMD │ CMD │ VOL │ │ ← │ ↓ │ ↑ │ → │CAPS │ │
* │ │ + ↓ │ + ↑ │ + ` │ +TAB│ DOWN│ │ │ │ │ │LOCK │ │
* └─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┘
* │ │ │ │ │ MUTE│ │ │ │ │ │ │
* │ │ │ │ │ │ │ │ │ │ │ │
* └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘
* │ │ │ │ │ │ │ │
* │ │ │ │ │ │ │ │
* └─────┴─────┴─────┘ └─────┴─────┴─────┘
* ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
* │ F1 │ F2 │ F3 │ F4 │ F5 │ NUM │ F6 │ F7 │ F8 │ F9 │ F10 │
* │ F11 │ F12 │ │ │ │ LAYER │ │ │ │ │ │
* ┌─────┼─────┼─────┼─────┼─────┼─────┤ ┌─────┐ ├─────┼─────┼─────┼─────┼─────┼─────┐
* │ │ 1 │ 2 │ 3 │ 4 │ 5 │ │ TAP │ │ 6 │ 7 │ 8 │ 9 │ 0 │ │
* │ │ │ │ │ │ │ │TAPx2│ │ │ │ │ │ │ │
* └─────┼─────┼─────┼─────┼─────┼─────┤ └─────┘ ├─────┼─────┼─────┼─────┼─────┼─────┘
* │ │ │ │ │ │ │ │ │ │ │ │
* │ │ │ │ │ │ │ │ │ │ │ │
* └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘
* │ │ │ │ │ │ │ │
* │ │ │ │ │ │ │ │
* └─────┴─────┴─────┘ └─────┴─────┴─────┘
*/
```


1 change: 1 addition & 0 deletions keyboards/karn/keymaps/colemak/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes
41 changes: 41 additions & 0 deletions keyboards/karn/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2023 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


// default (qwerty)
[0] = LAYOUT_split_3x6_3(
KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_NO,
HYPR_T(KC_TAB),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, HYPR_T(KC_ENT),
KC_NO, SFT_T(KC_Z),CTL_T(KC_X),ALT_T(KC_C),CMD_T(KC_V),KC_B, KC_N, CMD_T(KC_M),ALT_T(KC_COMM),CTL_T(KC_DOT),RSFT_T(KC_SLSH),KC_NO,
MO(1), SFT_T(KC_ESC),MO(3), KC_BSPC,KC_SPC,MO(2)
),

// symbols
[1] = LAYOUT_split_3x6_3(
_______, KC_BSLS, KC_GRV, KC_QUOT, KC_DQT, KC_LCBR, KC_RCBR, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______,
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, KC_DEL, _______, _______
),

// nav
[2] = LAYOUT_split_3x6_3(
_______, _______, _______, _______, _______, KC_VOLU, _______, _______, _______, _______, _______, _______,
_______, C(KC_UP),C(KC_DOWN),G(KC_GRV), G(KC_TAB), KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS, _______,
_______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______
),

// numbers
[3] = LAYOUT_split_3x6_3(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______
)
};

9 changes: 9 additions & 0 deletions keyboards/karn/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2022 Robert Mills (@robcmills)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include_next <mcuconf.h>

#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 TRUE
Loading