LED drivers: add support for shutdown pin (#23058)
* LED drivers: add support for shutdown pin * Update candidate boards
This commit is contained in:
parent
0b7df03ab7
commit
a9f1105f98
63 changed files with 164 additions and 159 deletions
|
@ -5,3 +5,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_SDB_PIN D5
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
void matrix_init_kb(void) {
|
||||
setPinOutput(D5);
|
||||
writePinHigh(D5);
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
|
|
|
@ -44,6 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
/* LED matrix driver */
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_SDB_PIN B16
|
||||
|
||||
/* i2c (for LED matrix) */
|
||||
#define I2C1_CLOCK_SPEED 400000
|
||||
|
|
|
@ -95,11 +95,6 @@ __attribute__ ((weak)) void matrix_scan_user(void) {}
|
|||
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
// Turn on LED controller
|
||||
setPinOutput(B16);
|
||||
writePinHigh(B16);
|
||||
#endif
|
||||
// The backlight always has to be initialized, otherwise it will stay lit
|
||||
lcd_backlight_hal_init();
|
||||
#ifdef ST7565_ENABLE
|
||||
|
|
|
@ -50,3 +50,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_SDB_PIN B16
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "is31fl3733-dual.h"
|
||||
#include "i2c_master.h"
|
||||
#include "gpio.h"
|
||||
#include "wait.h"
|
||||
|
||||
#define IS31FL3733_PWM_REGISTER_COUNT 192
|
||||
|
@ -126,6 +127,11 @@ void is31fl3733_write_pwm_buffer(uint8_t bus, uint8_t index) {
|
|||
}
|
||||
|
||||
void is31fl3733_init_drivers(void) {
|
||||
#if defined(IS31FL3733_SDB_PIN)
|
||||
setPinOutput(IS31FL3733_SDB_PIN);
|
||||
writePinHigh(IS31FL3733_SDB_PIN);
|
||||
#endif
|
||||
|
||||
i2c_init(&I2CD1, I2C1_SCL_PIN, I2C1_SDA_PIN);
|
||||
|
||||
is31fl3733_init(0, 0);
|
||||
|
|
|
@ -201,14 +201,6 @@ led_config_t g_led_config = {
|
|||
}
|
||||
};
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
// Turn on LED controller
|
||||
setPinOutput(B16);
|
||||
writePinHigh(B16);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
|
|
@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
/* LED matrix driver */
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_SDB_PIN B16
|
||||
|
||||
/* i2c (for LED matrix) */
|
||||
#define I2C1_CLOCK_SPEED 400000
|
||||
|
|
|
@ -65,15 +65,6 @@ led_config_t g_led_config = {
|
|||
};
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
// Turn on LED controller
|
||||
setPinOutput(B16);
|
||||
writePinHigh(B16);
|
||||
#endif
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN B7
|
||||
|
|
|
@ -183,11 +183,4 @@ void matrix_init_kb(void) {
|
|||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(B7);
|
||||
writePinHigh(B7);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -181,11 +181,4 @@ void matrix_init_kb(void) {
|
|||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(B7);
|
||||
writePinHigh(B7);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN A2
|
||||
|
|
|
@ -116,9 +116,3 @@ void suspend_wakeup_init_kb(void) {
|
|||
suspend_wakeup_init_user();
|
||||
}
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -126,9 +126,3 @@ void suspend_wakeup_init_kb(void) {
|
|||
suspend_wakeup_init_user();
|
||||
}
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN A2
|
||||
|
|
|
@ -119,12 +119,4 @@ void suspend_wakeup_init_kb(void) {
|
|||
rgb_matrix_set_suspend_state(false);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -126,9 +126,3 @@ void suspend_wakeup_init_kb(void) {
|
|||
suspend_wakeup_init_user();
|
||||
}
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN A2
|
||||
|
|
|
@ -116,11 +116,4 @@ void suspend_wakeup_init_kb(void) {
|
|||
rgb_matrix_set_suspend_state(false);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -119,12 +119,4 @@ void suspend_wakeup_init_kb(void) {
|
|||
rgb_matrix_set_suspend_state(false);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -126,9 +126,3 @@ void suspend_wakeup_init_kb(void) {
|
|||
suspend_wakeup_init_user();
|
||||
}
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN A2
|
||||
|
|
|
@ -131,9 +131,3 @@ void suspend_wakeup_init_kb(void) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN B7
|
||||
|
|
|
@ -151,11 +151,4 @@ void matrix_init_kb(void) {
|
|||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(B7);
|
||||
writePinHigh(B7);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN A2
|
||||
|
|
|
@ -149,12 +149,4 @@ void suspend_wakeup_init_kb(void) {
|
|||
rgb_matrix_set_suspend_state(false);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(A2);
|
||||
writePinHigh(A2);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
#define IS31FL3741_SDB_PIN B7
|
||||
|
|
|
@ -142,14 +142,4 @@ led_config_t g_led_config = {
|
|||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(B7);
|
||||
writePinHigh(B7);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_SDB_PIN D2
|
||||
#define IS31FL3731_IRQ_PIN D3
|
||||
|
||||
#define RGB_MATRIX_DISABLE_KEYCODES
|
||||
|
||||
|
|
|
@ -93,13 +93,9 @@ void keyboard_pre_init_kb(void) {
|
|||
setPinOutput(POWER_LED_PIN);
|
||||
writePinLow(POWER_LED_PIN);
|
||||
|
||||
// Enable RGB driver IC
|
||||
setPinOutput(RGB_DISABLE_N_PIN);
|
||||
writePinHigh(RGB_DISABLE_N_PIN);
|
||||
|
||||
// We don't use this feature of the IS31FL3731 but it is electrically connected
|
||||
// Make sure not to drive it
|
||||
setPinInput(RGB_IRQ_N_PIN);
|
||||
setPinInput(IS31FL3731_IRQ_PIN);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#include "quantum.h"
|
||||
|
||||
#define POWER_LED_PIN F1
|
||||
#define RGB_DISABLE_N_PIN D2
|
||||
#define RGB_IRQ_N_PIN D3
|
||||
|
||||
// If you want something similar to what Taran from LMG does in https://github.com/TaranVH/2nd-keyboard
|
||||
// you can create a "wrapper key" by uncommenting the row below and chosing your wrapper keycode.
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3743A_I2C_ADDRESS_1 IS31FL3743A_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3743A_SDB_PIN C1
|
||||
|
||||
#define CAPS_LOCK_INDEX 28
|
||||
#define WIN_MOD_INDEX 16
|
||||
#define MAC_MOD_INDEX 17
|
||||
#define WIN_LOCK_INDEX 54
|
||||
#define SDB C1 //RGB matrix Power control PIN
|
||||
|
|
|
@ -213,14 +213,14 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
|||
|
||||
void suspend_power_down_kb() {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
writePinLow(SDB);
|
||||
writePinLow(IS31FL3743A_SDB_PIN);
|
||||
# endif
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
void suspend_wakeup_init_kb() {
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
writePinHigh(SDB);
|
||||
writePinHigh(IS31FL3743A_SDB_PIN);
|
||||
# endif
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
@ -228,8 +228,4 @@ void suspend_wakeup_init_kb() {
|
|||
void board_init(void) {
|
||||
// JTAG-DP Disabled and SW-DP Disabled
|
||||
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk) | AFIO_MAPR_SWJ_CFG_DISABLE;
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
setPinOutput(SDB);
|
||||
writePinHigh(SDB);
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
#pragma once
|
||||
|
||||
#define IS31FL3743A_I2C_ADDRESS_1 IS31FL3743A_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3743A_SDB_PIN A4
|
||||
|
||||
#define CAPS_LOCK_INDEX 28
|
||||
#define WIN_MOD_INDEX 16
|
||||
#define MAC_MOD_INDEX 17
|
||||
#define SDB A4
|
||||
|
||||
#define g_suspend_state rgb_matrix_get_suspend_state()
|
||||
|
|
|
@ -149,12 +149,12 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
|||
|
||||
|
||||
void suspend_power_down_kb(void) {
|
||||
writePinLow(SDB);
|
||||
writePinLow(IS31FL3743A_SDB_PIN);
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
void suspend_wakeup_init_kb(void) {
|
||||
writePinHigh(SDB);
|
||||
writePinHigh(IS31FL3743A_SDB_PIN);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
#endif
|
||||
|
@ -220,8 +220,4 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
|||
void board_init(void) {
|
||||
// JTAG-DP Disabled and SW-DP Disabled
|
||||
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk) | AFIO_MAPR_SWJ_CFG_DISABLE;
|
||||
# ifdef RGB_MATRIX_ENABLE
|
||||
setPinOutput(SDB);
|
||||
writePinHigh(SDB);
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -16,5 +16,4 @@
|
|||
#pragma once
|
||||
|
||||
#define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND
|
||||
|
||||
#define SDB C1
|
||||
#define SNLED27351_SDB_PIN C1
|
||||
|
|
|
@ -102,18 +102,13 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
|
|||
#endif // RGB_MATRIX_ENABLE
|
||||
|
||||
void suspend_power_down_kb() {
|
||||
writePinLow(SDB);
|
||||
writePinLow(SNLED27351_SDB_PIN);
|
||||
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
void suspend_wakeup_init_kb() {
|
||||
writePinHigh(SDB);
|
||||
|
||||
writePinHigh(SNLED27351_SDB_PIN);
|
||||
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
void board_init(void) {
|
||||
setPinOutput(SDB);
|
||||
writePinHigh(SDB);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_VCC
|
||||
#define IS31FL3733_SDB_PIN B9
|
||||
|
||||
#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CUSTOM_SINGLE_COLOR_RAINDROPS
|
||||
|
||||
|
|
|
@ -16,14 +16,6 @@
|
|||
|
||||
#include "quantum.h"
|
||||
|
||||
/* This board has !SDB of the is31 wired to D2. Set high to enable */
|
||||
void keyboard_post_init_kb(void) {
|
||||
setPinOutput(B9);
|
||||
writePinHigh(B9);
|
||||
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue