Added board definition for nyquist and add RGB and LED pins for nyquest and iris
This commit is contained in:
@@ -16,8 +16,11 @@ class Firmware(_Firmware):
|
||||
|
||||
split_flip = True
|
||||
split_offsets = (6, 6, 6, 6, 6)
|
||||
split_type = "UART"
|
||||
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))
|
19
kmk/boards/levinson_converter.py
Normal file
19
kmk/boards/levinson_converter.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import board
|
||||
|
||||
from kmk.consts import DiodeOrientation
|
||||
from kmk.mcus.circuitpython_samd51 import Firmware as _Firmware
|
||||
from kmk.pins import Pin as P
|
||||
|
||||
|
||||
class Firmware(_Firmware):
|
||||
col_pins = (P.A2, P.A3, P.A4, P.A5, P.SCK, P.MOSI)
|
||||
row_pins = (P.D13, P.D11, P.D10, P.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
|
19
kmk/boards/nyquist_converter.py
Normal file
19
kmk/boards/nyquist_converter.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import board
|
||||
|
||||
from kmk.consts import DiodeOrientation
|
||||
from kmk.mcus.circuitpython_samd51 import Firmware as _Firmware
|
||||
from kmk.pins import Pin as P
|
||||
|
||||
|
||||
class Firmware(_Firmware):
|
||||
col_pins = (P.RX, P.A1, P.A2, P.A3, P.A4, P.A5)
|
||||
row_pins = (P.D13, P.D11, P.D10, P.D9, P.D7)
|
||||
diode_orientation = DiodeOrientation.COLUMNS
|
||||
|
||||
split_type = 'UART'
|
||||
split_flip = True
|
||||
split_offsets = [6, 6, 6, 6, 6]
|
||||
uart_pin = board.SCL
|
||||
rgb_pixel_pin = board.TX
|
||||
extra_data_pin = board.SDA
|
||||
|
@@ -150,16 +150,22 @@ class Firmware:
|
||||
self._send_hid()
|
||||
|
||||
def _handle_matrix_report(self, update=None):
|
||||
"""
|
||||
'''
|
||||
Bulk processing of update code for each cycle
|
||||
:param update:
|
||||
"""
|
||||
'''
|
||||
if update is not None:
|
||||
self._state.matrix_changed(
|
||||
update[0],
|
||||
update[1],
|
||||
update[2],
|
||||
)
|
||||
# TODO Sort why this is needed when mashing keys on split half
|
||||
# This is a dirty hack to prevent crashes in unrealistic cases
|
||||
try:
|
||||
self._state.matrix_changed(
|
||||
update[0],
|
||||
update[1],
|
||||
update[2],
|
||||
)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print(update)
|
||||
|
||||
def _send_to_master(self, update):
|
||||
if self.split_master_left:
|
||||
@@ -181,11 +187,11 @@ class Firmware:
|
||||
return None
|
||||
|
||||
def _send_debug(self, message):
|
||||
"""
|
||||
'''
|
||||
Prepends DEB and appends a newline to allow debug messages to
|
||||
be detected and handled differently than typical keypresses.
|
||||
:param message: Debug message
|
||||
"""
|
||||
'''
|
||||
if self.uart is not None:
|
||||
self.uart.write('DEB')
|
||||
self.uart.write(message, '\n')
|
||||
@@ -221,9 +227,9 @@ class Firmware:
|
||||
if self.split_flip and not self._master_half():
|
||||
self.col_pins = list(reversed(self.col_pins))
|
||||
|
||||
if self.split_side == "Left":
|
||||
if self.split_side == 'Left':
|
||||
self.split_master_left = self._master_half()
|
||||
elif self.split_side == "Right":
|
||||
elif self.split_side == 'Right':
|
||||
self.split_master_left = not self._master_half()
|
||||
|
||||
if self.uart_pin is not None:
|
||||
@@ -262,7 +268,7 @@ class Firmware:
|
||||
del self.leader_dictionary[k]
|
||||
|
||||
if self.debug_enabled:
|
||||
print("Firin' lazers. Keyboard is booted.")
|
||||
print('Firin\' lazers. Keyboard is booted.')
|
||||
|
||||
while True:
|
||||
state_changed = False
|
||||
|
16
kmk/keys.py
16
kmk/keys.py
@@ -432,18 +432,18 @@ make_key(code=39, names=('0', 'N0'))
|
||||
gc.collect()
|
||||
|
||||
# More ASCII standard keys
|
||||
make_key(code=40, names=('ENTER', 'ENT', "\n"))
|
||||
make_key(code=40, names=('ENTER', 'ENT', '\n'))
|
||||
make_key(code=41, names=('ESCAPE', 'ESC'))
|
||||
make_key(code=42, names=('BACKSPACE', 'BSPC', 'BKSP'))
|
||||
make_key(code=43, names=('TAB', "\t"))
|
||||
make_key(code=43, names=('TAB', '\t'))
|
||||
make_key(code=44, names=('SPACE', 'SPC', ' '))
|
||||
make_key(code=45, names=('MINUS', 'MINS', '-'))
|
||||
make_key(code=46, names=('EQUAL', 'EQL', '='))
|
||||
make_key(code=47, names=('LBRACKET', 'LBRC', '['))
|
||||
make_key(code=48, names=('RBRACKET', 'RBRC', ']'))
|
||||
make_key(code=49, names=('BACKSLASH', 'BSLASH', 'BSLS', "\\"))
|
||||
make_key(code=49, names=('BACKSLASH', 'BSLASH', 'BSLS', '\\'))
|
||||
make_key(code=51, names=('SEMICOLON', 'SCOLON', 'SCLN', ';'))
|
||||
make_key(code=52, names=('QUOTE', 'QUOT', "'"))
|
||||
make_key(code=52, names=('QUOTE', 'QUOT', '\''))
|
||||
make_key(code=53, names=('GRAVE', 'GRV', 'ZKHK', '`'))
|
||||
make_key(code=54, names=('COMMA', 'COMM', ','))
|
||||
make_key(code=55, names=('DOT', '.'))
|
||||
@@ -531,7 +531,7 @@ make_key(code=134, names=('KP_EQUAL_AS400', 'NUMPAD_EQUAL_AS400'))
|
||||
gc.collect()
|
||||
|
||||
# Making life better for folks on tiny keyboards especially: exposes
|
||||
# the "shifted" keys as raw keys. Under the hood we're still
|
||||
# the 'shifted' keys as raw keys. Under the hood we're still
|
||||
# sending Shift+(whatever key is normally pressed) to get these, so
|
||||
# for example `KC_AT` will hold shift and press 2.
|
||||
make_shifted_key('GRAVE', names=('TILDE', 'TILD', '~'))
|
||||
@@ -551,7 +551,7 @@ make_shifted_key('LBRACKET', names=('LEFT_CURLY_BRACE', 'LCBR', '{'))
|
||||
make_shifted_key('RBRACKET', names=('RIGHT_CURLY_BRACE', 'RCBR', '}'))
|
||||
make_shifted_key('BACKSLASH', names=('PIPE', '|'))
|
||||
make_shifted_key('SEMICOLON', names=('COLON', 'COLN', ':'))
|
||||
make_shifted_key('QUOTE', names=('DOUBLE_QUOTE', 'DQUO', 'DQT', '"'))
|
||||
make_shifted_key('QUOTE', names=('DOUBLE_QUOTE', 'DQUO', 'DQT', '\''))
|
||||
make_shifted_key('COMMA', names=('LEFT_ANGLE_BRACKET', 'LABK', '<'))
|
||||
make_shifted_key('DOT', names=('RIGHT_ANGLE_BRACKET', 'RABK', '>'))
|
||||
make_shifted_key('SLSH', names=('QUESTION', 'QUES', '?'))
|
||||
@@ -584,9 +584,9 @@ make_key(code=152, names=('LANG9',))
|
||||
|
||||
gc.collect()
|
||||
|
||||
# Consumer ("media") keys. Most known keys aren't supported here. A much
|
||||
# Consumer ('media') keys. Most known keys aren't supported here. A much
|
||||
# longer list used to exist in this file, but the codes were almost certainly
|
||||
# incorrect, conflicting with each other, or otherwise "weird". We'll add them
|
||||
# incorrect, conflicting with each other, or otherwise 'weird'. We'll add them
|
||||
# back in piecemeal as needed. PRs welcome.
|
||||
#
|
||||
# A super useful reference for these is http://www.freebsddiary.org/APC/usb_hid_usages.php
|
||||
|
Reference in New Issue
Block a user