forked from KMKfw/kmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Boardsouce Unicorne (KMKfw#879)
* feat: Add Boardsouce Unicorne --------- Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Unicorne | ||
|
||
Based on the legendary corne (crkbd) from Foostan with more features than ever before. | ||
|
||
- Prebuilt at the factory | ||
- Hotswap sockets | ||
- RP2040 with 16MB of ROM for tons of room for fun things! | ||
- OLED screens | ||
- Underglow and per key RGB | ||
|
||
Extensions enabled by default | ||
- [Split](/docs/en/split.md) Connects halves using a wire. | ||
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. | ||
- [PEG_RGB](/docs/en/peg_rgb_matrix.md) Light it up! | ||
- [PEG_OLED](/docs/en/peg_oled_display.md) Screens to see things on of course. | ||
- [Oneshot](/docs/en/oneshot.md) Deadkeys, for faster typing | ||
- [Combos](/docs/en/combos) Making more keys from pushing multiple keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import board | ||
|
||
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard | ||
from kmk.scanners import DiodeOrientation | ||
from kmk.scanners.keypad import MatrixScanner | ||
|
||
|
||
class KMKKeyboard(_KMKKeyboard): | ||
col_pins = ( | ||
board.GP02, | ||
board.GP03, | ||
board.GP04, | ||
board.GP05, | ||
board.GP06, | ||
board.GP07, | ||
) | ||
row_pins = (board.GP14, board.GP15, board.GP16, board.GP17) | ||
diode_orientation = DiodeOrientation.COLUMNS | ||
rx = board.RX | ||
tx = board.TX | ||
rgb_pixel_pin = board.GP29 | ||
i2c = board.I2C | ||
swap_x = False | ||
swap_y = True | ||
SCL=board.SCL | ||
SDA=board.SDA | ||
led_key_pos = [24,23,18,17,10,9,36,37,44,45,50,51, | ||
25,22,19,16,11,8,35,38,43,46,49,52, | ||
26,21,20,15,12,7,34,39,42,47,48,53, | ||
14,13,6,33,40,41, | ||
2,1,0,27,28,29,3,4,5,32,31,30] | ||
brightness_limit = 0.5 | ||
num_pixels = 54 | ||
# flake8: noqa | ||
coord_mapping = [ | ||
0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24, | ||
6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30, | ||
12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36, | ||
21, 22, 23, 47, 46, 45, | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,243 @@ | ||
import supervisor | ||
|
||
from kb import KMKKeyboard | ||
|
||
from kmk.extensions.peg_oled_Display import ( | ||
Oled, | ||
OledData, | ||
OledDisplayMode, | ||
OledReactionType, | ||
) | ||
from kmk.extensions.peg_rgb_matrix import Rgb_matrix | ||
from kmk.handlers.sequences import send_string | ||
from kmk.hid import HIDModes | ||
from kmk.keys import KC | ||
from kmk.modules.combos import Chord, Combos | ||
from kmk.modules.holdtap import HoldTapRepeat | ||
from kmk.modules.layers import Layers | ||
from kmk.modules.modtap import ModTap | ||
from kmk.modules.oneshot import OneShot | ||
from kmk.modules.split import Split, SplitSide, SplitType | ||
|
||
supervisor.runtime.autoreload = False | ||
keyboard = KMKKeyboard() | ||
modtap = ModTap() | ||
combos = Combos() | ||
oneshot = OneShot() | ||
layers = Layers() | ||
oneshot.tap_time = 450 | ||
|
||
|
||
OS_LCTL = KC.OS(KC.LCTL) | ||
OS_LSFT = KC.OS(KC.LSFT) | ||
OS_LALT = KC.OS(KC.LALT) | ||
keyboard.modules.append(oneshot) | ||
keyboard.modules.append(layers) | ||
keyboard.modules.append(modtap) | ||
keyboard.modules.append(combos) | ||
|
||
# oled | ||
oled = Oled( | ||
OledData( | ||
corner_one={ | ||
0: OledReactionType.STATIC, | ||
1: ['1 2 3 4 5 6', '', '', '', '', '', '', ''], | ||
}, | ||
corner_two={ | ||
0: OledReactionType.STATIC, | ||
1: [' 7 8 Layer', '', '', '', '', '', '', ' 7 8 Layer'], | ||
}, | ||
corner_three={ | ||
0: OledReactionType.LAYER, | ||
1: ['^', ' ^', ' ^', ' ^', ' ^', ' ^', '', ''], | ||
}, | ||
corner_four={ | ||
0: OledReactionType.LAYER, | ||
1: ['', '', '', '', '', '', ' ^', ' ^'], | ||
}, | ||
), | ||
toDisplay=OledDisplayMode.TXT, | ||
flip=True, | ||
) | ||
# oled | ||
keyboard.extensions.append(oled) | ||
# ledmap | ||
rgb = Rgb_matrix( | ||
ledDisplay=[ | ||
[255, 55, 55], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[18, 209, 123], | ||
[255, 0, 0], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[55, 55, 55], | ||
[255, 55, 55], | ||
[255, 55, 55], | ||
[55, 55, 55], | ||
[0, 255, 217], | ||
[0, 255, 217], | ||
[0, 255, 217], | ||
[255, 0, 0], | ||
[0, 255, 217], | ||
[0, 255, 217], | ||
[0, 255, 217], | ||
[0, 255, 217], | ||
] | ||
) | ||
# ledmap | ||
keyboard.extensions.append(rgb) | ||
|
||
# TODO Comment one of these on each side | ||
split_side = SplitSide.LEFT | ||
# split_side = SplitSide.RIGHT | ||
split = Split(data_pin=keyboard.rx, data_pin2=keyboard.tx, uart_flip=False) | ||
keyboard.modules.append(split) | ||
|
||
# Cleaner key names | ||
|
||
_______ = KC.TRNS | ||
XXXXXXX = KC.NO | ||
|
||
LT1_SP = KC.LT(2, KC.SPC, prefer_hold=True, tap_time=250, repeat=HoldTapRepeat.TAP) | ||
LT2_SP = KC.LT(3, KC.SPC, prefer_hold=True, tap_time=250, repeat=HoldTapRepeat.TAP) | ||
TAB_SB = KC.LT(5, KC.TAB) | ||
SUPER_L = KC.LM(4, KC.LGUI) | ||
|
||
keyboard.keymap = [ | ||
# DVORAK | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | Esc | ' | , | . | P | Y | | F | G | C | R | L | BKSP | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | Tab | A | O | E | U | I | | D | H | T | N | S | ENT | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | Shft | ; | Q | J | K | X |-------. ,-------| B | M | W | V | Z | / | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | /LT1_SP / \LT2_SP\ | Ctl | Up | | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
# | ||
[ | ||
# DVORAK | ||
KC.ESC, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BSPC, \ | ||
TAB_SB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT, \ | ||
OS_LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH, \ | ||
OS_LALT, SUPER_L, LT1_SP, LT2_SP, OS_LCTL, KC.NO, | ||
], | ||
|
||
# GAMING | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | Tab | ' | , | . | P | Y | | F | G | C | R | L | BKSP | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | Ctl | A | O | E | U | I | | D | H | T | N | S | ENT | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | Shft | ; | Q | J | K | X |-------. ,-------| B | M | W | V | Z | / | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | / Space / \LT2_SP\ | Ctl | Up | | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
# | ||
[ | ||
# GAMING | ||
KC.ESC, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BSPC, \ | ||
KC.LCTL, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT, \ | ||
KC.LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH, \ | ||
KC.LALT, KC.SPC, KC.SPC, LT2_SP, KC.LCTL, KC.UP, | ||
], | ||
# RAISE1 | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | | | | | | | | | | 7 | 8 | 9 | | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | | | | | | | | | 4 | 5 | 6 | \ | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | | | | |Reset |-------. ,-------| | | 1 | 2 | 3 | - | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | /LT1_SP / \LT2_SP\ | = | 0 | | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
# | ||
[ | ||
# RAISE1 | ||
KC.GRV, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC.N7, KC.N8, KC.N9, KC.DEL, \ | ||
_______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC.N4, KC.N5, KC.N6, KC.BSLS, \ | ||
_______, _______, _______, _______, _______, KC.RLD, XXXXXXX, XXXXXXX, KC.N1, KC.N2, KC.N3, KC.MINS, \ | ||
_______, _______, _______, _______, KC.EQL, KC.N0, | ||
], | ||
# RAISE2 | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | | F9 | F10 | F11 | F12 | | | | | | | | SIns | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | F5 | F6 | F7 | F8 | | | | Left | Down | Up |Right | | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | F1 | F2 | F3 | F4 | |-------. ,-------| | | | | | \ | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | /LT1_SP / \LT2_SP\ |Dvorak|Gaming| | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
# | ||
|
||
[ | ||
# RAISE2 | ||
_______, KC.F9, KC.F10, KC.F11, KC.F12, _______, _______, _______, _______, KC.LBRC, KC.RBRC, KC.LSHIFT(KC.INS), \ | ||
_______, KC.F5, KC.F6, KC.F7, KC.F8, _______, KC.HOME, KC.LEFT, KC.DOWN, KC.UP, KC.RGHT, KC.END, \ | ||
_______, KC.F1, KC.F2, KC.F3, KC.F4, _______, _______, _______, _______, _______, _______, KC.BSLS, \ | ||
_______, _______, _______, _______, KC.DF(0), KC.DF(1), | ||
], | ||
# GUI | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | | 1 | 2 | 3 | 4 | 5 | | | | | | | | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | 6 | 7 | 8 | 9 | 0 | | | | | | | | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | | | | | |-------. ,-------| | | | | | | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | /LT1_SP / \LT2_SP\ | | | | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
|
||
[ | ||
# GUI | ||
_______, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, _______, _______, _______, _______, _______, _______, \ | ||
_______, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, _______, _______, _______, _______, _______, _______, \ | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
|
||
_______, _______, _______, _______, _______, _______ \ | ||
], | ||
# SYMBOLS | ||
# ,-----------------------------------------. ,-----------------------------------------. | ||
# | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | | | | | | | | | | [ | ] | | | ||
# |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
# | | | | | | |-------. ,-------| | | | | | | | ||
# `-----------------------------------------/ / \ \-----------------------------------------' | ||
# | LALT | LGUI | /LT1_SP / \LT2_SP\ | | | | ||
# | | |/ / \ \ | | | | ||
# `---------------------' '------''-------------' | ||
# | ||
[ | ||
# SYMBOLS | ||
_______, KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN, KC.DEL, \ | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC.LBRC, KC.RBRC, _______, \ | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
_______, _______, _______, _______, _______, _______, | ||
] | ||
|
||
] | ||
|
||
combos.combos = [ | ||
Chord((KC.QUOT, KC.COMM), send_string('>_>')), | ||
Chord((KC.COMM, KC.DOT), send_string('><')), | ||
Chord((KC.C, KC.L), send_string("C'est la vie")), | ||
Chord((KC.BKSP, KC.L), KC.LCTL(KC.BKSP)), | ||
Chord((KC.R, KC.L), KC.LCTL(KC.V)), | ||
Chord((KC.V, KC.Z), KC.LCTL(KC.Z)), | ||
|
||
] | ||
|
||
|
||
if __name__ == '__main__': | ||
keyboard.go(hid_type=HIDModes.USB) |