logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git
commit: 02525f683e7ad1a2f032dfe8663b0303d1714a7d
parent 5a57d2115b96d682534de22518e8d6bdf8ce6ab7
Author: HorrorTroll <sonicvipduc@gmail.com>
Date:   Sun, 11 May 2025 01:26:50 +0700

Allow LVGL onekey keymap to be able compile for other board (#25005)


Diffstat:

Mkeyboards/handwired/onekey/at_start_f415/config.h14++++++++++++++
Mkeyboards/handwired/onekey/at_start_f415/halconf.h3+++
Mkeyboards/handwired/onekey/at_start_f415/keyboard.json2+-
Mkeyboards/handwired/onekey/at_start_f415/mcuconf.h3+++
Mkeyboards/handwired/onekey/kb2040/config.h10++++++++++
Akeyboards/handwired/onekey/kb2040/halconf.h22++++++++++++++++++++++
Mkeyboards/handwired/onekey/kb2040/mcuconf.h3+++
Dkeyboards/handwired/onekey/keymaps/lvgl/config.h15---------------
Dkeyboards/handwired/onekey/keymaps/lvgl/halconf.h12------------
Dkeyboards/handwired/onekey/keymaps/lvgl/mcuconf.h9---------
Mkeyboards/handwired/onekey/rp2040/config.h11+++++++++++
Mkeyboards/handwired/onekey/rp2040/halconf.h5+++++
Mkeyboards/handwired/onekey/rp2040/mcuconf.h3+++
13 files changed, 75 insertions(+), 37 deletions(-)

diff --git a/keyboards/handwired/onekey/at_start_f415/config.h b/keyboards/handwired/onekey/at_start_f415/config.h @@ -4,11 +4,25 @@ #pragma once +/* ADC pin */ #define ADC_PIN A0 +/* Backlight configs */ #define BACKLIGHT_PWM_DRIVER PWMD5 #define BACKLIGHT_PWM_CHANNEL 1 +/* LCD configs */ +#define LCD_RST_PIN A2 +#define LCD_DC_PIN A3 +#define LCD_CS_PIN A4 + +/* SPI pins */ +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +/* Haptic configs */ #define SOLENOID_PIN B12 #define SOLENOID_PINS { B12, B13, B14, B15 } #define SOLENOID_PINS_ACTIVE_STATE { high, high, low } diff --git a/keyboards/handwired/onekey/at_start_f415/halconf.h b/keyboards/handwired/onekey/at_start_f415/halconf.h @@ -10,4 +10,7 @@ #define HAL_USE_PWM TRUE +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE + #include_next <halconf.h> diff --git a/keyboards/handwired/onekey/at_start_f415/keyboard.json b/keyboards/handwired/onekey/at_start_f415/keyboard.json @@ -16,7 +16,7 @@ }, "ws2812": { "pin": "B0" - } + }, "apa102": { "data_pin": "B0", "clock_pin": "B1" diff --git a/keyboards/handwired/onekey/at_start_f415/mcuconf.h b/keyboards/handwired/onekey/at_start_f415/mcuconf.h @@ -14,3 +14,6 @@ #undef AT32_PWM_USE_TMR5 #define AT32_PWM_USE_TMR5 TRUE + +#undef AT32_SPI_USE_SPI1 +#define AT32_SPI_USE_SPI1 TRUE diff --git a/keyboards/handwired/onekey/kb2040/config.h b/keyboards/handwired/onekey/kb2040/config.h @@ -16,3 +16,13 @@ #define I2C1_SDA_PIN GP12 #define I2C1_SCL_PIN GP13 +/* LCD configs */ +#define LCD_RST_PIN GP0 +#define LCD_DC_PIN GP1 +#define LCD_CS_PIN GP2 + +/* SPI pins */ +#define SPI_DRIVER SPID0 +#define SPI_SCK_PIN GP18 +#define SPI_MOSI_PIN GP19 +#define SPI_MISO_PIN GP20 diff --git a/keyboards/handwired/onekey/kb2040/halconf.h b/keyboards/handwired/onekey/kb2040/halconf.h @@ -0,0 +1,22 @@ +/* Copyright 2020 QMK + * + * 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 2 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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE + +#include_next <halconf.h> diff --git a/keyboards/handwired/onekey/kb2040/mcuconf.h b/keyboards/handwired/onekey/kb2040/mcuconf.h @@ -22,3 +22,6 @@ #undef RP_I2C_USE_I2C1 #define RP_I2C_USE_I2C1 TRUE + +#undef RP_SPI_USE_SPI0 +#define RP_SPI_USE_SPI0 TRUE diff --git a/keyboards/handwired/onekey/keymaps/lvgl/config.h b/keyboards/handwired/onekey/keymaps/lvgl/config.h @@ -1,15 +0,0 @@ -// Copyright 2022 Jose Pablo Ramirez (@jpe230) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -/* SPI pins */ -#define SPI_DRIVER SPID0 -#define SPI_SCK_PIN GP18 -#define SPI_MOSI_PIN GP19 -#define SPI_MISO_PIN GP20 - -/* LCD Configuration */ -#define LCD_RST_PIN GP0 -#define LCD_DC_PIN GP1 -#define LCD_CS_PIN GP2 diff --git a/keyboards/handwired/onekey/keymaps/lvgl/halconf.h b/keyboards/handwired/onekey/keymaps/lvgl/halconf.h @@ -1,12 +0,0 @@ -// Copyright 2022 Jose Pablo Ramirez (@jpe230) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include_next <halconf.h> - -#undef HAL_USE_SPI -#define HAL_USE_SPI TRUE - -#undef SPI_USE_WAIT -#define SPI_USE_WAIT TRUE diff --git a/keyboards/handwired/onekey/keymaps/lvgl/mcuconf.h b/keyboards/handwired/onekey/keymaps/lvgl/mcuconf.h @@ -1,9 +0,0 @@ -// Copyright 2022 Jose Pablo Ramirez (@jpe230) -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include_next <mcuconf.h> - -#undef RP_SPI_USE_SPI0 -#define RP_SPI_USE_SPI0 TRUE diff --git a/keyboards/handwired/onekey/rp2040/config.h b/keyboards/handwired/onekey/rp2040/config.h @@ -17,3 +17,14 @@ #define AUDIO_PWM_CHANNEL RP2040_PWM_CHANNEL_A #define ADC_PIN GP26 + +/* LCD configs */ +#define LCD_RST_PIN GP0 +#define LCD_DC_PIN GP1 +#define LCD_CS_PIN GP2 + +/* SPI pins */ +#define SPI_DRIVER SPID0 +#define SPI_SCK_PIN GP18 +#define SPI_MOSI_PIN GP19 +#define SPI_MISO_PIN GP20 diff --git a/keyboards/handwired/onekey/rp2040/halconf.h b/keyboards/handwired/onekey/rp2040/halconf.h @@ -4,7 +4,12 @@ #pragma once #define HAL_USE_I2C TRUE + #define HAL_USE_PWM TRUE + #define HAL_USE_ADC TRUE +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE + #include_next <halconf.h> diff --git a/keyboards/handwired/onekey/rp2040/mcuconf.h b/keyboards/handwired/onekey/rp2040/mcuconf.h @@ -10,3 +10,6 @@ #undef RP_PWM_USE_PWM4 #define RP_PWM_USE_PWM4 TRUE + +#undef RP_SPI_USE_SPI0 +#define RP_SPI_USE_SPI0 TRUE