diff options
| author | Stefan Kerkmann <karlk90@pm.me> | 2021-10-18 07:23:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-18 16:23:20 +1100 |
| commit | e50867d52d9c255570630a23514842749b45e4c1 (patch) | |
| tree | e448e47262668e21084fb7439a38b0322136bb89 /keyboards/handwired | |
| parent | 7e3ff206b8600265ea086040b397f1a600c4a7f3 (diff) | |
| download | qmk_firmware-e50867d52d9c255570630a23514842749b45e4c1.tar.gz qmk_firmware-e50867d52d9c255570630a23514842749b45e4c1.zip | |
[Core] Add support for RISC-V builds and GD32VF103 MCU (#12508)
* Add support for RISC-V builds and GD32VF103 MCU
* Add toolchain selection in chibios.mk based on the mcu selected in
mcu_selection.mk
* Reorder and added comments to chibios.mk to have a streamlined makefile
* Add GD32VF103 mcu to possible targets for QMK.
* Add STM32 compatibility for GD32VF103 MCU, this is hacky but more efficent
then rewriting every driver.
* Add GigaDevice DFU bootloader as flash target, please note that
dfu-util of at least version 0.10 is needed.
* Add analog driver compatibility
* Add apa102 bitbang driver compatibility
* Add ws2812 bitbang driver compatibility
* Add eeprom in flash emulation compatibility
* Allow faster re-builds with ccache
* Add SiPeed Longan Nano to platform files
* Add SiPeed Longan Nano Onekeys
* Make quine compatible with other bootloaders
* Support builds with picolibc
* Add risc-v toolchain to arch and debian/ubuntu scripts
Diffstat (limited to 'keyboards/handwired')
8 files changed, 129 insertions, 2 deletions
diff --git a/keyboards/handwired/onekey/keymaps/quine/rules.mk b/keyboards/handwired/onekey/keymaps/quine/rules.mk deleted file mode 100644 index 4c2b0289a..000000000 --- a/keyboards/handwired/onekey/keymaps/quine/rules.mk +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | BOOTLOADER = atmel-dfu | ||
diff --git a/keyboards/handwired/onekey/readme.md b/keyboards/handwired/onekey/readme.md index b630b1174..2973b7d87 100644 --- a/keyboards/handwired/onekey/readme.md +++ b/keyboards/handwired/onekey/readme.md | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | Custom handwired one key keyboard. **See each individual board for pin information.** | 3 | Custom handwired one key keyboard. **See each individual board for pin information.** |
| 4 | 4 | ||
| 5 | * Keyboard Maintainer: QMK Community | 5 | * Keyboard Maintainer: QMK Community |
| 6 | * Hardware Supported: bluepill, Elite-C, Pro Micro, Proton C, Teensy 2.0, Teensy++ 2.0, Teensy LC, Teensy 3.2 | 6 | * Hardware Supported: Blackpill F401/F411, Bluepill, Elite-C, Pro Micro, Proton C, Sipeed Longan Nano, STM32F0 Disco, Teensy 2.0, Teensy++ 2.0, Teensy LC, Teensy 3.2 |
| 7 | * Hardware Availability: *n/a* | 7 | * Hardware Availability: *n/a* |
| 8 | 8 | ||
| 9 | Make example for this keyboard (after setting up your build environment): | 9 | Make example for this keyboard (after setting up your build environment): |
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/chconf.h b/keyboards/handwired/onekey/sipeed_longan_nano/chconf.h new file mode 100644 index 000000000..b1eb18de7 --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/chconf.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2021 QMK | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define CH_CFG_ST_RESOLUTION 16 | ||
| 20 | |||
| 21 | #define CH_CFG_ST_FREQUENCY 10000 | ||
| 22 | |||
| 23 | #include_next <chconf.h> | ||
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/config.h b/keyboards/handwired/onekey/sipeed_longan_nano/config.h new file mode 100644 index 000000000..1825b936d --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/config.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* Copyright 2021 QMK | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "config_common.h" | ||
| 20 | |||
| 21 | #define MATRIX_COL_PINS \ | ||
| 22 | { B0 } | ||
| 23 | #define MATRIX_ROW_PINS \ | ||
| 24 | { A7 } | ||
| 25 | #define UNUSED_PINS | ||
| 26 | |||
| 27 | #define BACKLIGHT_PIN A1 /* Green LED. */ | ||
| 28 | #define BACKLIGHT_PWM_DRIVER PWMD5 /* GD32 numbering scheme starts from 0, TIMER4 on GD32 boards is TIMER5 on STM32 boards. */ | ||
| 29 | #define BACKLIGHT_PWM_CHANNEL 2 /* GD32 numbering scheme starts from 0, Channel 1 on GD32 boards is Channel 2 on STM32 boards. */ | ||
| 30 | |||
| 31 | #define RGB_DI_PIN A2 | ||
| 32 | #define RGB_CI_PIN B13 | ||
| 33 | |||
| 34 | #define ADC_PIN A0 | ||
| 35 | |||
| 36 | #define I2C1_CLOCK_SPEED 1000000 /* GD32VF103 supports fast mode plus. */ | ||
| 37 | #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 | ||
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/halconf.h b/keyboards/handwired/onekey/sipeed_longan_nano/halconf.h new file mode 100644 index 000000000..2579c5874 --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/halconf.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2021 QMK | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define HAL_USE_PWM TRUE | ||
| 20 | #define HAL_USE_ADC TRUE | ||
| 21 | #define HAL_USE_I2C TRUE | ||
| 22 | |||
| 23 | #include_next <halconf.h> | ||
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/mcuconf.h b/keyboards/handwired/onekey/sipeed_longan_nano/mcuconf.h new file mode 100644 index 000000000..eba0dd9ee --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/mcuconf.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
| 3 | ChibiOS - Copyright (C) 2021 Stefan Kerkmann | ||
| 4 | |||
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | you may not use this file except in compliance with the License. | ||
| 7 | You may obtain a copy of the License at | ||
| 8 | |||
| 9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | |||
| 11 | Unless required by applicable law or agreed to in writing, software | ||
| 12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | See the License for the specific language governing permissions and | ||
| 15 | limitations under the License. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include_next <mcuconf.h> | ||
| 21 | |||
| 22 | #undef GD32_ADC_USE_ADC0 | ||
| 23 | #define GD32_ADC_USE_ADC0 TRUE | ||
| 24 | |||
| 25 | #undef GD32_I2C_USE_I2C0 | ||
| 26 | #define GD32_I2C_USE_I2C0 TRUE | ||
| 27 | |||
| 28 | #undef GD32_PWM_USE_TIM4 | ||
| 29 | #define GD32_PWM_USE_TIM4 TRUE | ||
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/readme.md b/keyboards/handwired/onekey/sipeed_longan_nano/readme.md new file mode 100644 index 000000000..0a3a29157 --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/readme.md | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # Sipeed Longan Nano onekey | ||
| 2 | |||
| 3 | Supported Hardware: *GD32VF103CB Sipeed Longan Nano*. | ||
| 4 | |||
| 5 | To trigger keypress, short together pins *B0* and *A7*. \ No newline at end of file | ||
diff --git a/keyboards/handwired/onekey/sipeed_longan_nano/rules.mk b/keyboards/handwired/onekey/sipeed_longan_nano/rules.mk new file mode 100644 index 000000000..aef4fee6b --- /dev/null +++ b/keyboards/handwired/onekey/sipeed_longan_nano/rules.mk | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = GD32VF103 | ||
| 3 | BOARD = SIPEED_LONGAN_NANO | ||
| 4 | |||
| 5 | # Bootloader selection | ||
| 6 | BOOTLOADER = gd32v-dfu | ||
| 7 | |||
| 8 | # Build Options | ||
| 9 | # change yes to no to disable | ||
| 10 | # | ||
| 11 | KEYBOARD_SHARED_EP = yes | ||
