-
-
Notifications
You must be signed in to change notification settings - Fork 44.1k
support MCU ES32VF2264 #26225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
liuhy-2020
wants to merge
3
commits into
qmk:master
Choose a base branch
from
liuhy-2020:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
support MCU ES32VF2264 #26225
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,7 @@ | |
| "atmega328p", | ||
| "atmega328", | ||
| "attiny85", | ||
| "risc-v", | ||
| "unknown" | ||
| ] | ||
| }, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | ||
| // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| #pragma once | ||
|
|
||
| #include_next <board.h> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | ||
| // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| #pragma once | ||
|
|
||
| /* ADC configs */ | ||
| #define ADC_PIN C5 | ||
| #define ADC_USE_ADC1 | ||
|
|
||
| /* SPI configs */ | ||
| #define SPI_DRIVER SPID1 | ||
| #define SPI_SCK_PIN A5 | ||
| #define SPI_MOSI_PIN A7 | ||
| #define SPI_MISO_PIN A6 | ||
|
|
||
| /* I2C configs */ | ||
| #define USE_I2CV1_CONTRIB | ||
| #define I2C_DRIVER I2CD1 | ||
| #define I2C1_SDA_PIN B7 | ||
| #define I2C1_SCL_PIN B6 | ||
| #define I2C1_SCL_PAL_MODE 4 | ||
| #define I2C1_OPMODE OPMODE_I2C | ||
| #define I2C1_CLOCK_SPEED 100000 | ||
|
|
||
| /* Apa102 configs */ | ||
| #define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) | ||
|
|
||
| /* Haptic configs */ | ||
| #define SOLENOID_PIN B12 | ||
| #define SOLENOID_PINS { B12, B13, B14, B15 } | ||
| #define SOLENOID_PINS_ACTIVE_STATE { high, high, low } | ||
|
|
||
| /* Backlight configs */ | ||
| #define BACKLIGHT_PWM_DRIVER PWM_GP16C4T1 | ||
| #define BACKLIGHT_PWM_CHANNEL 3 | ||
|
|
||
| /* LCD configs */ | ||
| #define LCD_RST_PIN A2 | ||
| #define LCD_DC_PIN A3 | ||
| #define LCD_CS_PIN A4 | ||
|
|
||
| // Bitbang WS2812 | ||
| #define WS2812_BITBANG_NOP_FUDGE 0.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | ||
| // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | ||
| // SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| #pragma once | ||
|
|
||
| #define HAL_USE_ADC TRUE | ||
| #define HAL_USE_I2C TRUE | ||
| #define HAL_USE_SPI TRUE | ||
| #define HAL_USE_PWM TRUE | ||
|
|
||
| #include_next <halconf.h> |
23 changes: 23 additions & 0 deletions
23
keyboards/handwired/onekey/essemi_es32vf2264/keyboard.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "keyboard_name": "Onekey essemi_fs026", | ||
| "bootloader": "custom", | ||
| "usb": { | ||
| "shared_endpoint": { | ||
| "keyboard": true | ||
| } | ||
| }, | ||
| "matrix_pins": { | ||
| "cols": ["D15"], | ||
| "rows": ["B0"] | ||
| }, | ||
| "backlight": { | ||
| "pin": "A5" | ||
| }, | ||
| "ws2812": { | ||
| "pin": "C0" | ||
| }, | ||
| "apa102": { | ||
| "data_pin": "B10", | ||
| "clock_pin": "B11" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /* | ||
| Copyright (C) 2021 essemi | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef MCUCONF_H | ||
| #define MCUCONF_H | ||
|
|
||
| #define ES32_ES32VF2264_MCUCONF | ||
|
|
||
| /* | ||
| * HAL driver system settings. | ||
| */ | ||
| #define ES32_NO_INIT FALSE | ||
|
|
||
| /* | ||
| * GPIO driver system settings. | ||
| */ | ||
| #define ES32_USB_USE_GPIO TRUE | ||
|
|
||
| /* | ||
| * ADC driver system settings. | ||
| */ | ||
| #define ES32_ADC_USE_ADC1 TRUE | ||
|
|
||
| /* | ||
| * GPT driver system settings. | ||
| */ | ||
| #define ES32_GPT_USE_GP16C4T1 TRUE | ||
| #define ES32_GPT_USE_GP16C4T2 FALSE | ||
|
|
||
| /* | ||
| * ICU driver system settings. | ||
| */ | ||
| #define ES32_ICU_USE_GP16C4T1 FALSE | ||
| #define ES32_ICU_USE_GP16C4T2 FALSE | ||
|
|
||
| /* | ||
| * I2C driver system settings. | ||
| */ | ||
| #define ES32_I2C_USE_I2C1 TRUE | ||
| #define ES32_I2C_USE_I2C2 FALSE | ||
| #define ES32_I2C_BUSY_TIMEOUT 50 | ||
|
|
||
| /* | ||
| * SERIAL driver system settings. | ||
| */ | ||
| #define ES32_SERIAL_USE_UART1 FALSE | ||
| #define ES32_SERIAL_USE_UART2 FALSE | ||
| #define ES32_SERIAL_USE_UART3 FALSE | ||
| #define ES32_SERIAL_USE_UART4 FALSE | ||
|
|
||
| /* | ||
| * SPI driver system settings. | ||
| */ | ||
| #define ES32_SPI_USE_SPI1 TRUE | ||
| #define ES32_SPI_USE_SPI2 FALSE | ||
|
|
||
| /* | ||
| * ST driver system settings. | ||
| */ | ||
| #define ES32_ST_USE_TIMER 2 | ||
|
|
||
| /* | ||
| * UART driver system settings. | ||
| */ | ||
| #define ES32_UART_USE_UART1 FALSE | ||
| #define ES32_UART_USE_UART2 FALSE | ||
| #define ES32_UART_USE_UART3 FALSE | ||
| #define ES32_UART_USE_UART4 FALSE | ||
|
|
||
| /* | ||
| * PWM driver system settings. | ||
| */ | ||
| #define ES32_PWM_USE_GP16C4T1 TRUE | ||
| #define ES32_PWM_USE_GP16C4T2 FALSE | ||
|
|
||
| /* | ||
| * USB driver system settings. | ||
| */ | ||
| #define ES32_USB_USE_USB1 TRUE | ||
| #define ES32_USE_USB_SOF_TRIM_HRC48 TRUE | ||
|
|
||
| #endif /* MCUCONF_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # essemi ES-PDS-ES32VF2264 Board Onekey | ||
|
|
||
| To trigger keypress, short together pins *D15* and *B0*. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # RISC-V | ||
| MCU = risc-v | ||
|
|
||
| # RISC-V extensions and abi configuration | ||
| MCU_ARCH = rv32emc | ||
| MCU_ABI = ilp32e | ||
| MCU_CMODEL = medlow | ||
|
|
||
| ## chip/board settings | ||
| # - the next two should match the directories in | ||
| # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES) | ||
| # OR | ||
| # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) | ||
| MCU_PORT_NAME = ES32 | ||
| MCU_FAMILY = ES32 | ||
| MCU_SERIES = ES32VF2264 | ||
|
|
||
| # Linker script to use | ||
| # - it should exist either in <chibios>/os/common/startup/RISCV-CLIC/compilers/GCC/ld/ | ||
| # or <keyboard_dir>/ld/ | ||
| MCU_LDSCRIPT ?= ES32VF2264 | ||
|
|
||
| # Startup code to use | ||
| # - it should exist in <chibios>/os/common/startup/RISCV-CLIC/compilers/GCC/mk/ | ||
| MCU_STARTUP ?= es32vf2264 | ||
|
|
||
| # Board: it should exist either in <chibios>/os/hal/boards/, | ||
| # <keyboard_dir>/boards/, or drivers/boards/ | ||
| BOARD ?= ES32VF2264 | ||
|
|
||
| USE_FPU ?= no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are defaults that are needed (and sounds like it), these should probably go in
platforms/chibios/mcuselection.mkso they can be populate by default.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let me try.