aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/planck/rev6/chconf.h21
-rw-r--r--keyboards/planck/rev6/config.h21
-rw-r--r--keyboards/planck/rev6/mcuconf.h30
-rw-r--r--keyboards/planck/rev6/rev6.c19
-rw-r--r--keyboards/planck/rev6/rules.mk3
5 files changed, 83 insertions, 11 deletions
diff --git a/keyboards/planck/rev6/chconf.h b/keyboards/planck/rev6/chconf.h
new file mode 100644
index 000000000..0298c11c4
--- /dev/null
+++ b/keyboards/planck/rev6/chconf.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 QMK Contributors
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17// Need to override the SysTick timer to use TIM3 -- this is a 16-bit timer on F303
18// so we need to change resolution and frequency to match.
19#define CH_CFG_ST_RESOLUTION 16
20#define CH_CFG_ST_FREQUENCY 10000
21#include_next "chconf.h"
diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h
index 3fbbae027..0adca592b 100644
--- a/keyboards/planck/rev6/config.h
+++ b/keyboards/planck/rev6/config.h
@@ -126,17 +126,18 @@
126/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ 126/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
127//#define MIDI_TONE_KEYCODE_OCTAVES 1 127//#define MIDI_TONE_KEYCODE_OCTAVES 1
128 128
129// #define WS2812_LED_N 2 129
130// #define RGBLED_NUM WS2812_LED_N 130/*
131// #define WS2812_TIM_N 2 131 * WS2812 Underglow Matrix options
132// #define WS2812_TIM_CH 2 132 */
133// #define PORT_WS2812 GPIOA
134// #define PIN_WS2812 1
135// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
136//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
137//#define WS2812_EXTERNAL_PULLUP
138#define RGB_DI_PIN A1 133#define RGB_DI_PIN A1
139#define RGBLED_NUM 9 134#define RGBLED_NUM 9
140#define RGBLIGHT_ANIMATIONS 135#define DRIVER_LED_TOTAL RGBLED_NUM
136
137#define WS2812_PWM_DRIVER PWMD2
138#define WS2812_PWM_CHANNEL 2
139#define WS2812_PWM_PAL_MODE 1
140#define WS2812_DMA_STREAM STM32_DMA1_STREAM2
141#define WS2812_DMA_CHANNEL 2
141 142
142#endif 143#endif
diff --git a/keyboards/planck/rev6/mcuconf.h b/keyboards/planck/rev6/mcuconf.h
new file mode 100644
index 000000000..dde67871c
--- /dev/null
+++ b/keyboards/planck/rev6/mcuconf.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 QMK Contributors
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include_next "mcuconf.h"
18
19// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used
20// on the Planck requires the use of TIM2 to run PWM -- rework which timers are
21// allocated for PWM usage.
22#undef STM32_PWM_USE_TIM2
23#undef STM32_PWM_USE_TIM3
24#define STM32_PWM_USE_TIM2 TRUE
25#define STM32_PWM_USE_TIM3 FALSE
26
27// As mentioned above, we need to reallocate the SysTick timer used from
28// TIM2 to TIM3.
29#undef STM32_ST_USE_TIMER
30#define STM32_ST_USE_TIMER 3
diff --git a/keyboards/planck/rev6/rev6.c b/keyboards/planck/rev6/rev6.c
index 8f4d168bf..6fe7772b5 100644
--- a/keyboards/planck/rev6/rev6.c
+++ b/keyboards/planck/rev6/rev6.c
@@ -15,6 +15,25 @@
15 */ 15 */
16#include "rev6.h" 16#include "rev6.h"
17 17
18led_config_t g_led_config = { {
19 // Key Matrix to LED Index
20 { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED },
21 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
22 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 },
23 { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED },
24 { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED },
25 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
26 { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
27 { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED },
28}, {
29 // LED Index to Physical Position
30 {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60}
31}, {
32 // LED Index to Flag
33 LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL,
34 LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL
35} };
36
18void matrix_init_kb(void) { 37void matrix_init_kb(void) {
19 matrix_init_user(); 38 matrix_init_user();
20} 39}
diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk
index d101f36d6..a1ff82b17 100644
--- a/keyboards/planck/rev6/rules.mk
+++ b/keyboards/planck/rev6/rules.mk
@@ -18,13 +18,14 @@ AUDIO_ENABLE = yes # Audio output
18UNICODE_ENABLE = no # Unicode 18UNICODE_ENABLE = no # Unicode
19BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 19BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
20RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. 20RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
21WS2812_DRIVER = bitbang 21WS2812_DRIVER = pwm
22API_SYSEX_ENABLE = no 22API_SYSEX_ENABLE = no
23 23
24# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 24# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
25SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 25SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
26#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 26#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
27 27
28RGB_MATRIX_ENABLE = WS2812
28# SERIAL_LINK_ENABLE = yes 29# SERIAL_LINK_ENABLE = yes
29ENCODER_ENABLE = yes 30ENCODER_ENABLE = yes
30DIP_SWITCH_ENABLE = yes 31DIP_SWITCH_ENABLE = yes