diff options
11 files changed, 46 insertions, 32 deletions
diff --git a/drivers/led/apa102.c b/drivers/led/apa102.c index 6e87d48b96..6a13153374 100644 --- a/drivers/led/apa102.c +++ b/drivers/led/apa102.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | # elif defined(PROTOCOL_CHIBIOS) | 24 | # elif defined(PROTOCOL_CHIBIOS) |
| 25 | # include "hal.h" | 25 | # include "hal.h" |
| 26 | # include "chibios_config.h" | 26 | # include "chibios_config.h" |
| 27 | # if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(GD32VF103) || defined(MCU_RP) | 27 | # if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) || defined(AT32F415) || defined(GD32VF103) || defined(MCU_RP) |
| 28 | # define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns | 28 | # define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns |
| 29 | # else | 29 | # else |
| 30 | # error APA102_NOPS configuration required | 30 | # error APA102_NOPS configuration required |
diff --git a/keyboards/handwired/onekey/at_start_f415/board.h b/keyboards/handwired/onekey/at_start_f415/board.h index f4adc2d418..a31d8f8e37 100644 --- a/keyboards/handwired/onekey/at_start_f415/board.h +++ b/keyboards/handwired/onekey/at_start_f415/board.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | 1 | // Copyright 2023-2025 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | 2 | // Copyright 2023-2025 Zhaqian <https://github.com/zhaqian12> |
| 3 | // SPDX-License-Identifier: GPL-2.0-or-later | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
diff --git a/keyboards/handwired/onekey/at_start_f415/config.h b/keyboards/handwired/onekey/at_start_f415/config.h index 0e47e813c5..41aece900c 100644 --- a/keyboards/handwired/onekey/at_start_f415/config.h +++ b/keyboards/handwired/onekey/at_start_f415/config.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | 1 | // Copyright 2023-2025 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | 2 | // Copyright 2023-2025 Zhaqian <https://github.com/zhaqian12> |
| 3 | // SPDX-License-Identifier: GPL-2.0-or-later | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
diff --git a/keyboards/handwired/onekey/at_start_f415/halconf.h b/keyboards/handwired/onekey/at_start_f415/halconf.h index 1423633d15..e3c075936d 100644 --- a/keyboards/handwired/onekey/at_start_f415/halconf.h +++ b/keyboards/handwired/onekey/at_start_f415/halconf.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | 1 | // Copyright 2023-2025 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | 2 | // Copyright 2023-2025 Zhaqian <https://github.com/zhaqian12> |
| 3 | // SPDX-License-Identifier: GPL-2.0-or-later | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
diff --git a/keyboards/handwired/onekey/at_start_f415/keyboard.json b/keyboards/handwired/onekey/at_start_f415/keyboard.json index f598923a6a..6e5683a474 100644 --- a/keyboards/handwired/onekey/at_start_f415/keyboard.json +++ b/keyboards/handwired/onekey/at_start_f415/keyboard.json | |||
| @@ -17,4 +17,8 @@ | |||
| 17 | "ws2812": { | 17 | "ws2812": { |
| 18 | "pin": "B0" | 18 | "pin": "B0" |
| 19 | } | 19 | } |
| 20 | "apa102": { | ||
| 21 | "data_pin": "B0", | ||
| 22 | "clock_pin": "B1" | ||
| 23 | } | ||
| 20 | } | 24 | } |
diff --git a/keyboards/handwired/onekey/at_start_f415/mcuconf.h b/keyboards/handwired/onekey/at_start_f415/mcuconf.h index 9bc11d507c..246f6762d3 100644 --- a/keyboards/handwired/onekey/at_start_f415/mcuconf.h +++ b/keyboards/handwired/onekey/at_start_f415/mcuconf.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | 1 | // Copyright 2023-2025 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | 2 | // Copyright 2023-2025 Zhaqian <https://github.com/zhaqian12> |
| 3 | // SPDX-License-Identifier: GPL-2.0-or-later | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c index 28cf7c18e0..26b1974e4a 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio |
| 3 | ChibiOS - Copyright (C) 2023..2024 HorrorTroll | 3 | ChibiOS - Copyright (C) 2023..2025 HorrorTroll |
| 4 | ChibiOS - Copyright (C) 2023..2024 Zhaqian | 4 | ChibiOS - Copyright (C) 2023..2025 Zhaqian |
| 5 | 5 | ||
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); | 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. | 7 | you may not use this file except in compliance with the License. |
diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h index c3ade198ba..b4909b0a29 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/board/board.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio |
| 3 | ChibiOS - Copyright (C) 2023..2024 HorrorTroll | 3 | ChibiOS - Copyright (C) 2023..2025 HorrorTroll |
| 4 | ChibiOS - Copyright (C) 2023..2024 Zhaqian | 4 | ChibiOS - Copyright (C) 2023..2025 Zhaqian |
| 5 | 5 | ||
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); | 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. | 7 | you may not use this file except in compliance with the License. |
| @@ -50,6 +50,14 @@ | |||
| 50 | #define AT32F415KB | 50 | #define AT32F415KB |
| 51 | 51 | ||
| 52 | /* | 52 | /* |
| 53 | * GPIO settings, allow unused GPIO for smaller chip packages. | ||
| 54 | */ | ||
| 55 | #if defined(AT32F415KB) || defined(AT32F415KC) | ||
| 56 | #define AT32_HAS_GPIOC TRUE | ||
| 57 | #define AT32_HAS_GPIOF TRUE | ||
| 58 | #endif | ||
| 59 | |||
| 60 | /* | ||
| 53 | * IO pins assignments. | 61 | * IO pins assignments. |
| 54 | */ | 62 | */ |
| 55 | #define GPIOA_PIN0 0U | 63 | #define GPIOA_PIN0 0U |
| @@ -142,21 +150,21 @@ | |||
| 142 | * 6 - Open Drain output 2MHz. | 150 | * 6 - Open Drain output 2MHz. |
| 143 | * 7 - Open Drain output 50MHz. | 151 | * 7 - Open Drain output 50MHz. |
| 144 | * 8 - Digital input with Pull-Up or Pull-Down resistor depending on ODT. | 152 | * 8 - Digital input with Pull-Up or Pull-Down resistor depending on ODT. |
| 145 | * 9 - Alternate Push Pull output 10MHz. | 153 | * 9 - Multiplexing Push Pull output 10MHz. |
| 146 | * A - Alternate Push Pull output 2MHz. | 154 | * A - Multiplexing Push Pull output 2MHz. |
| 147 | * B - Alternate Push Pull output 50MHz. | 155 | * B - Multiplexing Push Pull output 50MHz. |
| 148 | * C - Reserved. | 156 | * C - Reserved. |
| 149 | * D - Alternate Open Drain output 10MHz. | 157 | * D - Multiplexing Open Drain output 10MHz. |
| 150 | * E - Alternate Open Drain output 2MHz. | 158 | * E - Multiplexing Open Drain output 2MHz. |
| 151 | * F - Alternate Open Drain output 50MHz. | 159 | * F - Multiplexing Open Drain output 50MHz. |
| 152 | * Please refer to the AT32 Reference Manual for details. | 160 | * Please refer to the AT32 Reference Manual for details. |
| 153 | */ | 161 | */ |
| 154 | 162 | ||
| 155 | /* | 163 | /* |
| 156 | * Port A setup. | 164 | * Port A setup. |
| 157 | */ | 165 | */ |
| 158 | #define VAL_GPIOACFGLR 0x88888B88 /* PA7...PA0 */ | 166 | #define VAL_GPIOACFGLR 0x88888888 /* PA7...PA0 */ |
| 159 | #define VAL_GPIOACFGHR 0x888888B8 /* PA15...PA8 */ | 167 | #define VAL_GPIOACFGHR 0x88888888 /* PA15...PA8 */ |
| 160 | #define VAL_GPIOAODT 0xFFFFFFFF | 168 | #define VAL_GPIOAODT 0xFFFFFFFF |
| 161 | 169 | ||
| 162 | /* | 170 | /* |
diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h index da60447a0a..01d9a47aac 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/config.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | // Copyright 2023-2024 HorrorTroll <https://github.com/HorrorTroll> | 1 | // Copyright 2023-2025 HorrorTroll <https://github.com/HorrorTroll> |
| 2 | // Copyright 2023-2024 Zhaqian <https://github.com/zhaqian12> | 2 | // Copyright 2023-2025 Zhaqian <https://github.com/zhaqian12> |
| 3 | // SPDX-License-Identifier: GPL-2.0-or-later | 3 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
diff --git a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h index d148379fe1..e218e4791a 100644 --- a/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h +++ b/platforms/chibios/boards/GENERIC_AT32_F415XX/configs/mcuconf.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio | 2 | ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio |
| 3 | ChibiOS - Copyright (C) 2023..2024 HorrorTroll | 3 | ChibiOS - Copyright (C) 2023..2025 HorrorTroll |
| 4 | ChibiOS - Copyright (C) 2023..2024 Zhaqian | 4 | ChibiOS - Copyright (C) 2023..2025 Zhaqian |
| 5 | 5 | ||
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); | 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. | 7 | you may not use this file except in compliance with the License. |
| @@ -63,7 +63,7 @@ | |||
| 63 | #define AT32_USBDIV AT32_USBDIV_DIV3 | 63 | #define AT32_USBDIV AT32_USBDIV_DIV3 |
| 64 | #define AT32_CLKOUT_SEL AT32_CLKOUT_SEL_NOCLOCK | 64 | #define AT32_CLKOUT_SEL AT32_CLKOUT_SEL_NOCLOCK |
| 65 | #define AT32_CLKOUTDIV AT32_CLKOUTDIV_DIV1 | 65 | #define AT32_CLKOUTDIV AT32_CLKOUTDIV_DIV1 |
| 66 | #define AT32_ERTCSEL AT32_ERTCSEL_HEXTDIV | 66 | #define AT32_ERTCSEL AT32_ERTCSEL_NOCLOCK |
| 67 | #define AT32_PVM_ENABLE FALSE | 67 | #define AT32_PVM_ENABLE FALSE |
| 68 | #define AT32_PVMSEL AT32_PVMSEL_LEV1 | 68 | #define AT32_PVMSEL AT32_PVMSEL_LEV1 |
| 69 | 69 | ||
| @@ -136,10 +136,10 @@ | |||
| 136 | #define AT32_I2C_USE_I2C1 FALSE | 136 | #define AT32_I2C_USE_I2C1 FALSE |
| 137 | #define AT32_I2C_USE_I2C2 FALSE | 137 | #define AT32_I2C_USE_I2C2 FALSE |
| 138 | #define AT32_I2C_BUSY_TIMEOUT 50 | 138 | #define AT32_I2C_BUSY_TIMEOUT 50 |
| 139 | #define AT32_I2C_I2C1_IRQ_PRIORITY 5 | ||
| 140 | #define AT32_I2C_I2C2_IRQ_PRIORITY 5 | ||
| 141 | #define AT32_I2C_I2C1_DMA_PRIORITY 3 | 139 | #define AT32_I2C_I2C1_DMA_PRIORITY 3 |
| 142 | #define AT32_I2C_I2C2_DMA_PRIORITY 3 | 140 | #define AT32_I2C_I2C2_DMA_PRIORITY 3 |
| 141 | #define AT32_I2C_I2C1_IRQ_PRIORITY 5 | ||
| 142 | #define AT32_I2C_I2C2_IRQ_PRIORITY 5 | ||
| 143 | #define AT32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") | 143 | #define AT32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") |
| 144 | 144 | ||
| 145 | /* | 145 | /* |
| @@ -151,8 +151,6 @@ | |||
| 151 | #define AT32_ICU_USE_TMR4 FALSE | 151 | #define AT32_ICU_USE_TMR4 FALSE |
| 152 | #define AT32_ICU_USE_TMR5 FALSE | 152 | #define AT32_ICU_USE_TMR5 FALSE |
| 153 | #define AT32_ICU_USE_TMR9 FALSE | 153 | #define AT32_ICU_USE_TMR9 FALSE |
| 154 | #define AT32_ICU_USE_TMR10 FALSE | ||
| 155 | #define AT32_ICU_USE_TMR11 FALSE | ||
| 156 | 154 | ||
| 157 | /* | 155 | /* |
| 158 | * PWM driver system settings. | 156 | * PWM driver system settings. |
| @@ -216,9 +214,13 @@ | |||
| 216 | #define AT32_UART_USE_USART1 FALSE | 214 | #define AT32_UART_USE_USART1 FALSE |
| 217 | #define AT32_UART_USE_USART2 FALSE | 215 | #define AT32_UART_USE_USART2 FALSE |
| 218 | #define AT32_UART_USE_USART3 FALSE | 216 | #define AT32_UART_USE_USART3 FALSE |
| 217 | #define AT32_UART_USE_UART4 FALSE | ||
| 218 | #define AT32_UART_USE_UART5 FALSE | ||
| 219 | #define AT32_UART_USART1_DMA_PRIORITY 0 | 219 | #define AT32_UART_USART1_DMA_PRIORITY 0 |
| 220 | #define AT32_UART_USART2_DMA_PRIORITY 0 | 220 | #define AT32_UART_USART2_DMA_PRIORITY 0 |
| 221 | #define AT32_UART_USART3_DMA_PRIORITY 0 | 221 | #define AT32_UART_USART3_DMA_PRIORITY 0 |
| 222 | #define AT32_UART_UART4_DMA_PRIORITY 0 | ||
| 223 | #define AT32_UART_UART5_DMA_PRIORITY 0 | ||
| 222 | #define AT32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") | 224 | #define AT32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") |
| 223 | 225 | ||
| 224 | /* | 226 | /* |
diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h index 95136baf30..9ef8e9b4fe 100644 --- a/platforms/chibios/chibios_config.h +++ b/platforms/chibios/chibios_config.h | |||
| @@ -149,8 +149,8 @@ | |||
| 149 | # if defined(AT32F415) | 149 | # if defined(AT32F415) |
| 150 | # define USE_GPIOV1 | 150 | # define USE_GPIOV1 |
| 151 | # define USE_I2CV1 | 151 | # define USE_I2CV1 |
| 152 | # define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_AT32_ALTERNATE_OPENDRAIN | 152 | # define PAL_MODE_ALTERNATE_OPENDRAIN PAL_MODE_AT32_MUX_OPENDRAIN |
| 153 | # define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_AT32_ALTERNATE_PUSHPULL | 153 | # define PAL_MODE_ALTERNATE_PUSHPULL PAL_MODE_AT32_MUX_PUSHPULL |
| 154 | # define AUDIO_PWM_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL | 154 | # define AUDIO_PWM_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL |
| 155 | # endif | 155 | # endif |
| 156 | #endif | 156 | #endif |
