diff --git a/keyboards/mode/m60h/config.h b/keyboards/mode/m60h/config.h index bd80c1ea7bb..cf430988f31 100644 --- a/keyboards/mode/m60h/config.h +++ b/keyboards/mode/m60h/config.h @@ -4,3 +4,10 @@ #pragma once #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + +#define WS2812_PWM_DRIVER PWMD4 +#define WS2812_PWM_CHANNEL 4 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM6 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_TARGET_PERIOD 800000 \ No newline at end of file diff --git a/keyboards/mode/m60h/halconf.h b/keyboards/mode/m60h/halconf.h new file mode 100644 index 00000000000..6c00f380849 --- /dev/null +++ b/keyboards/mode/m60h/halconf.h @@ -0,0 +1,21 @@ +/* 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 . + */ + +#pragma once + +#define HAL_USE_PWM TRUE + +#include_next \ No newline at end of file diff --git a/keyboards/mode/m60h/info.json b/keyboards/mode/m60h/info.json index cafa3812e65..8ef97dbdcac 100644 --- a/keyboards/mode/m60h/info.json +++ b/keyboards/mode/m60h/info.json @@ -37,7 +37,8 @@ "driver": "ws2812" }, "ws2812": { - "pin": "B9" + "pin": "B9", + "driver": "pwm" }, "url": "", "usb": { diff --git a/keyboards/mode/m60h/m60h.c b/keyboards/mode/m60h/m60h.c deleted file mode 100644 index d08dfd820a8..00000000000 --- a/keyboards/mode/m60h/m60h.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2023 contact@vwolf.be -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "eeconfig.h" -#include "quantum.h" - -void keyboard_post_init_kb(void) { - wait_ms(200); - rgblight_reload_from_eeprom(); -} \ No newline at end of file diff --git a/keyboards/mode/m60h/mcuconf.h b/keyboards/mode/m60h/mcuconf.h new file mode 100644 index 00000000000..0b044526b29 --- /dev/null +++ b/keyboards/mode/m60h/mcuconf.h @@ -0,0 +1,24 @@ +/* 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 . + */ + +#pragma once +#include_next + +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 5 \ No newline at end of file diff --git a/keyboards/mode/m60h_f/config.h b/keyboards/mode/m60h_f/config.h index bd80c1ea7bb..cf430988f31 100644 --- a/keyboards/mode/m60h_f/config.h +++ b/keyboards/mode/m60h_f/config.h @@ -4,3 +4,10 @@ #pragma once #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + +#define WS2812_PWM_DRIVER PWMD4 +#define WS2812_PWM_CHANNEL 4 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM6 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_TARGET_PERIOD 800000 \ No newline at end of file diff --git a/keyboards/mode/m60h_f/halconf.h b/keyboards/mode/m60h_f/halconf.h new file mode 100644 index 00000000000..6c00f380849 --- /dev/null +++ b/keyboards/mode/m60h_f/halconf.h @@ -0,0 +1,21 @@ +/* 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 . + */ + +#pragma once + +#define HAL_USE_PWM TRUE + +#include_next \ No newline at end of file diff --git a/keyboards/mode/m60h_f/info.json b/keyboards/mode/m60h_f/info.json index 07fd6b0fa80..8876c8cd308 100644 --- a/keyboards/mode/m60h_f/info.json +++ b/keyboards/mode/m60h_f/info.json @@ -37,7 +37,8 @@ "driver": "ws2812" }, "ws2812": { - "pin": "B9" + "pin": "B9", + "driver": "pwm" }, "url": "", "usb": { diff --git a/keyboards/mode/m60h_f/m60h_f.c b/keyboards/mode/m60h_f/m60h_f.c deleted file mode 100644 index d08dfd820a8..00000000000 --- a/keyboards/mode/m60h_f/m60h_f.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2023 contact@vwolf.be -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "eeconfig.h" -#include "quantum.h" - -void keyboard_post_init_kb(void) { - wait_ms(200); - rgblight_reload_from_eeprom(); -} \ No newline at end of file diff --git a/keyboards/mode/m60h_f/mcuconf.h b/keyboards/mode/m60h_f/mcuconf.h new file mode 100644 index 00000000000..0b044526b29 --- /dev/null +++ b/keyboards/mode/m60h_f/mcuconf.h @@ -0,0 +1,24 @@ +/* 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 . + */ + +#pragma once +#include_next + +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 5 \ No newline at end of file diff --git a/keyboards/mode/m60s/chconf.h b/keyboards/mode/m60s/chconf.h new file mode 100644 index 00000000000..de4ab83ec36 --- /dev/null +++ b/keyboards/mode/m60s/chconf.h @@ -0,0 +1,39 @@ +/* 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f401/chconf.h -r platforms/chibios/common/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_FREQUENCY 10000 + +#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE + +#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE + +#define CH_CFG_FACTORY_SEMAPHORES TRUE + +#define CH_CFG_FACTORY_MAILBOXES TRUE + +#define CH_CFG_FACTORY_OBJ_FIFOS TRUE + +#define CH_CFG_FACTORY_PIPES TRUE + +#include_next + diff --git a/keyboards/mode/m60s/config.h b/keyboards/mode/m60s/config.h index bd80c1ea7bb..cf430988f31 100644 --- a/keyboards/mode/m60s/config.h +++ b/keyboards/mode/m60s/config.h @@ -4,3 +4,10 @@ #pragma once #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + +#define WS2812_PWM_DRIVER PWMD4 +#define WS2812_PWM_CHANNEL 4 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM6 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +#define WS2812_PWM_TARGET_PERIOD 800000 \ No newline at end of file diff --git a/keyboards/mode/m60s/halconf.h b/keyboards/mode/m60s/halconf.h new file mode 100644 index 00000000000..6c00f380849 --- /dev/null +++ b/keyboards/mode/m60s/halconf.h @@ -0,0 +1,21 @@ +/* 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 . + */ + +#pragma once + +#define HAL_USE_PWM TRUE + +#include_next \ No newline at end of file diff --git a/keyboards/mode/m60s/m60s.c b/keyboards/mode/m60s/m60s.c deleted file mode 100644 index d08dfd820a8..00000000000 --- a/keyboards/mode/m60s/m60s.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2023 contact@vwolf.be -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "eeconfig.h" -#include "quantum.h" - -void keyboard_post_init_kb(void) { - wait_ms(200); - rgblight_reload_from_eeprom(); -} \ No newline at end of file diff --git a/keyboards/mode/m60s/mcuconf.h b/keyboards/mode/m60s/mcuconf.h new file mode 100644 index 00000000000..0b044526b29 --- /dev/null +++ b/keyboards/mode/m60s/mcuconf.h @@ -0,0 +1,24 @@ +/* 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 . + */ + +#pragma once +#include_next + +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 5 \ No newline at end of file