move boards out of kmk

This commit is contained in:
Kyle Brown
2020-10-29 16:42:04 -07:00
parent 2edad3c371
commit 7566981966
26 changed files with 25 additions and 14 deletions

0
boards/__init__.py Normal file
View File

View File

View File

@@ -0,0 +1,14 @@
import board
from kmk.extensions.layers import Layers
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.D9, board.D10, board.D11, board.D12, board.D13, board.SCL)
row_pins = (board.A3, board.A4, board.A5, board.SCK, board.MOSI)
diode_orientation = DiodeOrientation.COLUMNS
layers_ext = Layers()
extensions = [layers_ext]

View File

@@ -0,0 +1,35 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.A0,
board.A1,
board.A2,
board.A3,
board.A4,
board.A5,
board.SCK,
board.MOSI,
)
row_pins = (
board.TX,
board.RX,
board.SDA,
board.SCL,
board.D13,
board.D12,
board.D11,
board.D10,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.D9
rgb_num_pixels = 12
rgb_ext = RGB(pixel_pin=board.TX, num_pixels=12)
layers_ext = Layers()
extensions = [rgb_ext, layers_ext]

View File

View File

@@ -0,0 +1,26 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.RX,
board.D13,
board.A0,
board.D11,
board.A4,
board.A5,
board.D10,
board.D9,
board.SCK,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=9)
layers_ext = Layers()
extensions = [rgb_ext, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A1, board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
row_pins = (board.A0, board.D11, board.D10, board.D9)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [7, 7, 7, 7]
rgb_ext = RGB(pixel_pin=board.TX, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
row_pins = (board.D11, board.D10, board.D9, board.D7, board.D13)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,51 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
# 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 }
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)
diode_orientation = DiodeOrientation.COLUMNS
split_flip = True
split_offsets = (6, 6, 6, 6, 6)
split_type = 'UART'
uart_pin = board.SCL
extra_data_pin = board.SDA
rgb_pixel_pin = board.TX
led_pin = board.D7
coord_mapping = []
coord_mapping.extend(ic(0, x) for x in range(12))
coord_mapping.extend(ic(1, x) for x in range(12))
coord_mapping.extend(ic(2, x) for x in range(12))
# 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
coord_mapping.extend(ic(3, x) for x in range(6))
coord_mapping.append(ic(4, 2))
coord_mapping.append(ic(4, 9))
coord_mapping.extend(ic(3, x) for x in range(6, 12)) # Now, the rest of R3
# And now, to handle R4, which at this point is down to just six keys
coord_mapping.extend(ic(4, x) for x in range(3, 9))
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,34 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.SDA,
board.A2,
board.A3,
board.A4,
board.A5,
board.SCK,
board.MOSI,
)
row_pins = (
board.TX,
board.A0,
board.RX,
board.A1,
board.D11,
board.D9,
board.D12,
board.D10,
)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.D13
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
extensions = [rgb_ext, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A2, board.A3, board.A4, board.A5, board.SCK, board.A0)
row_pins = (board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,26 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
row_pins = (board.D13, board.D11, board.D10, board.D9)
diode_orientation = DiodeOrientation.COLUMNS
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6, 6]
uart_pin = board.SCL
extra_data_pin = board.SDA
rgb_pixel_pin = board.TX
# led_pin = board.D7
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,24 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
extra_data_pin = board.SDA
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,24 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.RX, board.A1, board.A2, board.A3, board.A4, board.A5)
row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
split_type = 'UART'
split_flip = True
uart_pin = board.SCL
rgb_pixel_pin = board.TX
extra_data_pin = board.SDA
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
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)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,32 @@
import board
from kmk.extensions.layers import Layers
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.A0,
board.A1,
board.A2,
board.A3,
board.A4,
board.A5,
board.SCK,
board.MOSI,
)
row_pins = (
board.TX,
board.RX,
board.SDA,
board.SCL,
board.D9,
board.D10,
board.D12,
board.D11,
board.D13,
)
diode_orientation = DiodeOrientation.COLUMNS
layers_ext = Layers()
extensions = [layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A1, board.A2, board.A3, board.A4, board.A5, board.SCK, board.MOSI)
row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [7, 7, 7, 7, 7]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A0, board.A1, board.A2, board.A3, board.A4, board.A5, board.SCK)
row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [7, 7, 7, 7, 7]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.A5, board.A4, board.A3, board.A2, board.A1, board.A0)
row_pins = (board.D7, board.D9, board.D10, board.D11)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

View File

@@ -0,0 +1,23 @@
import board
from kmk.extensions.layers import Layers
from kmk.extensions.rgb import RGB
from kmk.extensions.split import Split
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
class KMKKeyboard(_KMKKeyboard):
col_pins = (board.MOSI, board.SCK, board.A5, board.A4, board.A3, board.A2)
row_pins = (board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.TX
uart_pin = board.SCL
split_type = 'UART'
split_flip = True
split_offsets = [6, 6, 6, 6]
rgb_ext = RGB(pixel_pin=rgb_pixel_pin, num_pixels=12)
layers_ext = Layers()
split = Split(uart_pin=uart_pin, split_offsets=split_offsets)
extensions = [rgb_ext, split, layers_ext]

46
boards/klarank.py Normal file
View File

@@ -0,0 +1,46 @@
import board
from kmk.extensions.layers import Layers
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
# Implements what used to be handled by KMKKeyboard.swap_indicies for this
# board, by flipping various row3 (bottom physical row) keys so their
# coord_mapping matches what the user pressed (even if the wiring
# underneath is sending different coordinates)
_r3_swap_conversions = {3: 9, 4: 10, 5: 11, 9: 3, 10: 4, 11: 5}
def r3_swap(col):
try:
return _r3_swap_conversions[col]
except KeyError:
return col
class KMKKeyboard(_KMKKeyboard):
# physical, visible cols (SCK, MO, MI, RX, TX, D4)
# physical, visible rows (10, 11, 12, 13) (9, 6, 5, SCL)
col_pins = (board.SCK, board.MOSI, board.MISO, board.RX, board.TX, board.D4)
row_pins = (
board.D10,
board.D11,
board.D12,
board.D13,
board.D9,
board.D6,
board.D5,
board.SCL,
)
rollover_cols_every_rows = 4
diode_orientation = DiodeOrientation.COLUMNS
coord_mapping = []
coord_mapping.extend(ic(0, x) for x in range(12))
coord_mapping.extend(ic(1, x) for x in range(12))
coord_mapping.extend(ic(2, x) for x in range(12))
coord_mapping.extend(ic(3, r3_swap(x)) for x in range(12))
layers_ext = Layers()
extensions = [layers_ext]

37
boards/nice_nano/crkbd.py Normal file
View File

@@ -0,0 +1,37 @@
import board
from kmk.extensions.layers import Layers
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.matrix import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.P0_31,
board.P0_29,
board.P0_02,
board.P1_15,
board.P1_13,
board.P1_11,
)
row_pins = (board.P0_22, board.P0_24, board.P1_00, board.P0_11)
diode_orientation = DiodeOrientation.COLUMNS
split_type = 'UART' # TODO add bluetooth support as well
split_flip = True
uart_pin = board.P0_08
rgb_pixel_pin = board.P0_06
extra_data_pin = board.SDA # TODO This is incorrect. Find better solution
i2c = board.I2C
coord_mapping = []
coord_mapping.extend(ic(0, x) for x in range(12))
coord_mapping.extend(ic(1, x) for x in range(12))
coord_mapping.extend(ic(2, x) for x in range(12))
# And now, to handle R3, which at this point is down to just six keys
coord_mapping.extend(ic(3, x) for x in range(3, 9))
layers_ext = Layers()
extensions = [layers_ext]