From 270be1fa2874798f5fc96c7047affcbde395a2f5 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Wed, 7 Jul 2021 12:44:11 -0700 Subject: [PATCH] initial support for RP2040 Pro Micro corne --- boards/crkbd/kb_rp2040.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 boards/crkbd/kb_rp2040.py diff --git a/boards/crkbd/kb_rp2040.py b/boards/crkbd/kb_rp2040.py new file mode 100644 index 0000000..b86d44f --- /dev/null +++ b/boards/crkbd/kb_rp2040.py @@ -0,0 +1,29 @@ +import board + +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.A3, + board.A2, + board.A1, + board.A0, + board.SCK, + board.MISO, + ) + row_pins = (board.D4, board.D5, board.D6, board.D7) + diode_orientation = DiodeOrientation.COLUMNS + data_pin = board.RX + rgb_pixel_pin = board.D0 + 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))