2018-12-29 08:20:03 +01:00
|
|
|
import board
|
|
|
|
|
2019-07-25 10:30:55 +02:00
|
|
|
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
|
Continue to shuffle and burn stuff
- Remove the concept of "mcus". With only one target platform
(CircuitPython), it no longer makes a bunch of sense and has been kept
around for "what if" reasons, complicating our import chains and eating
up RAM for pointless subclasses. If you're a `board`, you derive from
`KeyboardConfig`. If you're a handwire, the user will derive from
`KeyboardConfig`. The end. As part of this, `kmk.hid` was refactored
heavily to emphasize that CircuitPython is our only supported HID stack,
with stubs for future HID implementations (`USB_HID` becomes
`AbstractHID`, probably only usable for testing purposes,
`CircuitPython_USB_HID` becomes `USBHID`, and `BLEHID` is added with an
immediate `NotImplementedError` on instantiation)
- `KeyboardConfig` can now take a HID type at runtime. The NRF52840
boards will happily run in either configuration once CircuitPython
support is in place, and a completely separate `mcu` subclass for each
mode made no sense. This also potentially allows runtime *swaps* of HID
driver down the line, but no code has been added to this effect. The
default, and only functional value, for this is `HIDModes.USB`
- Most consts have been moved to more logical homes - often, the main
or, often only, component that uses them. `DiodeOrientation` moved to
`kmk.matrix`, and anything HID-related moved to `kmk.hid`
2019-07-25 09:58:23 +02:00
|
|
|
from kmk.matrix import DiodeOrientation
|
2018-12-29 08:20:03 +01:00
|
|
|
|
|
|
|
|
2019-07-25 10:30:55 +02:00
|
|
|
class KMKKeyboard(_KMKKeyboard):
|
2018-12-29 08:20:03 +01:00
|
|
|
# Pin mappings for converter board found at hardware/README.md
|
|
|
|
# QMK: MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
|
|
|
# QMK: MATRIX_ROW_PINS { D7, E6, B4, D2, D4 }
|
2019-07-25 09:32:20 +02:00
|
|
|
col_pins = (board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
|
|
|
|
row_pins = (board.D11, board.D10, board.D9, board.RX, board.D13)
|
2018-12-29 08:20:03 +01:00
|
|
|
diode_orientation = DiodeOrientation.COLUMNS
|
|
|
|
|
|
|
|
split_flip = True
|
2022-02-20 21:28:52 +01:00
|
|
|
split_offset = (6, 6, 6, 6, 6)
|
2019-07-13 02:11:36 +02:00
|
|
|
split_type = 'UART'
|
2020-10-21 21:19:42 +02:00
|
|
|
data_pin = board.SCL
|
|
|
|
data_pin2 = board.SDA
|
|
|
|
rgb_num_pixels = 12
|
|
|
|
i2c = board.I2C
|
2019-07-13 02:11:36 +02:00
|
|
|
rgb_pixel_pin = board.TX
|
|
|
|
led_pin = board.D7
|
2019-05-13 02:04:23 +02:00
|
|
|
|
|
|
|
# Buckle up friends, the bottom row of this keyboard is wild, and making
|
|
|
|
# our layouts match, visually, what the keyboard looks like, requires some
|
|
|
|
# surgery on the bottom two rows of coords
|
|
|
|
|
|
|
|
# Row index 3 is actually perfectly sane and we _could_ expose it
|
|
|
|
# just like the above three rows, however, visually speaking, the
|
|
|
|
# top-right thumb cluster button (when looking at the left-half PCB)
|
|
|
|
# is more inline with R3, so we'll jam that key (and its mirror) in here
|
2022-02-20 21:28:52 +01:00
|
|
|
# flake8: noqa
|
|
|
|
coord_mapping = [
|
|
|
|
0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31,
|
|
|
|
6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37,
|
|
|
|
12, 13, 14, 15, 16, 17, 48, 47, 46, 45, 44, 43,
|
|
|
|
18, 19, 20, 21, 22, 23, 26, 57, 54, 53, 52, 51, 50, 49,
|
|
|
|
28, 29, 30, 60, 59, 58,
|
|
|
|
]
|