From 3e540a762185f7e9cd71f4cfeea429a2349f6988 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Tue, 30 Aug 2022 22:45:30 -0400 Subject: [PATCH 1/3] Add Elite-Pi converter --- data/mappings/defaults.json | 6 +++ data/schemas/keyboard.jsonschema | 2 +- docs/feature_converters.md | 7 ++- docs/squeezing_avr.md | 1 + .../promicro_to_elite_pi/_pin_defs.h | 43 +++++++++++++++++++ .../promicro_to_elite_pi/converter.mk | 9 ++++ 6 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h create mode 100644 platforms/chibios/converters/promicro_to_elite_pi/converter.mk diff --git a/data/mappings/defaults.json b/data/mappings/defaults.json index c855e64d338a..ea9f6972c5af 100644 --- a/data/mappings/defaults.json +++ b/data/mappings/defaults.json @@ -10,6 +10,12 @@ "bootloader": "atmel-dfu", "pin_compatible": "promicro" }, + "elite_pi": { + "processor": "RP2040", + "bootloader": "rp2040", + "board": "QMK_PM2040", + "pin_compatible": "promicro" + }, "proton_c": { "processor": "STM32F303", "bootloader": "stm32-dfu", diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 0308f451167e..e96fd2554abb 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -34,7 +34,7 @@ }, "development_board": { "type": "string", - "enum": ["promicro", "elite_c", "proton_c", "kb2040", "promicro_rp2040", "blok", "bit_c_pro", "stemcell", "bluepill", "blackpill_f401", "blackpill_f411", "bonsai_c4"] + "enum": ["promicro", "elite_c", "elite_pi", "proton_c", "kb2040", "promicro_rp2040", "blok", "bit_c_pro", "stemcell", "bluepill", "blackpill_f401", "blackpill_f411", "bonsai_c4"] }, "pin_compatible": { "type": "string", diff --git a/docs/feature_converters.md b/docs/feature_converters.md index fe12254efead..1323bdb3729a 100644 --- a/docs/feature_converters.md +++ b/docs/feature_converters.md @@ -17,6 +17,7 @@ Currently the following converters are available: | `promicro` | `bit_c_pro` | | `promicro` | `stemcell` | | `promicro` | `bonsai_c4` | +| `promicro` | `elite_pi` | See below for more in depth information on each converter. @@ -60,6 +61,7 @@ If a board currently supported in QMK uses a [Pro Micro](https://www.sparkfun.co | [Bit-C PRO](https://nullbits.co/bit-c-pro) | `bit_c_pro` | | [STeMCell](https://github.com/megamind4089/STeMCell) | `stemcell` | | [customMK Bonsai C4](https://shop.custommk.com/products/bonsai-c4-microcontroller-board) | `bonsai_c4` | +| [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) | `elite_pi` | Converter summary: @@ -72,6 +74,7 @@ Converter summary: | `bit_c_pro` | `-e CONVERT_TO=bit_c_pro` | `CONVERT_TO=bit_c_pro` | `#ifdef CONVERT_TO_BIT_C_PRO` | | `stemcell` | `-e CONVERT_TO=stemcell` | `CONVERT_TO=stemcell` | `#ifdef CONVERT_TO_STEMCELL` | | `bonsai_c4` | `-e CONVERT_TO=bonsai_c4` | `CONVERT_TO=bonsai_c4` | `#ifdef CONVERT_TO_BONSAI_C4` | +| `elite_pi` | `-e CONVERT_TO=elite_pi` | `CONVERT_TO=elite_pi` | `#ifdef CONVERT_TO_ELITE_PI` | ### Proton C :id=proton_c @@ -102,7 +105,7 @@ The following defaults are based on what has been implemented for [RP2040](platf | USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) | | [Split keyboards](feature_split_keyboard.md) | Partial via `PIO` vendor driver - heavily dependent on enabled features | -### SparkFun Pro Micro - RP2040, Blok, and Bit-C PRO :id=promicro_rp2040 +### SparkFun Pro Micro - RP2040, Blok, Bit-C PRO, and Elite-Pi :id=promicro_rp2040 Currently identical to [Adafruit KB2040](#kb2040). @@ -135,4 +138,4 @@ The Bonsai C4 only has one on-board LED (B2), and by default, both the Pro Micro #define B0 PAL_LINE(GPIOA, 9) ``` -No peripherals are enabled by default at this time, but example code to enable SPI, I2C, PWM, and Serial communications can be found [here](/keyboards/custommk/bonsai_c4_template) \ No newline at end of file +No peripherals are enabled by default at this time, but example code to enable SPI, I2C, PWM, and Serial communications can be found [here](/keyboards/custommk/bonsai_c4_template) diff --git a/docs/squeezing_avr.md b/docs/squeezing_avr.md index bb8e460024de..caf18002c019 100644 --- a/docs/squeezing_avr.md +++ b/docs/squeezing_avr.md @@ -192,6 +192,7 @@ That said, there are a number of Pro Micro replacements with ARM controllers: * [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040) * [SparkFun Pro Micro - RP2040](https://www.sparkfun.com/products/18288) * [Blok](https://boardsource.xyz/store/628b95b494dfa308a6581622) +* [Elite-Pi](https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040) There are other, non-Pro Micro compatible boards out there. The most popular being: * [WeAct Blackpill F411](https://www.aliexpress.com/item/1005001456186625.html) (~$6 USD) diff --git a/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h new file mode 100644 index 000000000000..e21328f79f50 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h @@ -0,0 +1,43 @@ +// Copyright 2022 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Left side (front) +#define D3 0U +#define D2 1U +// GND +// GND +#define D1 2U +#define D0 3U +#define D4 4U +#define C6 5U +#define D7 6U +#define E6 7U +#define B4 8U +#define B5 9U + +// Extra Elite-C compatible pins +#define B7 12U +#define D5 13U +#define C7 14U +#define F1 15U +#define F0 16U + +// Right side (front) +// RAW +// GND +// RESET +// VCC +#define F4 29U +#define F5 28U +#define F6 27U +#define F7 26U +#define B1 22U +#define B3 20U +#define B2 23U +#define B6 21U + +// Extra pads on back +#define D6 10U +#define B0 11U diff --git a/platforms/chibios/converters/promicro_to_elite_pi/converter.mk b/platforms/chibios/converters/promicro_to_elite_pi/converter.mk new file mode 100644 index 000000000000..590a0041892c --- /dev/null +++ b/platforms/chibios/converters/promicro_to_elite_pi/converter.mk @@ -0,0 +1,9 @@ +# Elite-Pi MCU settings for converting AVR projects +MCU := RP2040 +BOARD := QMK_PM2040 +BOOTLOADER := rp2040 + +# These are defaults based on what has been implemented for RP2040 boards +SERIAL_DRIVER ?= vendor +WS2812_DRIVER ?= vendor +BACKLIGHT_DRIVER ?= software From d4d077cc7bd2f37d4580fec4e5a881614673397e Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 31 Aug 2022 22:05:36 -0400 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Joel Challis --- .../converters/promicro_to_elite_pi/_pin_defs.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h index e21328f79f50..bcf0eb791757 100644 --- a/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h +++ b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h @@ -17,13 +17,6 @@ #define B4 8U #define B5 9U -// Extra Elite-C compatible pins -#define B7 12U -#define D5 13U -#define C7 14U -#define F1 15U -#define F0 16U - // Right side (front) // RAW // GND @@ -37,7 +30,3 @@ #define B3 20U #define B2 23U #define B6 21U - -// Extra pads on back -#define D6 10U -#define B0 11U From d0de96599ff587cdbf24773c24732e619bd30af2 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 4 Sep 2022 18:55:58 -0400 Subject: [PATCH 3/3] Update platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h Co-authored-by: Joel Challis --- platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h index bcf0eb791757..1372bef79e8d 100644 --- a/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h +++ b/platforms/chibios/converters/promicro_to_elite_pi/_pin_defs.h @@ -30,3 +30,7 @@ #define B3 20U #define B2 23U #define B6 21U + +// LEDs +#define D5 12U +#define B0 13U