Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"atmega328p",
"atmega328",
"attiny85",
"risc-v",
"unknown"
]
},
Expand Down
4 changes: 4 additions & 0 deletions docs/compatible_microcontrollers.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s

* [AT32F415](https://www.arterychip.com/en/product/AT32F415.jsp)

### essemi (ES32)

* [ES32VF2264](https://www.essemi.com/index/product/detail?id=969)

### NXP (Kinetis)

* [MKL26Z64](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/kl-series-cortex-m0-plus/kinetis-kl2x-72-96-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x)
Expand Down
8 changes: 8 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/board.h
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>

44 changes: 44 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/config.h
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
12 changes: 12 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/halconf.h
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 keyboards/handwired/onekey/essemi_es32vf2264/keyboard.json
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"
}
}
95 changes: 95 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/mcuconf.h
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 */
3 changes: 3 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/readme.md
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*.
31 changes: 31 additions & 0 deletions keyboards/handwired/onekey/essemi_es32vf2264/rules.mk
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
2 changes: 1 addition & 1 deletion lib/python/qmk/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
MAX_KEYBOARD_SUBFOLDERS = 5

# Supported processor types
CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G0B1', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95', 'AT32F415'
CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G0B1', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95', 'AT32F415','risc-v'
LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None
VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85'

Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/drivers/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# error "You need to set HAL_USE_ADC to TRUE in your halconf.h to use the ADC."
#endif

#if !RP_ADC_USE_ADC1 && !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 && !WB32_ADC_USE_ADC1 && !AT32_ADC_USE_ADC1
#if !RP_ADC_USE_ADC1 && !STM32_ADC_USE_ADC1 && !STM32_ADC_USE_ADC2 && !STM32_ADC_USE_ADC3 && !STM32_ADC_USE_ADC4 && !WB32_ADC_USE_ADC1 && !AT32_ADC_USE_ADC1 && !ES32_ADC_USE_ADC1
# error "You need to set one of the 'xxx_ADC_USE_ADCx' settings to TRUE in your mcuconf.h to use the ADC."
#endif

Expand Down
8 changes: 8 additions & 0 deletions platforms/chibios/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ ifeq ($(strip $(MCU)), risc-v)
STARTUP_MK = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-ECLIC/compilers/GCC/mk/startup_$(MCU_STARTUP).mk
PORT_V = $(CHIBIOS_CONTRIB)/os/common/ports/RISCV-ECLIC/compilers/GCC/mk/port.mk
RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-ECLIC/compilers/GCC

# RISC-V CLIC: Standardized Core Local Interrupt Controller
# RISC-V ECLIC: Enhanced Core Local Interrupt Controller (Vendor-specific Implementation)
ifeq ("$(wildcard $(STARTUP_MK))","")
STARTUP_MK = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-CLIC/compilers/GCC/mk/startup_$(MCU_STARTUP).mk
PORT_V = $(CHIBIOS_CONTRIB)/os/common/ports/RISCV-CLIC/compilers/GCC/mk/port.mk
RULESPATH = $(CHIBIOS_CONTRIB)/os/common/startup/RISCV-CLIC/compilers/GCC
endif
else
# ARM Support
CHIBIOS_PORT ?=
Expand Down