aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2019-04-08 19:57:43 -0400
committerDrashna Jaelre <drashna@live.com>2019-04-08 16:57:43 -0700
commitfa4052c26e33b42b65521fd5ba9f94a3a778b275 (patch)
treeb16d69187656b109d98710359c9044edc716aaa2
parentbc536b9b6d98e5428a28f6e6ba69675bd77b79cc (diff)
downloadqmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.tar.gz
qmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.zip
Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes (#5532)
* RGB Matrix overhaul Breakout of animations to separate files Integration of optimized int based math lib Overhaul of rgb_matrix.c and animations for performance * Updating effect function api for future extensions * Combined the keypresses || keyreleases define checks into a single define so I stop forgetting it where necessary * Moving define RGB_MATRIX_KEYREACTIVE_ENABLED earlier in the include chain * Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes * fix bug in quantum/rgb_matrix_drivers.c Co-Authored-By: jackhumbert <jack.humb@gmail.com> * update command setting to the correct default * correct rgb config * remove commented-out lines * update docs for the 3737 * Update docs/feature_rgb_matrix.md Co-Authored-By: jackhumbert <jack.humb@gmail.com>
-rw-r--r--common_features.mk14
-rw-r--r--docs/feature_rgb_matrix.md4
-rw-r--r--drivers/issi/is31fl3737.c252
-rw-r--r--drivers/issi/is31fl3737.h207
-rw-r--r--keyboards/planck/ez/config.h141
-rw-r--r--keyboards/planck/ez/ez.c175
-rw-r--r--keyboards/planck/ez/ez.h107
-rw-r--r--keyboards/planck/ez/rules.mk24
-rw-r--r--keyboards/planck/planck.h6
-rw-r--r--quantum/audio/audio_arm.c6
-rw-r--r--quantum/rgb_matrix.h4
-rw-r--r--quantum/rgb_matrix_drivers.c28
-rw-r--r--quantum/stm32/halconf.h2
-rw-r--r--quantum/stm32/mcuconf.h2
14 files changed, 956 insertions, 16 deletions
diff --git a/common_features.mk b/common_features.mk
index 046f94d1d..c3b6fa916 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -114,7 +114,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
114 endif 114 endif
115endif 115endif
116 116
117VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom 117VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 custom
118 118
119LED_MATRIX_ENABLE ?= no 119LED_MATRIX_ENABLE ?= no
120ifneq ($(strip $(LED_MATRIX_ENABLE)), no) 120ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
@@ -135,6 +135,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
135endif 135endif
136 136
137RGB_MATRIX_ENABLE ?= no 137RGB_MATRIX_ENABLE ?= no
138
138ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) 139ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
139ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) 140ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
140 $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type) 141 $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
@@ -151,19 +152,26 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
151endif 152endif
152 153
153ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731) 154ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
154 OPT_DEFS += -DIS31FL3731 155 OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
155 COMMON_VPATH += $(DRIVER_PATH)/issi 156 COMMON_VPATH += $(DRIVER_PATH)/issi
156 SRC += is31fl3731.c 157 SRC += is31fl3731.c
157 SRC += i2c_master.c 158 SRC += i2c_master.c
158endif 159endif
159 160
160ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) 161ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
161 OPT_DEFS += -DIS31FL3733 162 OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
162 COMMON_VPATH += $(DRIVER_PATH)/issi 163 COMMON_VPATH += $(DRIVER_PATH)/issi
163 SRC += is31fl3733.c 164 SRC += is31fl3733.c
164 SRC += i2c_master.c 165 SRC += i2c_master.c
165endif 166endif
166 167
168ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
169 OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
170 COMMON_VPATH += $(DRIVER_PATH)/issi
171 SRC += is31fl3737.c
172 SRC += i2c_master.c
173endif
174
167ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 175ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
168 OPT_DEFS += -DTAP_DANCE_ENABLE 176 OPT_DEFS += -DTAP_DANCE_ENABLE
169 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c 177 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md
index ec1218954..36d9d0113 100644
--- a/docs/feature_rgb_matrix.md
+++ b/docs/feature_rgb_matrix.md
@@ -52,7 +52,9 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
52 52
53Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). 53Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now).
54 54
55### IS31FL3733 55### IS31FL3733/IS31FL3737
56
57!> For the IS31FL3737, replace all instances of `IS31FL3733` below with `IS31FL3737`.
56 58
57There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`: 59There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
58 60
diff --git a/drivers/issi/is31fl3737.c b/drivers/issi/is31fl3737.c
new file mode 100644
index 000000000..649104927
--- /dev/null
+++ b/drivers/issi/is31fl3737.c
@@ -0,0 +1,252 @@
1/* Copyright 2017 Jason Williams
2 * Copyright 2018 Jack Humbert
3 * Copyright 2018 Yiancar
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifdef __AVR__
20#include <avr/interrupt.h>
21#include <avr/io.h>
22#include <util/delay.h>
23#else
24#include "wait.h"
25#endif
26
27#include <string.h>
28#include "i2c_master.h"
29#include "progmem.h"
30#include "rgb_matrix.h"
31
32// This is a 7-bit address, that gets left-shifted and bit 0
33// set to 0 for write, 1 for read (as per I2C protocol)
34// The address will vary depending on your wiring:
35// 00 <-> GND
36// 01 <-> SCL
37// 10 <-> SDA
38// 11 <-> VCC
39// ADDR1 represents A1:A0 of the 7-bit address.
40// ADDR2 represents A3:A2 of the 7-bit address.
41// The result is: 0b101(ADDR2)(ADDR1)
42#define ISSI_ADDR_DEFAULT 0x50
43
44#define ISSI_COMMANDREGISTER 0xFD
45#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE
46#define ISSI_INTERRUPTMASKREGISTER 0xF0
47#define ISSI_INTERRUPTSTATUSREGISTER 0xF1
48
49#define ISSI_PAGE_LEDCONTROL 0x00 //PG0
50#define ISSI_PAGE_PWM 0x01 //PG1
51#define ISSI_PAGE_AUTOBREATH 0x02 //PG2
52#define ISSI_PAGE_FUNCTION 0x03 //PG3
53
54#define ISSI_REG_CONFIGURATION 0x00 //PG3
55#define ISSI_REG_GLOBALCURRENT 0x01 //PG3
56#define ISSI_REG_RESET 0x11// PG3
57#define ISSI_REG_SWPULLUP 0x0F //PG3
58#define ISSI_REG_CSPULLUP 0x10 //PG3
59
60#ifndef ISSI_TIMEOUT
61 #define ISSI_TIMEOUT 100
62#endif
63
64#ifndef ISSI_PERSISTENCE
65 #define ISSI_PERSISTENCE 0
66#endif
67
68// Transfer buffer for TWITransmitData()
69uint8_t g_twi_transfer_buffer[20];
70
71// These buffers match the IS31FL3737 PWM registers.
72// The control buffers match the PG0 LED On/Off registers.
73// Storing them like this is optimal for I2C transfers to the registers.
74// We could optimize this and take out the unused registers from these
75// buffers and the transfers in IS31FL3737_write_pwm_buffer() but it's
76// probably not worth the extra complexity.
77uint8_t g_pwm_buffer[DRIVER_COUNT][192];
78bool g_pwm_buffer_update_required = false;
79
80uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 } };
81bool g_led_control_registers_update_required = false;
82
83void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data )
84{
85 g_twi_transfer_buffer[0] = reg;
86 g_twi_transfer_buffer[1] = data;
87
88 #if ISSI_PERSISTENCE > 0
89 for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
90 if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
91 break;
92 }
93 #else
94 i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
95 #endif
96}
97
98void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
99{
100 // assumes PG1 is already selected
101
102 // transmit PWM registers in 12 transfers of 16 bytes
103 // g_twi_transfer_buffer[] is 20 bytes
104
105 // iterate over the pwm_buffer contents at 16 byte intervals
106 for ( int i = 0; i < 192; i += 16 ) {
107 g_twi_transfer_buffer[0] = i;
108 // copy the data from i to i+15
109 // device will auto-increment register for data after the first byte
110 // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer
111 for ( int j = 0; j < 16; j++ ) {
112 g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
113 }
114
115 #if ISSI_PERSISTENCE > 0
116 for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
117 if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
118 break;
119 }
120 #else
121 i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
122 #endif
123 }
124}
125
126void IS31FL3737_init( uint8_t addr )
127{
128 // In order to avoid the LEDs being driven with garbage data
129 // in the LED driver's PWM registers, shutdown is enabled last.
130 // Set up the mode and other settings, clear the PWM registers,
131 // then disable software shutdown.
132
133 // Unlock the command register.
134 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
135
136 // Select PG0
137 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL );
138 // Turn off all LEDs.
139 for ( int i = 0x00; i <= 0x17; i++ )
140 {
141 IS31FL3737_write_register( addr, i, 0x00 );
142 }
143
144 // Unlock the command register.
145 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
146
147 // Select PG1
148 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM );
149 // Set PWM on all LEDs to 0
150 // No need to setup Breath registers to PWM as that is the default.
151 for ( int i = 0x00; i <= 0xBF; i++ )
152 {
153 IS31FL3737_write_register( addr, i, 0x00 );
154 }
155
156 // Unlock the command register.
157 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
158
159 // Select PG3
160 IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION );
161 // Set global current to maximum.
162 IS31FL3737_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF );
163 // Disable software shutdown.
164 IS31FL3737_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 );
165
166 // Wait 10ms to ensure the device has woken up.
167 #ifdef __AVR__
168 _delay_ms( 10 );
169 #else
170 wait_ms(10);
171 #endif
172}
173
174void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
175{
176 if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
177 is31_led led = g_is31_leds[index];
178
179 g_pwm_buffer[led.driver][led.r] = red;
180 g_pwm_buffer[led.driver][led.g] = green;
181 g_pwm_buffer[led.driver][led.b] = blue;
182 g_pwm_buffer_update_required = true;
183 }
184}
185
186void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
187{
188 for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
189 {
190 IS31FL3737_set_color( i, red, green, blue );
191 }
192}
193
194void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
195{
196 is31_led led = g_is31_leds[index];
197
198 uint8_t control_register_r = led.r / 8;
199 uint8_t control_register_g = led.g / 8;
200 uint8_t control_register_b = led.b / 8;
201 uint8_t bit_r = led.r % 8;
202 uint8_t bit_g = led.g % 8;
203 uint8_t bit_b = led.b % 8;
204
205 if ( red ) {
206 g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
207 } else {
208 g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
209 }
210 if ( green ) {
211 g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
212 } else {
213 g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
214 }
215 if ( blue ) {
216 g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
217 } else {
218 g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
219 }
220
221 g_led_control_registers_update_required = true;
222
223}
224
225void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
226{
227 if ( g_pwm_buffer_update_required )
228 {
229 // Firstly we need to unlock the command register and select PG1
230 IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
231 IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM );
232
233 IS31FL3737_write_pwm_buffer( addr1, g_pwm_buffer[0] );
234 //IS31FL3737_write_pwm_buffer( addr2, g_pwm_buffer[1] );
235 }
236 g_pwm_buffer_update_required = false;
237}
238
239void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
240{
241 if ( g_led_control_registers_update_required )
242 {
243 // Firstly we need to unlock the command register and select PG0
244 IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
245 IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL );
246 for ( int i=0; i<24; i++ )
247 {
248 IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i] );
249 //IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] );
250 }
251 }
252}
diff --git a/drivers/issi/is31fl3737.h b/drivers/issi/is31fl3737.h
new file mode 100644
index 000000000..69c4b9b53
--- /dev/null
+++ b/drivers/issi/is31fl3737.h
@@ -0,0 +1,207 @@
1/* Copyright 2017 Jason Williams
2 * Copyright 2018 Jack Humbert
3 * Copyright 2018 Yiancar
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19
20#ifndef IS31FL3737_DRIVER_H
21#define IS31FL3737_DRIVER_H
22
23#include <stdint.h>
24#include <stdbool.h>
25
26typedef struct is31_led {
27 uint8_t driver:2;
28 uint8_t r;
29 uint8_t g;
30 uint8_t b;
31} __attribute__((packed)) is31_led;
32
33extern const is31_led g_is31_leds[DRIVER_LED_TOTAL];
34
35void IS31FL3737_init( uint8_t addr );
36void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data );
37void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer );
38
39void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
40void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
41
42void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue );
43
44// This should not be called from an interrupt
45// (eg. from a timer interrupt).
46// Call this while idle (in between matrix scans).
47// If the buffer is dirty, it will update the driver with the buffer.
48void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 );
49void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 );
50
51#define A_1 0x00
52#define A_2 0x01
53#define A_3 0x02
54#define A_4 0x03
55#define A_5 0x04
56#define A_6 0x05
57#define A_7 0x08
58#define A_8 0x09
59#define A_9 0x0A
60#define A_10 0x0B
61#define A_11 0x0C
62#define A_12 0x0D
63
64#define B_1 0x10
65#define B_2 0x11
66#define B_3 0x12
67#define B_4 0x13
68#define B_5 0x14
69#define B_6 0x15
70#define B_7 0x18
71#define B_8 0x19
72#define B_9 0x1A
73#define B_10 0x1B
74#define B_11 0x1C
75#define B_12 0x1D
76
77#define C_1 0x20
78#define C_2 0x21
79#define C_3 0x22
80#define C_4 0x23
81#define C_5 0x24
82#define C_6 0x25
83#define C_7 0x28
84#define C_8 0x29
85#define C_9 0x2A
86#define C_10 0x2B
87#define C_11 0x2C
88#define C_12 0x2D
89
90#define D_1 0x30
91#define D_2 0x31
92#define D_3 0x32
93#define D_4 0x33
94#define D_5 0x34
95#define D_6 0x35
96#define D_7 0x38
97#define D_8 0x39
98#define D_9 0x3A
99#define D_10 0x3B
100#define D_11 0x3C
101#define D_12 0x3D
102
103#define E_1 0x40
104#define E_2 0x41
105#define E_3 0x42
106#define E_4 0x43
107#define E_5 0x44
108#define E_6 0x45
109#define E_7 0x48
110#define E_8 0x49
111#define E_9 0x4A
112#define E_10 0x4B
113#define E_11 0x4C
114#define E_12 0x4D
115
116#define F_1 0x50
117#define F_2 0x51
118#define F_3 0x52
119#define F_4 0x53
120#define F_5 0x54
121#define F_6 0x55
122#define F_7 0x58
123#define F_8 0x59
124#define F_9 0x5A
125#define F_10 0x5B
126#define F_11 0x5C
127#define F_12 0x5D
128
129#define G_1 0x60
130#define G_2 0x61
131#define G_3 0x62
132#define G_4 0x63
133#define G_5 0x64
134#define G_6 0x65
135#define G_7 0x68
136#define G_8 0x69
137#define G_9 0x6A
138#define G_10 0x6B
139#define G_11 0x6C
140#define G_12 0x6D
141
142#define H_1 0x70
143#define H_2 0x71
144#define H_3 0x72
145#define H_4 0x73
146#define H_5 0x74
147#define H_6 0x75
148#define H_7 0x78
149#define H_8 0x79
150#define H_9 0x7A
151#define H_10 0x7B
152#define H_11 0x7C
153#define H_12 0x7D
154
155#define I_1 0x80
156#define I_2 0x81
157#define I_3 0x82
158#define I_4 0x83
159#define I_5 0x84
160#define I_6 0x85
161#define I_7 0x88
162#define I_8 0x89
163#define I_9 0x8A
164#define I_10 0x8B
165#define I_11 0x8C
166#define I_12 0x8D
167
168#define J_1 0x90
169#define J_2 0x91
170#define J_3 0x92
171#define J_4 0x93
172#define J_5 0x94
173#define J_6 0x95
174#define J_7 0x98
175#define J_8 0x99
176#define J_9 0x9A
177#define J_10 0x9B
178#define J_11 0x9C
179#define J_12 0x9D
180
181#define K_1 0xA0
182#define K_2 0xA1
183#define K_3 0xA2
184#define K_4 0xA3
185#define K_5 0xA4
186#define K_6 0xA5
187#define K_7 0xA8
188#define K_8 0xA9
189#define K_9 0xAA
190#define K_10 0xAB
191#define K_11 0xAC
192#define K_12 0xAD
193
194#define L_1 0xB0
195#define L_2 0xB1
196#define L_3 0xB2
197#define L_4 0xB3
198#define L_5 0xB4
199#define L_6 0xB5
200#define L_7 0xB8
201#define L_8 0xB9
202#define L_9 0xBA
203#define L_10 0xBB
204#define L_11 0xBC
205#define L_12 0xBD
206
207#endif // IS31FL3737_DRIVER_H
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h
new file mode 100644
index 000000000..c449d1719
--- /dev/null
+++ b/keyboards/planck/ez/config.h
@@ -0,0 +1,141 @@
1/*
2 * Copyright 2018 Jack Humbert <jack.humb@gmail.com>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20/* USB Device descriptor parameter */
21#define DEVICE_VER 0x0000
22
23#undef MATRIX_ROWS
24#undef MATRIX_COLS
25/* key matrix size */
26#define MATRIX_ROWS 8
27#define MATRIX_COLS 6
28
29/*
30 * Keyboard Matrix Assignments
31 *
32 * Change this to how you wired your keyboard
33 * COLS: AVR pins used for columns, left to right
34 * ROWS: AVR pins used for rows, top to bottom
35 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
36 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
37 *
38*/
39
40#undef MATRIX_ROW_PINS
41#undef MATRIX_COL_PINS
42
43#define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2 }
44#define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 }
45
46#define NUMBER_OF_ENCODERS 1
47#define ENCODERS_PAD_A { B12 }
48#define ENCODERS_PAD_B { B13 }
49
50#define MUSIC_MAP
51#undef AUDIO_VOICES
52#undef C6_AUDIO
53
54/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
55#define DEBOUNCE 6
56
57/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
58//#define LOCKING_SUPPORT_ENABLE
59/* Locking resynchronize hack */
60//#define LOCKING_RESYNC_ENABLE
61
62/*
63 * Force NKRO
64 *
65 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
66 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
67 * makefile for this to work.)
68 *
69 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
70 * until the next keyboard reset.
71 *
72 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
73 * fully operational during normal computer usage.
74 *
75 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
76 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
77 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
78 * power-up.
79 *
80 */
81//#define FORCE_NKRO
82
83/*
84 * Feature disable options
85 * These options are also useful to firmware size reduction.
86 */
87
88/* disable debug print */
89//#define NO_DEBUG
90
91/* disable print */
92//#define NO_PRINT
93
94/* disable action features */
95//#define NO_ACTION_LAYER
96//#define NO_ACTION_TAPPING
97//#define NO_ACTION_ONESHOT
98//#define NO_ACTION_MACRO
99//#define NO_ACTION_FUNCTION
100
101/*
102 * MIDI options
103 */
104
105/* Prevent use of disabled MIDI features in the keymap */
106//#define MIDI_ENABLE_STRICT 1
107
108/* enable basic MIDI features:
109 - MIDI notes can be sent when in Music mode is on
110*/
111//#define MIDI_BASIC
112
113/* enable advanced MIDI features:
114 - MIDI notes can be added to the keymap
115 - Octave shift and transpose
116 - Virtual sustain, portamento, and modulation wheel
117 - etc.
118*/
119//#define MIDI_ADVANCED
120
121/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
122//#define MIDI_TONE_KEYCODE_OCTAVES 1
123
124// #define WS2812_LED_N 2
125// #define RGBLED_NUM WS2812_LED_N
126// #define WS2812_TIM_N 2
127// #define WS2812_TIM_CH 2
128// #define PORT_WS2812 GPIOA
129// #define PIN_WS2812 1
130// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
131//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
132//#define WS2812_EXTERNAL_PULLUP
133
134#define DRIVER_ADDR_1 0b1010000
135#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
136
137#define DRIVER_COUNT 1
138#define DRIVER_1_LED_TOTAL 47
139#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
140
141#define RGB_MATRIX_KEYPRESSES
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c
new file mode 100644
index 000000000..b859af6c1
--- /dev/null
+++ b/keyboards/planck/ez/ez.c
@@ -0,0 +1,175 @@
1/* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
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 2 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#include "ez.h"
17
18const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
19/* Refer to IS31 manual for these locations
20 * driver
21 * | R location
22 * | | G location
23 * | | | B location
24 * | | | | */
25 {0, A_12, B_12, C_12},
26 {0, A_11, B_11, C_11},
27 {0, A_10, B_10, C_10},
28 {0, A_9, B_9, C_9},
29 {0, A_8, B_8, C_8},
30 {0, A_7, B_7, C_7},
31
32 {0, G_12, H_12, I_12},
33 {0, G_11, H_11, I_11},
34 {0, G_10, H_10, I_10},
35 {0, G_9, H_9, I_9},
36 {0, G_8, H_8, I_8},
37 {0, G_7, H_7, I_7},
38
39 {0, A_6, B_6, C_6},
40 {0, A_5, B_5, C_5},
41 {0, A_4, B_4, C_4},
42 {0, A_3, B_3, C_3},
43 {0, A_2, B_2, C_2},
44 {0, A_1, B_1, C_1},
45
46 {0, G_6, H_6, I_6},
47 {0, G_5, H_5, I_5},
48 {0, G_4, H_4, I_4},
49 {0, G_3, H_3, I_3},
50 {0, G_2, H_2, I_2},
51 {0, G_1, H_1, I_1},
52
53 {0, D_12, E_12, F_12},
54 {0, D_11, E_11, F_11},
55 {0, D_10, E_10, F_10},
56 {0, D_9, E_9, F_9},
57 {0, D_8, E_8, F_8},
58 {0, D_7, E_7, F_7},
59
60 {0, J_12, K_12, L_12},
61 {0, J_11, K_11, L_11},
62 {0, J_10, K_10, L_10},
63 {0, J_9, K_9, L_9},
64 {0, J_8, K_8, L_8},
65 {0, J_7, K_7, L_7},
66
67 {0, D_6, E_6, F_6},
68 {0, D_5, E_5, F_5},
69 {0, D_4, E_4, F_4},
70 {0, D_3, E_3, F_3},
71 {0, D_2, E_2, F_2},
72 {0, D_1, E_1, F_1},
73
74 {0, J_6, K_6, L_6},
75 {0, J_5, K_5, L_5},
76 {0, J_4, K_4, L_4},
77 {0, J_3, K_3, L_3},
78 {0, J_2, K_2, L_2},
79
80};
81
82const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
83
84 /*{row | col << 4}
85 | {x=0..224, y=0..64}
86 | | modifier
87 | | | */
88 {{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
89 {{0|(1<<4)}, {20.36*1, 21.33*0}, 0},
90 {{0|(2<<4)}, {20.36*2, 21.33*0}, 0},
91 {{0|(3<<4)}, {20.36*3, 21.33*0}, 0},
92 {{0|(4<<4)}, {20.36*4, 21.33*0}, 0},
93 {{0|(5<<4)}, {20.36*5, 21.33*0}, 0},
94 {{4|(0<<4)}, {20.36*6, 21.33*0}, 0},
95 {{4|(1<<4)}, {20.36*7, 21.33*0}, 0},
96 {{4|(2<<4)}, {20.36*8, 21.33*0}, 0},
97 {{4|(3<<4)}, {20.36*9, 21.33*0}, 0},
98 {{4|(4<<4)}, {20.36*10,21.33*0}, 0},
99 {{4|(5<<4)}, {20.36*11,21.33*0}, 1},
100
101 {{1|(0<<4)}, {20.36*0, 21.33*1}, 1},
102 {{1|(1<<4)}, {20.36*1, 21.33*1}, 0},
103 {{1|(2<<4)}, {20.36*2, 21.33*1}, 0},
104 {{1|(3<<4)}, {20.36*3, 21.33*1}, 0},
105 {{1|(4<<4)}, {20.36*4, 21.33*1}, 0},
106 {{1|(5<<4)}, {20.36*5, 21.33*1}, 0},
107 {{5|(0<<4)}, {20.36*6, 21.33*1}, 0},
108 {{5|(1<<4)}, {20.36*7, 21.33*1}, 0},
109 {{5|(2<<4)}, {20.36*8, 21.33*1}, 0},
110 {{5|(3<<4)}, {20.36*9, 21.33*1}, 0},
111 {{5|(4<<4)}, {20.36*10,21.33*1}, 0},
112 {{5|(5<<4)}, {20.36*11,21.33*1}, 1},
113
114 {{2|(0<<4)}, {20.36*0, 21.33*2}, 1},
115 {{2|(1<<4)}, {20.36*1, 21.33*2}, 0},
116 {{2|(2<<4)}, {20.36*2, 21.33*2}, 0},
117 {{2|(3<<4)}, {20.36*3, 21.33*2}, 0},
118 {{2|(4<<4)}, {20.36*4, 21.33*2}, 0},
119 {{2|(5<<4)}, {20.36*5, 21.33*2}, 0},
120 {{6|(0<<4)}, {20.36*6, 21.33*2}, 0},
121 {{6|(1<<4)}, {20.36*7, 21.33*2}, 0},
122 {{6|(2<<4)}, {20.36*8, 21.33*2}, 0},
123 {{6|(3<<4)}, {20.36*9, 21.33*2}, 0},
124 {{6|(4<<4)}, {20.36*10,21.33*2}, 0},
125 {{6|(5<<4)}, {20.36*11,21.33*2}, 1},
126
127 {{3|(0<<4)}, {20.36*0, 21.33*3}, 1},
128 {{3|(1<<4)}, {20.36*1, 21.33*3}, 1},
129 {{3|(2<<4)}, {20.36*2, 21.33*3}, 1},
130 {{7|(3<<4)}, {20.36*3, 21.33*3}, 1},
131 {{7|(4<<4)}, {20.36*4, 21.33*3}, 1},
132 {{7|(5<<4)}, {20.36*5.5,21.33*3}, 0},
133 {{7|(0<<4)}, {20.36*7, 21.33*3}, 1},
134 {{7|(1<<4)}, {20.36*8, 21.33*3}, 1},
135 {{7|(2<<4)}, {20.36*9, 21.33*3}, 1},
136 {{3|(3<<4)}, {20.36*10,21.33*3}, 1},
137 {{3|(4<<4)}, {20.36*11,21.33*3}, 1}
138};
139
140void matrix_init_kb(void) {
141 matrix_init_user();
142
143 palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL);
144 palSetPadMode(GPIOB, 9, PAL_MODE_OUTPUT_PUSHPULL);
145
146 palClearPad(GPIOB, 8);
147 palClearPad(GPIOB, 9);
148}
149
150void matrix_scan_kb(void) {
151 matrix_scan_user();
152}
153
154uint32_t layer_state_set_kb(uint32_t state) {
155
156 palClearPad(GPIOB, 8);
157 palClearPad(GPIOB, 9);
158 state = layer_state_set_user(state);
159 uint8_t layer = biton32(state);
160 switch (layer) {
161 case 3:
162 palSetPad(GPIOB, 9);
163 break;
164 case 4:
165 palSetPad(GPIOB, 8);
166 break;
167 case 6:
168 palSetPad(GPIOB, 9);
169 palSetPad(GPIOB, 8);
170 break;
171 default:
172 break;
173 }
174 return state;
175}
diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h
new file mode 100644
index 000000000..a3ca2b6ec
--- /dev/null
+++ b/keyboards/planck/ez/ez.h
@@ -0,0 +1,107 @@
1/* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
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 2 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#pragma once
17
18#include "planck.h"
19
20#define LAYOUT_planck_1x2uC( \
21 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
22 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
23 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
24 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
25) \
26{ \
27 { k00, k01, k02, k03, k04, k05 }, \
28 { k10, k11, k12, k13, k14, k15 }, \
29 { k20, k21, k22, k23, k24, k25 }, \
30 { k30, k31, k32, k39, k3a, k3b }, \
31 { k06, k07, k08, k09, k0a, k0b }, \
32 { k16, k17, k18, k19, k1a, k1b }, \
33 { k26, k27, k28, k29, k2a, k2b }, \
34 { k36, k37, k38, k33, k34, k35 } \
35}
36
37#define LAYOUT_planck_1x2uR( \
38 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
39 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
40 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
41 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
42) \
43{ \
44 { k00, k01, k02, k03, k04, k05 }, \
45 { k10, k11, k12, k13, k14, k15 }, \
46 { k20, k21, k22, k23, k24, k25 }, \
47 { k30, k31, k32, k39, k3a, k3b }, \
48 { k06, k07, k08, k09, k0a, k0b }, \
49 { k16, k17, k18, k19, k1a, k1b }, \
50 { k26, k27, k28, k29, k2a, k2b }, \
51 { k36, k37, k38, k33, k34, k35 } \
52}
53
54#define LAYOUT_planck_1x2uL( \
55 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
56 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
57 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
58 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
59) \
60{ \
61 { k00, k01, k02, k03, k04, k05 }, \
62 { k10, k11, k12, k13, k14, k15 }, \
63 { k20, k21, k22, k23, k24, k25 }, \
64 { k30, k31, k32, k39, k3a, k3b }, \
65 { k06, k07, k08, k09, k0a, k0b }, \
66 { k16, k17, k18, k19, k1a, k1b }, \
67 { k26, k27, k28, k29, k2a, k2b }, \
68 { k36, k37, k38, k33, k34, k35 } \
69}
70
71#define LAYOUT_planck_2x2u( \
72 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
73 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
74 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
75 k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a \
76) \
77{ \
78 { k00, k01, k02, k03, k04, k05 }, \
79 { k10, k11, k12, k13, k14, k15 }, \
80 { k20, k21, k22, k23, k24, k25 }, \
81 { k30, k31, k32, k39, k3a, k3b }, \
82 { k06, k07, k08, k09, k0a, k0b }, \
83 { k16, k17, k18, k19, k1a, k1b }, \
84 { k26, k27, k28, k29, k2a, k2b }, \
85 { k36, k37, k38, k33, k34, k35 } \
86}
87
88#define LAYOUT_planck_grid( \
89 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
90 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
91 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
92 k30, k31, k32, k33, k34, k35, KC_NO, k36, k37, k38, k39, k3a \
93) \
94{ \
95 { k00, k01, k02, k03, k04, k05 }, \
96 { k10, k11, k12, k13, k14, k15 }, \
97 { k20, k21, k22, k23, k24, k25 }, \
98 { k30, k31, k32, k39, k3a, KC_NO }, \
99 { k06, k07, k08, k09, k0a, k0b }, \
100 { k16, k17, k18, k19, k1a, k1b }, \
101 { k26, k27, k28, k29, k2a, k2b }, \
102 { k36, k37, k38, k33, k34, k35 } \
103}
104
105#define KEYMAP LAYOUT_planck_grid
106#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
107#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk
new file mode 100644
index 000000000..c6fb52d2b
--- /dev/null
+++ b/keyboards/planck/ez/rules.mk
@@ -0,0 +1,24 @@
1# project specific files
2LAYOUTS += ortho_4x12
3
4# Cortex version
5MCU = STM32F303
6
7# Build Options
8# comment out to disable the options.
9#
10BACKLIGHT_ENABLE = no
11BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
12## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
13MOUSEKEY_ENABLE = yes # Mouse keys
14EXTRAKEY_ENABLE = yes # Audio control and System control
15CONSOLE_ENABLE = yes # Console for debug
16COMMAND_ENABLE = yes # Commands for debug and configuration
17#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
18NKRO_ENABLE = yes # USB Nkey Rollover
19CUSTOM_MATRIX = no # Custom matrix file
20AUDIO_ENABLE = yes
21RGBLIGHT_ENABLE = no
22# SERIAL_LINK_ENABLE = yes
23ENCODER_ENABLE = yes
24RGB_MATRIX_ENABLE = IS31FL3737
diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h
index d908d80ec..4bc5e9c3f 100644
--- a/keyboards/planck/planck.h
+++ b/keyboards/planck/planck.h
@@ -5,6 +5,10 @@
5 5
6#define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise) 6#define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise)
7 7
8#ifdef KEYBOARD_planck_ez
9 #include "ez.h"
10#endif
11
8#ifdef __AVR__ 12#ifdef __AVR__
9#define LAYOUT_planck_mit( \ 13#define LAYOUT_planck_mit( \
10 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ 14 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
@@ -50,7 +54,7 @@
50#define LAYOUT_ortho_4x12 LAYOUT_planck_grid 54#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
51#define KC_LAYOUT_ortho_4x12 KC_KEYMAP 55#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
52 56
53#else 57#elif KEYBOARD_planck_rev6
54 58
55 #define LAYOUT_planck_1x2uC( \ 59 #define LAYOUT_planck_1x2uC( \
56 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ 60 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c
index 6760015ef..de0cd15c5 100644
--- a/quantum/audio/audio_arm.c
+++ b/quantum/audio/audio_arm.c
@@ -79,7 +79,7 @@ float startup_song[][2] = STARTUP_SONG;
79 79
80static void gpt_cb8(GPTDriver *gptp); 80static void gpt_cb8(GPTDriver *gptp);
81 81
82#define DAC_BUFFER_SIZE 720 82#define DAC_BUFFER_SIZE 100
83#ifndef DAC_SAMPLE_MAX 83#ifndef DAC_SAMPLE_MAX
84#define DAC_SAMPLE_MAX 65535U 84#define DAC_SAMPLE_MAX 65535U
85#endif 85#endif
@@ -98,8 +98,8 @@ static void gpt_cb8(GPTDriver *gptp);
98 RESTART_CHANNEL_1() 98 RESTART_CHANNEL_1()
99#define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \ 99#define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \
100 RESTART_CHANNEL_2() 100 RESTART_CHANNEL_2()
101#define GET_CHANNEL_1_FREQ gpt6cfg1.frequency 101#define GET_CHANNEL_1_FREQ (uint16_t)(gpt6cfg1.frequency * DAC_BUFFER_SIZE)
102#define GET_CHANNEL_2_FREQ gpt7cfg1.frequency 102#define GET_CHANNEL_2_FREQ (uint16_t)(gpt7cfg1.frequency * DAC_BUFFER_SIZE)
103 103
104 104
105/* 105/*
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h
index 855ea0323..0e193dcb2 100644
--- a/quantum/rgb_matrix.h
+++ b/quantum/rgb_matrix.h
@@ -28,7 +28,9 @@
28#ifdef IS31FL3731 28#ifdef IS31FL3731
29 #include "is31fl3731.h" 29 #include "is31fl3731.h"
30#elif defined (IS31FL3733) 30#elif defined (IS31FL3733)
31 #include "is31fl3733.h" 31 #include "is31fl3733.h"
32#elif defined (IS31FL3737)
33 #include "is31fl3737.h"
32#endif 34#endif
33 35
34#ifndef RGB_MATRIX_LED_FLUSH_LIMIT 36#ifndef RGB_MATRIX_LED_FLUSH_LIMIT
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c
index 70b80293d..3b7d58483 100644
--- a/quantum/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix_drivers.c
@@ -23,7 +23,7 @@
23 * be here if shared between boards. 23 * be here if shared between boards.
24 */ 24 */
25 25
26#if defined(IS31FL3731) || defined(IS31FL3733) 26#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737)
27 27
28#include "i2c_master.h" 28#include "i2c_master.h"
29 29
@@ -33,23 +33,29 @@ static void init( void )
33#ifdef IS31FL3731 33#ifdef IS31FL3731
34 IS31FL3731_init( DRIVER_ADDR_1 ); 34 IS31FL3731_init( DRIVER_ADDR_1 );
35 IS31FL3731_init( DRIVER_ADDR_2 ); 35 IS31FL3731_init( DRIVER_ADDR_2 );
36#else 36#elif defined(IS31FL3733)
37 IS31FL3733_init( DRIVER_ADDR_1 ); 37 IS31FL3733_init( DRIVER_ADDR_1 );
38#else
39 IS31FL3737_init( DRIVER_ADDR_1 );
38#endif 40#endif
39 for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { 41 for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) {
40 bool enabled = true; 42 bool enabled = true;
41 // This only caches it for later 43 // This only caches it for later
42#ifdef IS31FL3731 44#ifdef IS31FL3731
43 IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); 45 IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
44#else 46#elif defined(IS31FL3733)
45 IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); 47 IS31FL3733_set_led_control_register( index, enabled, enabled, enabled );
48#else
49 IS31FL3737_set_led_control_register( index, enabled, enabled, enabled );
46#endif 50#endif
47 } 51 }
48 // This actually updates the LED drivers 52 // This actually updates the LED drivers
49#ifdef IS31FL3731 53#ifdef IS31FL3731
50 IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); 54 IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
51#else 55#elif defined(IS31FL3733)
52 IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); 56 IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
57#else
58 IS31FL3737_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
53#endif 59#endif
54} 60}
55 61
@@ -65,7 +71,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
65 .set_color = IS31FL3731_set_color, 71 .set_color = IS31FL3731_set_color,
66 .set_color_all = IS31FL3731_set_color_all, 72 .set_color_all = IS31FL3731_set_color_all,
67}; 73};
68#else 74#elif defined(IS31FL3733)
69static void flush( void ) 75static void flush( void )
70{ 76{
71 IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); 77 IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
@@ -77,6 +83,18 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
77 .set_color = IS31FL3733_set_color, 83 .set_color = IS31FL3733_set_color,
78 .set_color_all = IS31FL3733_set_color_all, 84 .set_color_all = IS31FL3733_set_color_all,
79}; 85};
86#else
87static void flush( void )
88{
89 IS31FL3737_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
90}
91
92const rgb_matrix_driver_t rgb_matrix_driver = {
93 .init = init,
94 .flush = flush,
95 .set_color = IS31FL3737_set_color,
96 .set_color_all = IS31FL3737_set_color_all,
97};
80#endif 98#endif
81 99
82#endif 100#endif
diff --git a/quantum/stm32/halconf.h b/quantum/stm32/halconf.h
index 8fe8e0c6f..c3e0cbb72 100644
--- a/quantum/stm32/halconf.h
+++ b/quantum/stm32/halconf.h
@@ -76,7 +76,7 @@
76 * @brief Enables the I2C subsystem. 76 * @brief Enables the I2C subsystem.
77 */ 77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) 78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE 79#define HAL_USE_I2C TRUE
80#endif 80#endif
81 81
82/** 82/**
diff --git a/quantum/stm32/mcuconf.h b/quantum/stm32/mcuconf.h
index 7c3c6e570..36f8ca225 100644
--- a/quantum/stm32/mcuconf.h
+++ b/quantum/stm32/mcuconf.h
@@ -154,7 +154,7 @@
154/* 154/*
155 * I2C driver system settings. 155 * I2C driver system settings.
156 */ 156 */
157#define STM32_I2C_USE_I2C1 FALSE 157#define STM32_I2C_USE_I2C1 TRUE
158#define STM32_I2C_USE_I2C2 FALSE 158#define STM32_I2C_USE_I2C2 FALSE
159#define STM32_I2C_BUSY_TIMEOUT 50 159#define STM32_I2C_BUSY_TIMEOUT 50
160#define STM32_I2C_I2C1_IRQ_PRIORITY 10 160#define STM32_I2C_I2C1_IRQ_PRIORITY 10