Port kb2040 boards and add to quickpin

This commit is contained in:
Kyle Brown 2022-10-09 09:08:03 -07:00 committed by xs5871
parent 9842035834
commit 60e8f35eca
7 changed files with 88 additions and 75 deletions

View File

@ -2,12 +2,24 @@
![ffkb](https://fingerpunch.xyz/product/faux-fox-keyboard) ![ffkb](https://fingerpunch.xyz/product/faux-fox-keyboard)
A 36 or 42 key keyboard with support for per key LEDs, 2 rotary encoders (EC11 or evqwgd001), and a feature in the center (EC11, OLED (128x64), or pimoroni trackball). KMK support is available for the BYO MCU option only. A 36 or 42 key keyboard with support for per key LEDs, 2 rotary encoders (EC11
or evqwgd001), and a feature in the center (EC11, OLED (128x64), or pimoroni
Use `kb2040/kb.py` when using a KB2040 MCU. trackball). KMK support is available for the BYO MCU option only.
Use `nice_nano/kb.py` when using a Nice!Nano v2 MCU. Use `nice_nano/kb.py` when using a Nice!Nano v2 MCU.
> Note: The Nice!Nano doesn't have a lot of ROM, so there are a couple of extra steps. See guidance [over here](../../docs/Officially_Supported_Microcontrollers.md#nicenano). > Note: The Nice!Nano doesn't have a lot of ROM, so there are a couple of extra
> steps. See guidance [over
> here](../../docs/Officially_Supported_Microcontrollers.md#nicenano).
Use `kb2040/kb.py` when using any other pro micro footprint MCU.
An example `main.py` file is included for each MCU. An example `main.py` file is included for each MCU.
## Microcontroller support
Update this line in `kb.py` to any supported microcontroller in `kmk/quickpin/pro_micro`
```python
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
```

View File

@ -1,35 +1,37 @@
import board import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
from kmk.scanners import DiodeOrientation from kmk.scanners import DiodeOrientation
from kmk.scanners import intify_coordinate as ic from kmk.scanners import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
col_pins = ( col_pins = (
board.D9, pins[11],
board.D8, pins[10],
board.D7, pins[9],
board.D6, pins[8],
board.D5, pins[7],
board.D4, pins[6],
board.MOSI, pins[10],
board.MISO, pins[12],
) )
row_pins = ( row_pins = (
board.D1, pins[1],
board.A3, pins[19],
board.A2, pins[18],
board.A1, pins[17],
board.A0, pins[16],
board.SCK, pins[15],
) )
diode_orientation = DiodeOrientation.COLUMNS diode_orientation = DiodeOrientation.COLUMNS
rgb_pixel_pin = board.D0 rgb_pixel_pin = pins[0]
rgb_num_pixels = 42 rgb_num_pixels = 42
i2c = board.I2C i2c = board.I2C
# flake8: noqa # flake8: noqa
# fmt: off
coord_mapping = [ coord_mapping = [
ic(0, 0), ic(0, 1), ic(0, 2), ic(0, 3), ic(0, 4), ic(0, 5), ic(0, 6), ic(0, 7), ic(4, 3), ic(3, 4), ic(4, 5), ic(3, 7), ic(0, 0), ic(0, 1), ic(0, 2), ic(0, 3), ic(0, 4), ic(0, 5), ic(0, 6), ic(0, 7), ic(4, 3), ic(3, 4), ic(4, 5), ic(3, 7),
ic(1, 0), ic(1, 1), ic(1, 2), ic(1, 3), ic(1, 4), ic(1, 5), ic(4, 1), ic(1, 6), ic(1, 7), ic(3, 2), ic(4, 4), ic(3, 5), ic(4, 7), ic(1, 0), ic(1, 1), ic(1, 2), ic(1, 3), ic(1, 4), ic(1, 5), ic(4, 1), ic(1, 6), ic(1, 7), ic(3, 2), ic(4, 4), ic(3, 5), ic(4, 7),

View File

@ -8,12 +8,10 @@ was designed with QMK in mind and KMK implementation is not officially supported
Keyboard works with controllers having Pro Micro layout. Existing configurations: Keyboard works with controllers having Pro Micro layout. Existing configurations:
| PCB version | Board | Config file | | PCB version | Board | Config file |
|:-----------:|----------------------------------------------------------------------|---------------------------| |:-----------:|-------------------------------------|---------------------------|
| 1.* | [SparkFun Pro Micro RP2040](https://www.sparkfun.com/products/18288) | kyria_v1_rp2040 | | 1.* | Any quickpin pro micro based board. | kb_v1_ |
| 1.* | [Adafruit KB2040](https://www.adafruit.com/product/5302) | kyria_v1_kb2040 | | 2.* | Any quickpin pro micro based board. | _waiting for pinout docs_ |
| 2.* | [SparkFun Pro Micro RP2040](https://www.sparkfun.com/products/18288) | _waiting for pinout docs_ |
| 2.* | [Adafruit KB2040](https://www.adafruit.com/product/5302) | _waiting for pinout docs_ |
## Compatibility issues ## Compatibility issues
@ -51,3 +49,11 @@ Because of the above, besides of normal installation steps, you have to also:
- install Circuit Python in 7.2+ version - install Circuit Python in 7.2+ version
- add `adafruit_pioasm.mpy` library to lib or root folder of a board - add `adafruit_pioasm.mpy` library to lib or root folder of a board
## Microcontroller support
Update this line in `kb.py` to any supported microcontroller in `kmk/quickpin/pro_micro`
```python
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
```

View File

@ -1,27 +1,26 @@
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
from kmk.scanners import DiodeOrientation from kmk.scanners import DiodeOrientation
from kmk.scanners import intify_coordinate as ic from kmk.scanners import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard): class KMKKeyboard(_KMKKeyboard):
col_pins = ( col_pins = (
board.A3, pins[19],
board.A2, pins[18],
board.A1, pins[17],
board.A0, pins[16],
board.SCK, pins[15],
board.MISO, pins[14],
board.MOSI, pins[13],
board.D10, pins[12],
) )
row_pins = (board.D8, board.D7, board.D6, board.D4) row_pins = (pins[10], pins[9], pins[8], pins[6])
diode_orientation = DiodeOrientation.COL2ROW diode_orientation = DiodeOrientation.COL2ROW
data_pin = board.D1 data_pin = pins[1]
rgb_pixel_pin = board.D0 rgb_pixel_pin = pins[0]
encoder_pin_0 = board.D9 encoder_pin_0 = pins[11]
encoder_pin_1 = board.D5 encoder_pin_1 = pins[7]
coord_mapping = [] coord_mapping = []
coord_mapping.extend(ic(0, x, 8) for x in range(6)) coord_mapping.extend(ic(0, x, 8) for x in range(6))

View File

@ -1,34 +0,0 @@
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.scanners import DiodeOrientation
from kmk.scanners import intify_coordinate as ic
class KMKKeyboard(_KMKKeyboard):
col_pins = (
board.D29,
board.D28,
board.D27,
board.D26,
board.D22,
board.D20,
board.D23,
board.D21,
)
row_pins = (board.D8, board.D7, board.D6, board.D4)
diode_orientation = DiodeOrientation.COL2ROW
data_pin = board.RX
rgb_pixel_pin = board.D0
encoder_pin_0 = board.D9
encoder_pin_1 = board.D5
coord_mapping = []
coord_mapping.extend(ic(0, x, 8) for x in range(6))
coord_mapping.extend(ic(4, x, 8) for x in range(5, -1, -1))
coord_mapping.extend(ic(1, x, 8) for x in range(6))
coord_mapping.extend(ic(5, x, 8) for x in range(5, -1, -1))
coord_mapping.extend(ic(2, x, 8) for x in range(8))
coord_mapping.extend(ic(6, x, 8) for x in range(7, -1, -1))
coord_mapping.extend(ic(3, x, 8) for x in range(3, 8))
coord_mapping.extend(ic(7, x, 8) for x in range(7, 2, -1))

View File

@ -0,0 +1,28 @@
import board
pinout = [
board.D0,
board.D1,
None, # GND
None, # GND
board.D2,
board.D3,
board.D4,
board.D5,
board.D6,
board.D7,
board.D8,
board.D9,
board.D10,
board.MOSI,
board.MISO,
board.SCK,
board.A0,
board.A1,
board.A2,
board.A3,
None, # 3.3v
None, # RST
None, # GND
None, # RAW
]