Переглянути джерело

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

HorrorTroll 1 рік тому
батько
коміт
02525f683e

+ 14 - 0
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 }

+ 3 - 0
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>

+ 1 - 1
keyboards/handwired/onekey/at_start_f415/keyboard.json

@@ -16,7 +16,7 @@
     },
     "ws2812": {
         "pin": "B0"
-    }
+    },
     "apa102": {
         "data_pin": "B0",
         "clock_pin": "B1"

+ 3 - 0
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

+ 10 - 0
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

+ 22 - 0
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>

+ 3 - 0
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

+ 0 - 15
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

+ 0 - 12
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

+ 0 - 9
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

+ 11 - 0
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

+ 5 - 0
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>

+ 3 - 0
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