diff --git a/keyboards/mawaeg/sharkropad/chconf.h b/keyboards/mawaeg/sharkropad/chconf.h new file mode 100644 index 00000000000..c0a23232343 --- /dev/null +++ b/keyboards/mawaeg/sharkropad/chconf.h @@ -0,0 +1,22 @@ +/* Copyright 2025 @mawaeg + * + * 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 3 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 . + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next diff --git a/keyboards/mawaeg/sharkropad/config.h b/keyboards/mawaeg/sharkropad/config.h index 5472d5b114b..950f63860d0 100644 --- a/keyboards/mawaeg/sharkropad/config.h +++ b/keyboards/mawaeg/sharkropad/config.h @@ -19,4 +19,8 @@ #define I2C1_SCL_PIN A9 #define I2C1_SDA_PIN A10 -#define WS2812_BITBANG_NOP_FUDGE 0.4 +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_PWM_DMA_CHANNEL 4 diff --git a/keyboards/mawaeg/sharkropad/halconf.h b/keyboards/mawaeg/sharkropad/halconf.h index fbeb632aa7b..9f0b5737322 100755 --- a/keyboards/mawaeg/sharkropad/halconf.h +++ b/keyboards/mawaeg/sharkropad/halconf.h @@ -17,5 +17,6 @@ #pragma once #define HAL_USE_I2C TRUE +#define HAL_USE_PWM TRUE #include_next diff --git a/keyboards/mawaeg/sharkropad/keyboard.json b/keyboards/mawaeg/sharkropad/keyboard.json index 0946843ec4b..b95d42e4589 100755 --- a/keyboards/mawaeg/sharkropad/keyboard.json +++ b/keyboards/mawaeg/sharkropad/keyboard.json @@ -112,6 +112,7 @@ "vid": "0x6D73" }, "ws2812": { + "driver": "pwm", "pin": "B3" }, "layouts": { diff --git a/keyboards/mawaeg/sharkropad/mcuconf.h b/keyboards/mawaeg/sharkropad/mcuconf.h index 3991841cb72..2a66cc8d7b5 100755 --- a/keyboards/mawaeg/sharkropad/mcuconf.h +++ b/keyboards/mawaeg/sharkropad/mcuconf.h @@ -20,3 +20,9 @@ #undef STM32_I2C_USE_I2C1 #define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 15