mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 13:12:08 +00:00
Replace WS2812 driver with PWM
This commit is contained in:
parent
0bc592b0ca
commit
a307274e96
@ -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
|
21
keyboards/mode/m60h/halconf.h
Normal file
21
keyboards/mode/m60h/halconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_PWM TRUE
|
||||
|
||||
#include_next <halconf.h>
|
@ -37,7 +37,8 @@
|
||||
"driver": "ws2812"
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "B9"
|
||||
"pin": "B9",
|
||||
"driver": "pwm"
|
||||
},
|
||||
"url": "",
|
||||
"usb": {
|
||||
|
@ -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();
|
||||
}
|
24
keyboards/mode/m60h/mcuconf.h
Normal file
24
keyboards/mode/m60h/mcuconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_PWM_USE_TIM4
|
||||
#define STM32_PWM_USE_TIM4 TRUE
|
||||
|
||||
#undef STM32_ST_USE_TIMER
|
||||
#define STM32_ST_USE_TIMER 5
|
@ -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
|
21
keyboards/mode/m60h_f/halconf.h
Normal file
21
keyboards/mode/m60h_f/halconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_PWM TRUE
|
||||
|
||||
#include_next <halconf.h>
|
@ -37,7 +37,8 @@
|
||||
"driver": "ws2812"
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "B9"
|
||||
"pin": "B9",
|
||||
"driver": "pwm"
|
||||
},
|
||||
"url": "",
|
||||
"usb": {
|
||||
|
@ -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();
|
||||
}
|
24
keyboards/mode/m60h_f/mcuconf.h
Normal file
24
keyboards/mode/m60h_f/mcuconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_PWM_USE_TIM4
|
||||
#define STM32_PWM_USE_TIM4 TRUE
|
||||
|
||||
#undef STM32_ST_USE_TIMER
|
||||
#define STM32_ST_USE_TIMER 5
|
39
keyboards/mode/m60s/chconf.h
Normal file
39
keyboards/mode/m60s/chconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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 <chconf.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
|
21
keyboards/mode/m60s/halconf.h
Normal file
21
keyboards/mode/m60s/halconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_PWM TRUE
|
||||
|
||||
#include_next <halconf.h>
|
@ -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();
|
||||
}
|
24
keyboards/mode/m60s/mcuconf.h
Normal file
24
keyboards/mode/m60s/mcuconf.h
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_PWM_USE_TIM4
|
||||
#define STM32_PWM_USE_TIM4 TRUE
|
||||
|
||||
#undef STM32_ST_USE_TIMER
|
||||
#define STM32_ST_USE_TIMER 5
|
Loading…
Reference in New Issue
Block a user