diff --git a/data/mappings/keyboard_aliases.hjson b/data/mappings/keyboard_aliases.hjson index f00be052543..b7722092bac 100644 --- a/data/mappings/keyboard_aliases.hjson +++ b/data/mappings/keyboard_aliases.hjson @@ -1860,6 +1860,12 @@ "kin80": { "target": "kin80/blackpill401" }, + "kprepublic/cstc40/daughterboard": { + "target": "kprepublic/cstc40/rev1" + }, + "kprepublic/cstc40/single_pcb": { + "target": "kprepublic/cstc40/rev2" + }, "kumaokobo/kudox_full": { "target": "kumaokobo/kudox_full/rev1" }, diff --git a/keyboards/kprepublic/cstc40/daughterboard/keyboard.json b/keyboards/kprepublic/cstc40/daughterboard/keyboard.json deleted file mode 100644 index cdba7942df8..00000000000 --- a/keyboards/kprepublic/cstc40/daughterboard/keyboard.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "matrix_pins": { - "cols": ["B15", "B14", "B13", "B10", "B12", "A5", "C4", "A7", "A15", "C10", "C11", "C0"], - "rows": ["B1", "B0", "C5", "A6"] - } -} \ No newline at end of file diff --git a/keyboards/kprepublic/cstc40/info.json b/keyboards/kprepublic/cstc40/info.json index 8e4e640b7e2..83a653cc1cc 100644 --- a/keyboards/kprepublic/cstc40/info.json +++ b/keyboards/kprepublic/cstc40/info.json @@ -2,9 +2,7 @@ "manufacturer": "kprepublic", "keyboard_name": "cstc40", "maintainer": "itsvar8", - "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", - "debounce": 2, "features": { "bootmagic": true, "extrakey": true, @@ -14,63 +12,9 @@ }, "processor": "STM32F401", "usb": { - "device_version": "1.0.0", "pid": "0x0040", "vid": "0x586A" }, - "layouts": { - "LAYOUT_planck_mit": { - "layout": [ - { "matrix": [0, 0], "x": 0, "y": 0 }, - { "matrix": [0, 1], "x": 1, "y": 0 }, - { "matrix": [0, 2], "x": 2, "y": 0 }, - { "matrix": [0, 3], "x": 3, "y": 0 }, - { "matrix": [0, 4], "x": 4, "y": 0 }, - { "matrix": [0, 5], "x": 5, "y": 0 }, - { "matrix": [0, 6], "x": 6, "y": 0 }, - { "matrix": [0, 7], "x": 7, "y": 0 }, - { "matrix": [0, 8], "x": 8, "y": 0 }, - { "matrix": [0, 9], "x": 9, "y": 0 }, - { "matrix": [0, 10], "x": 10, "y": 0 }, - { "matrix": [0, 11], "x": 11, "y": 0 }, - { "matrix": [1, 0], "x": 0, "y": 1 }, - { "matrix": [1, 1], "x": 1, "y": 1 }, - { "matrix": [1, 2], "x": 2, "y": 1 }, - { "matrix": [1, 3], "x": 3, "y": 1 }, - { "matrix": [1, 4], "x": 4, "y": 1 }, - { "matrix": [1, 5], "x": 5, "y": 1 }, - { "matrix": [1, 6], "x": 6, "y": 1 }, - { "matrix": [1, 7], "x": 7, "y": 1 }, - { "matrix": [1, 8], "x": 8, "y": 1 }, - { "matrix": [1, 9], "x": 9, "y": 1 }, - { "matrix": [1, 10], "x": 10, "y": 1 }, - { "matrix": [1, 11], "x": 11, "y": 1 }, - { "matrix": [2, 0], "x": 0, "y": 2 }, - { "matrix": [2, 1], "x": 1, "y": 2 }, - { "matrix": [2, 2], "x": 2, "y": 2 }, - { "matrix": [2, 3], "x": 3, "y": 2 }, - { "matrix": [2, 4], "x": 4, "y": 2 }, - { "matrix": [2, 5], "x": 5, "y": 2 }, - { "matrix": [2, 6], "x": 6, "y": 2 }, - { "matrix": [2, 7], "x": 7, "y": 2 }, - { "matrix": [2, 8], "x": 8, "y": 2 }, - { "matrix": [2, 9], "x": 9, "y": 2 }, - { "matrix": [2, 10], "x": 10, "y": 2 }, - { "matrix": [2, 11], "x": 11, "y": 2 }, - { "matrix": [3, 0], "x": 0, "y": 3 }, - { "matrix": [3, 1], "x": 1, "y": 3 }, - { "matrix": [3, 2], "x": 2, "y": 3 }, - { "matrix": [3, 3], "x": 3, "y": 3 }, - { "matrix": [3, 4], "x": 4, "y": 3 }, - { "matrix": [3, 5], "w": 2, "x": 5, "y": 3 }, - { "matrix": [3, 7], "x": 7, "y": 3 }, - { "matrix": [3, 8], "x": 8, "y": 3 }, - { "matrix": [3, 9], "x": 9, "y": 3 }, - { "matrix": [3, 10], "x": 10, "y": 3 }, - { "matrix": [3, 11], "x": 11, "y": 3 } - ] - } - }, "rgb_matrix": { "animations": { "alphas_mods": true, @@ -94,6 +38,7 @@ "dual_beacon": true, "rainbow_beacon": true, "rainbow_pinwheels": true, + "flower_blooming": true, "raindrops": true, "jellybean_raindrops": true, "hue_breathing": true, @@ -115,59 +60,66 @@ "splash": true, "multisplash": true, "solid_splash": true, - "solid_multisplash": true + "solid_multisplash": true, + "starlight": true, + "starlight_dual_hue": true, + "starlight_dual_sat": true, + "riverflow": true }, - "driver": "is31fl3733", - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, - {"matrix": [0, 1], "x": 20, "y": 0, "flags": 4}, - {"matrix": [0, 2], "x": 40, "y": 0, "flags": 4}, - {"matrix": [0, 3], "x": 61, "y": 0, "flags": 4}, - {"matrix": [0, 4], "x": 81, "y": 0, "flags": 4}, - {"matrix": [0, 5], "x": 101, "y": 0, "flags": 4}, - {"matrix": [0, 6], "x": 122, "y": 0, "flags": 4}, - {"matrix": [0, 7], "x": 142, "y": 0, "flags": 4}, - {"matrix": [0, 8], "x": 162, "y": 0, "flags": 4}, - {"matrix": [0, 9], "x": 183, "y": 0, "flags": 4}, - {"matrix": [0, 10], "x": 203, "y": 0, "flags": 4}, - {"matrix": [0, 11], "x": 224, "y": 0, "flags": 1}, - {"matrix": [1, 0], "x": 0, "y": 21, "flags": 1}, - {"matrix": [1, 1], "x": 20, "y": 21, "flags": 4}, - {"matrix": [1, 2], "x": 40, "y": 21, "flags": 4}, - {"matrix": [1, 3], "x": 61, "y": 21, "flags": 4}, - {"matrix": [1, 4], "x": 81, "y": 21, "flags": 4}, - {"matrix": [1, 5], "x": 101, "y": 21, "flags": 4}, - {"matrix": [1, 6], "x": 122, "y": 21, "flags": 4}, - {"matrix": [1, 7], "x": 142, "y": 21, "flags": 4}, - {"matrix": [1, 8], "x": 162, "y": 21, "flags": 4}, - {"matrix": [1, 9], "x": 183, "y": 21, "flags": 4}, - {"matrix": [1, 10], "x": 203, "y": 21, "flags": 4}, - {"matrix": [1, 11], "x": 224, "y": 21, "flags": 1}, - {"matrix": [2, 0], "x": 0, "y": 42, "flags": 1}, - {"matrix": [2, 1], "x": 20, "y": 42, "flags": 4}, - {"matrix": [2, 2], "x": 40, "y": 42, "flags": 4}, - {"matrix": [2, 3], "x": 61, "y": 42, "flags": 4}, - {"matrix": [2, 4], "x": 81, "y": 42, "flags": 4}, - {"matrix": [2, 5], "x": 101, "y": 42, "flags": 4}, - {"matrix": [2, 6], "x": 122, "y": 42, "flags": 4}, - {"matrix": [2, 7], "x": 142, "y": 42, "flags": 4}, - {"matrix": [2, 8], "x": 162, "y": 42, "flags": 4}, - {"matrix": [2, 9], "x": 183, "y": 42, "flags": 4}, - {"matrix": [2, 10], "x": 203, "y": 42, "flags": 4}, - {"matrix": [2, 11], "x": 224, "y": 42, "flags": 1}, - {"matrix": [3, 0], "x": 0, "y": 64, "flags": 1}, - {"matrix": [3, 1], "x": 20, "y": 64, "flags": 1}, - {"matrix": [3, 2], "x": 40, "y": 64, "flags": 1}, - {"matrix": [3, 3], "x": 61, "y": 64, "flags": 1}, - {"matrix": [3, 4], "x": 81, "y": 64, "flags": 1}, - {"matrix": [3, 5], "x": 111, "y": 64, "flags": 1}, - {"matrix": [3, 7], "x": 142, "y": 64, "flags": 1}, - {"matrix": [3, 8], "x": 162, "y": 64, "flags": 1}, - {"matrix": [3, 9], "x": 183, "y": 64, "flags": 1}, - {"matrix": [3, 10], "x": 203, "y": 64, "flags": 1}, - {"matrix": [3, 11], "x": 224, "y": 64, "flags": 1} - ], - "max_brightness": 200, "sleep": true + }, + "community_layouts": ["planck_mit"], + "layouts": { + "LAYOUT_planck_mit": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [0, 6], "x": 6, "y": 0}, + {"matrix": [0, 7], "x": 7, "y": 0}, + {"matrix": [0, 8], "x": 8, "y": 0}, + {"matrix": [0, 9], "x": 9, "y": 0}, + {"matrix": [0, 10], "x": 10, "y": 0}, + {"matrix": [0, 11], "x": 11, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + {"matrix": [1, 6], "x": 6, "y": 1}, + {"matrix": [1, 7], "x": 7, "y": 1}, + {"matrix": [1, 8], "x": 8, "y": 1}, + {"matrix": [1, 9], "x": 9, "y": 1}, + {"matrix": [1, 10], "x": 10, "y": 1}, + {"matrix": [1, 11], "x": 11, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + {"matrix": [2, 6], "x": 6, "y": 2}, + {"matrix": [2, 7], "x": 7, "y": 2}, + {"matrix": [2, 8], "x": 8, "y": 2}, + {"matrix": [2, 9], "x": 9, "y": 2}, + {"matrix": [2, 10], "x": 10, "y": 2}, + {"matrix": [2, 11], "x": 11, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3, "w": 2}, + {"matrix": [3, 7], "x": 7, "y": 3}, + {"matrix": [3, 8], "x": 8, "y": 3}, + {"matrix": [3, 9], "x": 9, "y": 3}, + {"matrix": [3, 10], "x": 10, "y": 3}, + {"matrix": [3, 11], "x": 11, "y": 3} + ] + } } -} \ No newline at end of file +} diff --git a/keyboards/kprepublic/cstc40/readme.md b/keyboards/kprepublic/cstc40/readme.md index 211c078cc2e..e6493b28a0c 100644 --- a/keyboards/kprepublic/cstc40/readme.md +++ b/keyboards/kprepublic/cstc40/readme.md @@ -1,26 +1,25 @@ -# cstc40 +# CSTC40 -A 40% hotswap ortholinear RGB keyboard from KP Republic. +## This keyboard has 3 known hardware revisions, please be sure to flash the correct firmware for your PCB -* Keyboard Maintainer: [Var](https://github.com/itsvar8) -* Hardware Supported: CSTC40 -* Hardware Availability: kprepublic.com +A 40% hotswap ortholinear RGB keyboard from KP Republic -The differences between the two versions are just the rows and columns pins and the additional small pcb for the daughterboard version. +### Revision 1: "daughterboard" -Make example for this keyboard (after setting up your build environment): +* STM32F402RCT6 MCU with IS31FL3733 LED driver, using `stm32-dfu` bootloader. Uses a separate daughterboard for USB connection. - for daughterboard version: make kprepublic/cstc40/daughterboard:default - for single pcb version: make kprepublic/cstc40/single_pcb:default +* Upon entering bootloader mode QMK Toolbox will display this message: +`STM32 DFU device connected (WinUSB): STMicroelectronics STM32 BOOTLOADER (0483:DF11:2200)` -See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). +### Revision 2: "single pcb" -## Bootloader +* STM32F402RCT6 MCU with IS31FL3733 LED driver, using `stm32-dfu` bootloader. Integrated USB connection. -Enter the bootloader in 3 ways: +* Upon entering bootloader mode QMK Toolbox will display this message: +`STM32 DFU device connected (WinUSB): STMicroelectronics STM32 BOOTLOADER (0483:DF11:2200)` -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available +### Revision 3: "FXTwink single pcb" -The single_pcb uses pin A10, which apparently is a design flaw that prevent the bootloader to start every time - https://docs.qmk.fm/#/platformdev_blackpill_f4x1?id=pins-to-be-avoided. There is a simple workaround that works most of the time - press the pin key (generally the letter R) during the boot. +* STM32F402RCT6 MCU without separate LED driver, using `tinyuf2` bootloader. Integrated USB connection. + +* Upon entering bootloader mode the board will appear in your computer's file system as a new USB mass storage device. diff --git a/keyboards/kprepublic/cstc40/config.h b/keyboards/kprepublic/cstc40/rev1/config.h similarity index 100% rename from keyboards/kprepublic/cstc40/config.h rename to keyboards/kprepublic/cstc40/rev1/config.h diff --git a/keyboards/kprepublic/cstc40/halconf.h b/keyboards/kprepublic/cstc40/rev1/halconf.h similarity index 96% rename from keyboards/kprepublic/cstc40/halconf.h rename to keyboards/kprepublic/cstc40/rev1/halconf.h index 0f279040aae..049b29a046e 100644 --- a/keyboards/kprepublic/cstc40/halconf.h +++ b/keyboards/kprepublic/cstc40/rev1/halconf.h @@ -17,4 +17,4 @@ #define HAL_USE_I2C TRUE -#include_next \ No newline at end of file +#include_next diff --git a/keyboards/kprepublic/cstc40/rev1/keyboard.json b/keyboards/kprepublic/cstc40/rev1/keyboard.json new file mode 100644 index 00000000000..9574e0bd223 --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev1/keyboard.json @@ -0,0 +1,63 @@ +{ + "bootloader": "stm32-dfu", + "matrix_pins": { + "cols": ["B15", "B14", "B13", "B10", "B12", "A5", "C4", "A7", "A15", "C10", "C11", "C0"], + "rows": ["B1", "B0", "C5", "A6"] + }, + "rgb_matrix": { + "driver": "is31fl3733", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 20, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 40, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 61, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 81, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 101, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 122, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 142, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 162, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 183, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 203, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 224, "y": 0, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 1}, + {"matrix": [1, 1], "x": 20, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 40, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 61, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 81, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 101, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 122, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 142, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 162, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 183, "y": 21, "flags": 4}, + {"matrix": [1, 10], "x": 203, "y": 21, "flags": 4}, + {"matrix": [1, 11], "x": 224, "y": 21, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 42, "flags": 1}, + {"matrix": [2, 1], "x": 20, "y": 42, "flags": 4}, + {"matrix": [2, 2], "x": 40, "y": 42, "flags": 4}, + {"matrix": [2, 3], "x": 61, "y": 42, "flags": 4}, + {"matrix": [2, 4], "x": 81, "y": 42, "flags": 4}, + {"matrix": [2, 5], "x": 101, "y": 42, "flags": 4}, + {"matrix": [2, 6], "x": 122, "y": 42, "flags": 4}, + {"matrix": [2, 7], "x": 142, "y": 42, "flags": 4}, + {"matrix": [2, 8], "x": 162, "y": 42, "flags": 4}, + {"matrix": [2, 9], "x": 183, "y": 42, "flags": 4}, + {"matrix": [2, 10], "x": 203, "y": 42, "flags": 4}, + {"matrix": [2, 11], "x": 224, "y": 42, "flags": 1}, + {"matrix": [3, 0], "x": 0, "y": 64, "flags": 1}, + {"matrix": [3, 1], "x": 20, "y": 64, "flags": 1}, + {"matrix": [3, 2], "x": 40, "y": 64, "flags": 1}, + {"matrix": [3, 3], "x": 61, "y": 64, "flags": 1}, + {"matrix": [3, 4], "x": 81, "y": 64, "flags": 1}, + {"matrix": [3, 5], "x": 111, "y": 64, "flags": 1}, + {"matrix": [3, 7], "x": 142, "y": 64, "flags": 1}, + {"matrix": [3, 8], "x": 162, "y": 64, "flags": 1}, + {"matrix": [3, 9], "x": 183, "y": 64, "flags": 1}, + {"matrix": [3, 10], "x": 203, "y": 64, "flags": 1}, + {"matrix": [3, 11], "x": 224, "y": 64, "flags": 1} + ], + "max_brightness": 200 + }, + "usb": { + "device_version": "1.0.0" + } +} diff --git a/keyboards/kprepublic/cstc40/mcuconf.h b/keyboards/kprepublic/cstc40/rev1/mcuconf.h similarity index 96% rename from keyboards/kprepublic/cstc40/mcuconf.h rename to keyboards/kprepublic/cstc40/rev1/mcuconf.h index a56e52fb8da..563b86d26db 100644 --- a/keyboards/kprepublic/cstc40/mcuconf.h +++ b/keyboards/kprepublic/cstc40/rev1/mcuconf.h @@ -18,4 +18,4 @@ #include_next #undef STM32_I2C_USE_I2C1 -#define STM32_I2C_USE_I2C1 TRUE \ No newline at end of file +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/kprepublic/cstc40/rev1/readme.md b/keyboards/kprepublic/cstc40/rev1/readme.md new file mode 100644 index 00000000000..1d688bc977a --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev1/readme.md @@ -0,0 +1,27 @@ +# Rev 1 + +A 40% hotswap ortholinear RGB keyboard from KP Republic. + +* **Revision 1: "daughterboard"** +* Keyboard Maintainer: [Var](https://github.com/itsvar8) +* Hardware Supported: CSTC40 rev1 +* STM32F402RCT6 MCU with IS31FL3733 LED driver and using `stm32-dfu` bootloader. Uses a separate daughterboard for USB connection. +* Hardware Availability: kprepublic.com + +Make example for this keyboard (after setting up your build environment): + + make kprepublic/cstc40/rev1:default + +Flashing example for this keyboard: + + make kprepublic/cstc40/rev1:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/kprepublic/cstc40/single_pcb/single_pcb.c b/keyboards/kprepublic/cstc40/rev1/rev1.c similarity index 99% rename from keyboards/kprepublic/cstc40/single_pcb/single_pcb.c rename to keyboards/kprepublic/cstc40/rev1/rev1.c index 38fac99155a..db063d3eba4 100644 --- a/keyboards/kprepublic/cstc40/single_pcb/single_pcb.c +++ b/keyboards/kprepublic/cstc40/rev1/rev1.c @@ -68,4 +68,4 @@ const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { { 0, SW3_CS11, SW2_CS11, SW1_CS11 }, { 0, SW3_CS12, SW2_CS12, SW1_CS12 } }; -#endif \ No newline at end of file +#endif diff --git a/keyboards/kprepublic/cstc40/rev2/config.h b/keyboards/kprepublic/cstc40/rev2/config.h new file mode 100644 index 00000000000..4f845a84af9 --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev2/config.h @@ -0,0 +1,9 @@ +// Copyright 2022 Var (@itsvar8) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define I2C1_SDA_PIN B9 +#define I2C1_SCL_PIN B8 + +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND diff --git a/keyboards/kprepublic/cstc40/rev2/halconf.h b/keyboards/kprepublic/cstc40/rev2/halconf.h new file mode 100644 index 00000000000..049b29a046e --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev2/halconf.h @@ -0,0 +1,20 @@ +/* Copyright 2020 Nick Brassel (tzarc) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define HAL_USE_I2C TRUE + +#include_next diff --git a/keyboards/kprepublic/cstc40/rev2/keyboard.json b/keyboards/kprepublic/cstc40/rev2/keyboard.json new file mode 100644 index 00000000000..7516bfc205f --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev2/keyboard.json @@ -0,0 +1,63 @@ +{ + "bootloader": "stm32-dfu", + "matrix_pins": { + "cols": ["C7", "C8", "C9", "A8", "A10", "B10", "A15", "C13", "B6", "B5", "B4", "B3"], + "rows": ["C12", "C10", "C11", "B0"] + }, + "rgb_matrix": { + "driver": "is31fl3733", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 20, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 40, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 61, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 81, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 101, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 122, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 142, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 162, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 183, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 203, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 224, "y": 0, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 1}, + {"matrix": [1, 1], "x": 20, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 40, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 61, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 81, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 101, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 122, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 142, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 162, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 183, "y": 21, "flags": 4}, + {"matrix": [1, 10], "x": 203, "y": 21, "flags": 4}, + {"matrix": [1, 11], "x": 224, "y": 21, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 42, "flags": 1}, + {"matrix": [2, 1], "x": 20, "y": 42, "flags": 4}, + {"matrix": [2, 2], "x": 40, "y": 42, "flags": 4}, + {"matrix": [2, 3], "x": 61, "y": 42, "flags": 4}, + {"matrix": [2, 4], "x": 81, "y": 42, "flags": 4}, + {"matrix": [2, 5], "x": 101, "y": 42, "flags": 4}, + {"matrix": [2, 6], "x": 122, "y": 42, "flags": 4}, + {"matrix": [2, 7], "x": 142, "y": 42, "flags": 4}, + {"matrix": [2, 8], "x": 162, "y": 42, "flags": 4}, + {"matrix": [2, 9], "x": 183, "y": 42, "flags": 4}, + {"matrix": [2, 10], "x": 203, "y": 42, "flags": 4}, + {"matrix": [2, 11], "x": 224, "y": 42, "flags": 1}, + {"matrix": [3, 0], "x": 0, "y": 64, "flags": 1}, + {"matrix": [3, 1], "x": 20, "y": 64, "flags": 1}, + {"matrix": [3, 2], "x": 40, "y": 64, "flags": 1}, + {"matrix": [3, 3], "x": 61, "y": 64, "flags": 1}, + {"matrix": [3, 4], "x": 81, "y": 64, "flags": 1}, + {"matrix": [3, 5], "x": 111, "y": 64, "flags": 1}, + {"matrix": [3, 7], "x": 142, "y": 64, "flags": 1}, + {"matrix": [3, 8], "x": 162, "y": 64, "flags": 1}, + {"matrix": [3, 9], "x": 183, "y": 64, "flags": 1}, + {"matrix": [3, 10], "x": 203, "y": 64, "flags": 1}, + {"matrix": [3, 11], "x": 224, "y": 64, "flags": 1} + ], + "max_brightness": 200 + }, + "usb": { + "device_version": "2.0.0" + } +} diff --git a/keyboards/kprepublic/cstc40/rev2/mcuconf.h b/keyboards/kprepublic/cstc40/rev2/mcuconf.h new file mode 100644 index 00000000000..563b86d26db --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev2/mcuconf.h @@ -0,0 +1,21 @@ +/* Copyright 2020 Nick Brassel (tzarc) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/kprepublic/cstc40/rev2/readme.md b/keyboards/kprepublic/cstc40/rev2/readme.md new file mode 100644 index 00000000000..8f6b27ed8e9 --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev2/readme.md @@ -0,0 +1,29 @@ +# Rev 2 + +A 40% hotswap ortholinear RGB keyboard from KP Republic. + +* **Revision 2: "single pcb"** +* Keyboard Maintainer: [Var](https://github.com/itsvar8) +* Hardware Supported: CSTC40 rev2 +* STM32F402RCT6 MCU with IS31FL3733 LED driver and using `stm32-dfu` bootloader. Integrated USB connection. +* Hardware Availability: kprepublic.com + +Make example for this keyboard (after setting up your build environment): + + make kprepublic/cstc40/rev2:default + +Flashing example for this keyboard: + + make kprepublic/cstc40/rev2:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available + +The rev 2 uses pin `A10` in the key matrix, which apparently is a design flaw that may prevent the bootloader from entering the proper mode for DFU flashing - . There is a simple workaround that works most of the time - press the pin key (generally the letter R) during the boot. diff --git a/keyboards/kprepublic/cstc40/daughterboard/daughterboard.c b/keyboards/kprepublic/cstc40/rev2/rev2.c similarity index 99% rename from keyboards/kprepublic/cstc40/daughterboard/daughterboard.c rename to keyboards/kprepublic/cstc40/rev2/rev2.c index 38fac99155a..db063d3eba4 100644 --- a/keyboards/kprepublic/cstc40/daughterboard/daughterboard.c +++ b/keyboards/kprepublic/cstc40/rev2/rev2.c @@ -68,4 +68,4 @@ const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { { 0, SW3_CS11, SW2_CS11, SW1_CS11 }, { 0, SW3_CS12, SW2_CS12, SW1_CS12 } }; -#endif \ No newline at end of file +#endif diff --git a/keyboards/kprepublic/cstc40/rev3/keyboard.json b/keyboards/kprepublic/cstc40/rev3/keyboard.json new file mode 100644 index 00000000000..2748a6f1fc0 --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev3/keyboard.json @@ -0,0 +1,67 @@ +{ + "maintainer": "ClownFish", + "bootloader": "tinyuf2", + "matrix_pins": { + "cols": ["A4", "A5", "A6", "A7", "C4", "C5", "A8", "A15", "C10", "C11", "C12", "D2"], + "rows": ["B12", "B1", "B0", "C13"] + }, + "rgb_matrix": { + "driver": "ws2812", + "layout": [ + {"matrix": [3, 0], "x": 0, "y": 64, "flags": 1}, + {"matrix": [3, 1], "x": 20, "y": 64, "flags": 1}, + {"matrix": [3, 2], "x": 41, "y": 64, "flags": 1}, + {"matrix": [3, 3], "x": 61, "y": 64, "flags": 1}, + {"matrix": [3, 4], "x": 82, "y": 64, "flags": 1}, + {"matrix": [3, 5], "x": 112, "y": 64, "flags": 1}, + {"matrix": [3, 7], "x": 142, "y": 64, "flags": 1}, + {"matrix": [3, 8], "x": 163, "y": 64, "flags": 1}, + {"matrix": [3, 9], "x": 183, "y": 64, "flags": 1}, + {"matrix": [3, 10], "x": 204, "y": 64, "flags": 1}, + {"matrix": [3, 11], "x": 224, "y": 64, "flags": 1}, + {"matrix": [2, 11], "x": 224, "y": 43, "flags": 1}, + {"matrix": [2, 10], "x": 204, "y": 43, "flags": 4}, + {"matrix": [2, 9], "x": 183, "y": 43, "flags": 4}, + {"matrix": [2, 8], "x": 163, "y": 43, "flags": 4}, + {"matrix": [2, 7], "x": 142, "y": 43, "flags": 4}, + {"matrix": [2, 6], "x": 122, "y": 43, "flags": 4}, + {"matrix": [2, 5], "x": 102, "y": 43, "flags": 4}, + {"matrix": [2, 4], "x": 82, "y": 43, "flags": 4}, + {"matrix": [2, 3], "x": 61, "y": 43, "flags": 4}, + {"matrix": [2, 2], "x": 41, "y": 43, "flags": 4}, + {"matrix": [2, 1], "x": 20, "y": 43, "flags": 4}, + {"matrix": [2, 0], "x": 0, "y": 43, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 21, "flags": 1}, + {"matrix": [1, 1], "x": 20, "y": 21, "flags": 4}, + {"matrix": [1, 2], "x": 41, "y": 21, "flags": 4}, + {"matrix": [1, 3], "x": 61, "y": 21, "flags": 4}, + {"matrix": [1, 4], "x": 82, "y": 21, "flags": 4}, + {"matrix": [1, 5], "x": 102, "y": 21, "flags": 4}, + {"matrix": [1, 6], "x": 122, "y": 21, "flags": 4}, + {"matrix": [1, 7], "x": 142, "y": 21, "flags": 4}, + {"matrix": [1, 8], "x": 163, "y": 21, "flags": 4}, + {"matrix": [1, 9], "x": 183, "y": 21, "flags": 4}, + {"matrix": [1, 10], "x": 204, "y": 21, "flags": 4}, + {"matrix": [1, 11], "x": 224, "y": 21, "flags": 1}, + {"matrix": [0, 11], "x": 224, "y": 0, "flags": 1}, + {"matrix": [0, 10], "x": 204, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 183, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 163, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 142, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 122, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 102, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 82, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 61, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 41, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 20, "y": 0, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1} + ], + "max_brightness": 180 + }, + "usb": { + "device_version": "3.0.0" + }, + "ws2812": { + "pin": "B13" + } +} diff --git a/keyboards/kprepublic/cstc40/rev3/readme.md b/keyboards/kprepublic/cstc40/rev3/readme.md new file mode 100644 index 00000000000..b372c635793 --- /dev/null +++ b/keyboards/kprepublic/cstc40/rev3/readme.md @@ -0,0 +1,27 @@ +# Rev 3 + +A 40% hotswap ortholinear RGB keyboard from KP Republic. + +* **Revision 3: "FXTwink single pcb"** +* Keyboard Maintainer: [ClownFish](https://github.com/clownfish-og) +* Hardware Supported: CSTC40 rev3 +* STM32F402RCT6 MCU without separate LED driver and using `tinyuf2` bootloader. Integrated USB connection. +* Hardware Availability: kprepublic.com + +Make example for this keyboard (after setting up your build environment): + + make kprepublic/cstc40/rev3:default + +Flashing example for this keyboard: + + make kprepublic/cstc40/rev3:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/kprepublic/cstc40/single_pcb/keyboard.json b/keyboards/kprepublic/cstc40/single_pcb/keyboard.json deleted file mode 100644 index 330ada7bac5..00000000000 --- a/keyboards/kprepublic/cstc40/single_pcb/keyboard.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "matrix_pins": { - "cols": ["C7", "C8", "C9", "A8", "A10", "B10", "A15", "C13", "B6", "B5", "B4", "B3"], - "rows": ["C12", "C10", "C11", "B0"] - } -} \ No newline at end of file