mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-24 20:32:58 +00:00
Add _flush()
functions to LED drivers (#22308)
This commit is contained in:
parent
1e9b299fb0
commit
cf7d3435d7
@ -166,3 +166,10 @@ void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index) {
|
||||
}
|
||||
g_pwm_buffer_update_required[index] = false;
|
||||
}
|
||||
|
||||
void aw20216s_flush(void) {
|
||||
aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0);
|
||||
#if defined(AW20216S_CS_PIN_2)
|
||||
aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -68,6 +68,8 @@ void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
|
||||
void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index);
|
||||
|
||||
void aw20216s_flush(void);
|
||||
|
||||
#define CS1_SW1 0x00
|
||||
#define CS2_SW1 0x01
|
||||
#define CS3_SW1 0x02
|
||||
|
@ -211,3 +211,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3731_flush(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3731_I2C_ADDRESS_2)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_3)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_4)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -80,6 +80,8 @@ void is31fl3731_set_led_control_register(uint8_t index, bool value);
|
||||
void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3731_flush(void);
|
||||
|
||||
#define C1_1 0x24
|
||||
#define C1_2 0x25
|
||||
#define C1_3 0x26
|
||||
|
@ -223,3 +223,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
}
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
|
||||
void is31fl3731_flush(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3731_I2C_ADDRESS_2)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_3)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_4)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -81,6 +81,8 @@ void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3731_flush(void);
|
||||
|
||||
#define C1_1 0x24
|
||||
#define C1_2 0x25
|
||||
#define C1_3 0x26
|
||||
|
@ -233,3 +233,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3733_flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3733_I2C_ADDRESS_2)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_3)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_4)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -99,6 +99,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool value);
|
||||
void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3733_flush(void);
|
||||
|
||||
#define IS31FL3733_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time
|
||||
|
@ -248,3 +248,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3733_flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3733_I2C_ADDRESS_2)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_3)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_4)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -124,6 +124,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3733_flush(void);
|
||||
|
||||
#define IS31FL3733_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time
|
||||
|
@ -220,3 +220,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3736_flush(void) {
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3736_I2C_ADDRESS_2)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_3)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_4)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -94,6 +94,8 @@ void is31fl3736_set_led_control_register(uint8_t index, bool value);
|
||||
void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3736_flush(void);
|
||||
|
||||
#define IS31FL3736_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor
|
||||
#define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor
|
||||
|
@ -237,3 +237,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3736_flush(void) {
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3736_I2C_ADDRESS_2)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_3)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_4)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -108,6 +108,8 @@ void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3736_flush(void);
|
||||
|
||||
#define IS31FL3736_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor
|
||||
#define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor
|
||||
|
@ -217,3 +217,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3737_flush(void) {
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3737_I2C_ADDRESS_2)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_3)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_4)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ void is31fl3737_set_led_control_register(uint8_t index, bool value);
|
||||
void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3737_flush(void);
|
||||
|
||||
#define IS31FL3737_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL
|
||||
|
@ -233,3 +233,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void is31fl3737_flush(void) {
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3737_I2C_ADDRESS_2)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_3)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_4)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -101,6 +101,8 @@ void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3737_flush(void);
|
||||
|
||||
#define IS31FL3737_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL
|
||||
|
@ -251,3 +251,16 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t valu
|
||||
|
||||
g_scaling_registers_update_required[pled->driver] = true;
|
||||
}
|
||||
|
||||
void is31fl3741_flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3741_I2C_ADDRESS_2)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_3)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_4)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t valu
|
||||
|
||||
void is31fl3741_set_pwm_buffer(const is31fl3741_led *pled, uint8_t value);
|
||||
|
||||
void is31fl3741_flush(void);
|
||||
|
||||
#define IS31FL3741_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor
|
||||
#define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor
|
||||
|
@ -269,3 +269,16 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red,
|
||||
|
||||
g_scaling_registers_update_required[pled->driver] = true;
|
||||
}
|
||||
|
||||
void is31fl3741_flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
#if defined(IS31FL3741_I2C_ADDRESS_2)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_3)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_4)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
@ -104,6 +104,8 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red,
|
||||
|
||||
void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
void is31fl3741_flush(void);
|
||||
|
||||
#define IS31FL3741_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor
|
||||
#define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor
|
||||
|
@ -174,6 +174,19 @@ void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) {
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL_common_flush(void) {
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0);
|
||||
#if defined(DRIVER_ADDR_2)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1);
|
||||
# if defined(DRIVER_ADDR_3)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2);
|
||||
# if defined(DRIVER_ADDR_4)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// Colour is set by adjusting PWM register
|
||||
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
|
@ -67,6 +67,8 @@ void IS31FL_common_init(uint8_t addr, uint8_t ssr);
|
||||
void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index);
|
||||
void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index);
|
||||
|
||||
void IS31FL_common_flush(void);
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// RGB Matrix Specific scripts
|
||||
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
@ -203,6 +203,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
|
||||
void snled27351_flush(void) {
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
|
||||
#if defined(SNLED27351_I2C_ADDRESS_2)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_3)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_4)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void snled27351_sw_return_normal(uint8_t addr) {
|
||||
// Select to function page
|
||||
snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE);
|
||||
|
@ -82,6 +82,8 @@ void snled27351_set_led_control_register(uint8_t index, bool value);
|
||||
void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void snled27351_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void snled27351_flush(void);
|
||||
|
||||
void snled27351_sw_return_normal(uint8_t addr);
|
||||
void snled27351_sw_shutdown(uint8_t addr);
|
||||
|
||||
|
@ -218,6 +218,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
|
||||
void snled27351_flush(void) {
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
|
||||
#if defined(SNLED27351_I2C_ADDRESS_2)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_3)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_4)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void snled27351_sw_return_normal(uint8_t addr) {
|
||||
// Select to function page
|
||||
snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE);
|
||||
|
@ -96,6 +96,8 @@ void snled27351_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void snled27351_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void snled27351_flush(void);
|
||||
|
||||
void snled27351_sw_return_normal(uint8_t addr);
|
||||
void snled27351_sw_shutdown(uint8_t addr);
|
||||
|
||||
|
@ -145,8 +145,10 @@ led_config_t g_led_config = { {
|
||||
// Custom Driver
|
||||
static void init(void) {
|
||||
i2c_init();
|
||||
|
||||
is31fl3731_init(IS31FL3731_I2C_ADDRESS_1);
|
||||
is31fl3731_init(IS31FL3731_I2C_ADDRESS_2);
|
||||
|
||||
for (int index = 0; index < ISSI_DRIVER_TOTAL; index++) {
|
||||
bool enabled = !( ( index == 18+5) || //B5
|
||||
( index == 36+17) || //C17
|
||||
@ -154,29 +156,16 @@ static void init(void) {
|
||||
);
|
||||
is31fl3731_set_led_control_register(index, enabled, enabled, enabled);
|
||||
}
|
||||
|
||||
is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
}
|
||||
|
||||
static void flush(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
}
|
||||
|
||||
static void set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
is31fl3731_set_color(index, red, green, blue);
|
||||
}
|
||||
|
||||
static void set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
is31fl3731_set_color_all( red, green, blue );
|
||||
}
|
||||
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.set_color = set_color,
|
||||
.set_color_all = set_color_all
|
||||
.flush = is31fl3731_flush,
|
||||
.set_color = is31fl3731_set_color,
|
||||
.set_color_all = is31fl3731_set_color_all
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@ void init_fallacy_leds(void) {
|
||||
/* update the buffer
|
||||
*/
|
||||
void update_fallacy_leds(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
is31fl3731_flush();
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,7 +53,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_DRIVER_COUNT 1
|
||||
#define RGB_MATRIX_LED_COUNT 64
|
||||
|
||||
// These define which keys in the matrix are alphas/mods
|
||||
|
@ -53,7 +53,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_DRIVER_COUNT 1
|
||||
#define RGB_MATRIX_LED_COUNT 64
|
||||
|
||||
// These define which keys in the matrix are alphas/mods
|
||||
|
@ -50,7 +50,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_DRIVER_COUNT 1
|
||||
#define RGB_MATRIX_LED_COUNT 64
|
||||
|
||||
// These define which keys in the matrix are alphas/mods
|
||||
|
@ -9,9 +9,9 @@
|
||||
{ C11 }
|
||||
|
||||
/* I2C Config for LED Driver */
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_ADDR_1 0b1110100
|
||||
#define DRIVER_ADDR_2 0b1110111
|
||||
#define SNLED27351_DRIVER_COUNT 2
|
||||
#define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND
|
||||
#define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO
|
||||
#define I2C1_SDA_PIN B7
|
||||
#define I2C1_SCL_PIN B6
|
||||
#define I2C1_SCL_PAL_MODE 4
|
||||
|
@ -33,7 +33,7 @@
|
||||
]
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "ckled2001",
|
||||
"driver": "snled27351",
|
||||
"max_brightness": 180,
|
||||
"animations": {
|
||||
"solid_color": true,
|
||||
|
@ -5,7 +5,7 @@
|
||||
// clang-format off
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
* | R location
|
||||
|
@ -248,3 +248,10 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
}
|
||||
g_led_control_registers_update_required[index] = false;
|
||||
}
|
||||
|
||||
void is31fl3733_flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
# ifdef USE_I2C2
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# endif
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bo
|
||||
void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index); // index is the driver index
|
||||
void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
void is31fl3733_flush(void);
|
||||
|
||||
#define IS31FL3733_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time
|
||||
|
@ -38,16 +38,9 @@ static void init(void) {
|
||||
# endif
|
||||
}
|
||||
|
||||
static void flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
# ifdef USE_I2C2
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3733_flush,
|
||||
.set_color = is31fl3733_set_color,
|
||||
.set_color_all = is31fl3733_set_color_all,
|
||||
};
|
||||
|
@ -50,6 +50,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 128
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "drivers/issi/is31fl3733.h"
|
||||
#include "drivers/led/issi/is31fl3733.h"
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@ -50,9 +50,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
static uint16_t ledTimer;
|
||||
|
||||
uint8_t R = 0; /* First led*/
|
||||
uint8_t G = 0; /* Second led*/
|
||||
uint8_t B = 0; /* Third led*/
|
||||
uint8_t r = 0; /* First led*/
|
||||
uint8_t g = 0; /* Second led*/
|
||||
uint8_t b = 0; /* Third led*/
|
||||
|
||||
/* Boot animation parameters */
|
||||
|
||||
@ -74,44 +74,44 @@ bool bootAnimation(void){
|
||||
if (bootFirst>0 || bootSec>0){
|
||||
if(bootFirst!=0){
|
||||
if (timer_elapsed(ledTimer) > 150){
|
||||
G = 255;
|
||||
R = 0;
|
||||
B = 0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 255;
|
||||
r = 0;
|
||||
b = 0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
}
|
||||
if (timer_elapsed(ledTimer) > 300){
|
||||
G = 255;
|
||||
R = 255;
|
||||
B = 0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 255;
|
||||
r = 255;
|
||||
b = 0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
}
|
||||
if (timer_elapsed(ledTimer) > 400){
|
||||
G = 255;
|
||||
R = 255;
|
||||
B = 255;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 255;
|
||||
r = 255;
|
||||
b = 255;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
}
|
||||
if (timer_elapsed(ledTimer) > 500){
|
||||
G = 0;
|
||||
R = 0;
|
||||
B = 0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 0;
|
||||
r = 0;
|
||||
b = 0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
ledTimer = timer_read();
|
||||
bootFirst--;
|
||||
}
|
||||
}
|
||||
if (bootFirst==0 && bootSec!=0){
|
||||
if (timer_elapsed(ledTimer) > 200) {
|
||||
G = 255;
|
||||
R = 255;
|
||||
B = 255;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 255;
|
||||
r = 255;
|
||||
b = 255;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
}
|
||||
if (timer_elapsed(ledTimer) > 400){
|
||||
G = 0;
|
||||
R = 0;
|
||||
B = 0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 0;
|
||||
r = 0;
|
||||
b = 0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
ledTimer = timer_read();
|
||||
bootSec--;
|
||||
}
|
||||
@ -125,29 +125,29 @@ bool bootAnimation(void){
|
||||
void breathing(void) {
|
||||
if(timer_elapsed(ledTimer)<travelTime){
|
||||
time = timer_elapsed(ledTimer);
|
||||
if((time - previousTime) > fadeTime && R<maxBrightness){
|
||||
G+=fadeStep;
|
||||
R+=fadeStep;
|
||||
B+=fadeStep;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
if((time - previousTime) > fadeTime && r<maxBrightness){
|
||||
g+=fadeStep;
|
||||
r+=fadeStep;
|
||||
b+=fadeStep;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
previousTime = time;
|
||||
}
|
||||
}
|
||||
else if(timer_elapsed(ledTimer)<(travelTime * 2)){
|
||||
time = timer_elapsed(ledTimer);
|
||||
if((time - previousTime) > fadeTime && R>minBrightness){
|
||||
G-=fadeStep;
|
||||
R-=fadeStep;
|
||||
B-=fadeStep;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
if((time - previousTime) > fadeTime && r>minBrightness){
|
||||
g-=fadeStep;
|
||||
r-=fadeStep;
|
||||
b-=fadeStep;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
previousTime = time;
|
||||
}
|
||||
}
|
||||
else {
|
||||
R=0;
|
||||
G=0;
|
||||
B=0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
r=0;
|
||||
g=0;
|
||||
b=0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
previousTime = 0;
|
||||
time = 0;
|
||||
ledTimer=timer_read();
|
||||
@ -166,10 +166,10 @@ void matrix_scan_user(void){
|
||||
prevCapsState = capsState;
|
||||
}
|
||||
else if(!capsState && capsState != prevCapsState){
|
||||
G = 0;
|
||||
R = 0;
|
||||
B = 0;
|
||||
is31fl3733_set_color( 6+64-1, R, G, B );
|
||||
g = 0;
|
||||
r = 0;
|
||||
b = 0;
|
||||
is31fl3733_set_color( 6+64-1, r, g, b );
|
||||
prevCapsState = capsState;
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ void rgb_ring_task(void)
|
||||
break;
|
||||
};
|
||||
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
is31fl3731_flush();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record)
|
||||
|
@ -36,9 +36,9 @@
|
||||
#define WEAR_LEVELING_BACKING_SIZE (8 * 1024)
|
||||
|
||||
/* I2C Config for LED Driver */
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_ADDR_1 0b1110100
|
||||
#define DRIVER_ADDR_2 0b1110111
|
||||
#define SNLED27351_DRIVER_COUNT 2
|
||||
#define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND
|
||||
#define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO
|
||||
#define I2C1_OPMODE OPMODE_I2C
|
||||
#define I2C1_CLOCK_SPEED 400000 /* 400000 */
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
"caps_lock": "A15"
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "ckled2001",
|
||||
"driver": "snled27351",
|
||||
"max_brightness": 160,
|
||||
"animations": {
|
||||
"breathing": true,
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "quantum.h"
|
||||
// clang-format off
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
* | R location
|
||||
|
@ -341,10 +341,7 @@ void housekeeping_task_kb(void)
|
||||
}
|
||||
}
|
||||
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
#ifdef IS31FL3731_I2C_ADDRESS_2
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
#endif
|
||||
is31fl3731_flush();
|
||||
|
||||
housekeeping_task_user();
|
||||
}
|
||||
|
@ -343,10 +343,7 @@ void housekeeping_task_kb(void)
|
||||
}
|
||||
}
|
||||
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
#ifdef IS31FL3731_I2C_ADDRESS_2
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
#endif
|
||||
is31fl3731_flush();
|
||||
|
||||
housekeeping_task_user();
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 128
|
||||
|
||||
|
@ -50,6 +50,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 128
|
||||
|
||||
|
@ -73,6 +73,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_DRIVER_COUNT 1
|
||||
#define RGB_MATRIX_LED_COUNT 16
|
||||
|
||||
|
@ -56,6 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
|
||||
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
|
||||
|
||||
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
|
||||
#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA
|
||||
#define IS31FL3733_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 128
|
||||
|
||||
|
@ -48,6 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#else
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 67
|
||||
|
||||
|
@ -79,6 +79,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define DRIVER_INDICATOR_LED_TOTAL 0
|
||||
#else
|
||||
// WT_RGB IS31FL3741 driver code
|
||||
# define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
|
||||
# define IS31FL3741_DRIVER_COUNT 1
|
||||
# define RGB_MATRIX_LED_COUNT 98
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_DRIVER_COUNT 1
|
||||
#define RGB_MATRIX_LED_COUNT 12
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -38,6 +38,9 @@
|
||||
//#define NO_ACTION_ONESHOT
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_I2C_ADDRESS_3 IS31FL3731_I2C_ADDRESS_SCL
|
||||
#define IS31FL3731_DRIVER_COUNT 3
|
||||
#define RGB_MATRIX_LED_COUNT 108
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -469,7 +469,7 @@ void backlight_config_save(void)
|
||||
|
||||
void backlight_update_pwm_buffers(void)
|
||||
{
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
|
||||
is31fl3736_flush();
|
||||
}
|
||||
|
||||
bool process_record_backlight(uint16_t keycode, keyrecord_t *record)
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 72
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
#pragma once
|
||||
|
||||
// IS31FL3731 driver
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
|
||||
#define IS31FL3731_DRIVER_COUNT 2
|
||||
#define RGB_MATRIX_LED_COUNT 64
|
||||
|
||||
|
@ -226,13 +226,9 @@ static void init(void) {
|
||||
is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
}
|
||||
|
||||
static void flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3741_flush,
|
||||
.set_color = is31fl3741_set_color,
|
||||
.set_color_all = is31fl3741_set_color_all
|
||||
};
|
||||
|
@ -232,13 +232,9 @@ static void init(void) {
|
||||
is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
}
|
||||
|
||||
static void flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3741_flush,
|
||||
.set_color = is31fl3741_set_color,
|
||||
.set_color_all = is31fl3741_set_color_all
|
||||
};
|
||||
|
@ -249,159 +249,64 @@ static void init(void) {
|
||||
}
|
||||
|
||||
# if defined(LED_MATRIX_IS31FL3218)
|
||||
static void flush(void) {
|
||||
is31fl3218_update_pwm_buffers();
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3218_update_pwm_buffers,
|
||||
.set_value = is31fl3218_set_value,
|
||||
.set_value_all = is31fl3218_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(LED_MATRIX_IS31FL3731)
|
||||
static void flush(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_2)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_3)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_4)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3731_flush,
|
||||
.set_value = is31fl3731_set_value,
|
||||
.set_value_all = is31fl3731_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(LED_MATRIX_IS31FL3733)
|
||||
static void flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_2)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_3)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_4)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3733_flush,
|
||||
.set_value = is31fl3733_set_value,
|
||||
.set_value_all = is31fl3733_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(LED_MATRIX_IS31FL3736)
|
||||
static void flush(void) {
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_2)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_3)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_4)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3736_flush,
|
||||
.set_value = is31fl3736_set_value,
|
||||
.set_value_all = is31fl3736_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(LED_MATRIX_IS31FL3737)
|
||||
static void flush(void) {
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_2)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_3)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_4)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3737_flush,
|
||||
.set_value = is31fl3737_set_value,
|
||||
.set_value_all = is31fl3737_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(LED_MATRIX_IS31FL3741)
|
||||
static void flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_2)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_3)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_4)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3741_flush,
|
||||
.set_value = is31fl3741_set_value,
|
||||
.set_value_all = is31fl3741_set_value_all,
|
||||
};
|
||||
|
||||
# elif defined(IS31FLCOMMON)
|
||||
static void flush(void) {
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0);
|
||||
# if defined(LED_DRIVER_ADDR_2)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1);
|
||||
# if defined(LED_DRIVER_ADDR_3)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2);
|
||||
# if defined(LED_DRIVER_ADDR_4)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = IS31FL_common_flush,
|
||||
.set_value = IS31FL_simple_set_brightness,
|
||||
.set_value_all = IS31FL_simple_set_brigntness_all,
|
||||
};
|
||||
# elif defined(LED_MATRIX_SNLED27351)
|
||||
static void flush(void) {
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_2)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_3)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_4)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const led_matrix_driver_t led_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = snled27351_flush,
|
||||
.set_value = snled27351_set_value,
|
||||
.set_value_all = snled27351_set_value_all,
|
||||
};
|
||||
|
@ -247,160 +247,65 @@ static void init(void) {
|
||||
}
|
||||
|
||||
# if defined(RGB_MATRIX_IS31FL3218)
|
||||
static void flush(void) {
|
||||
is31fl3218_update_pwm_buffers();
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3218_update_pwm_buffers,
|
||||
.set_color = is31fl3218_set_color,
|
||||
.set_color_all = is31fl3218_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_IS31FL3731)
|
||||
static void flush(void) {
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_2)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_3)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3731_I2C_ADDRESS_4)
|
||||
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3731_flush,
|
||||
.set_color = is31fl3731_set_color,
|
||||
.set_color_all = is31fl3731_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_IS31FL3733)
|
||||
static void flush(void) {
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_2)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_3)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3733_I2C_ADDRESS_4)
|
||||
is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3733_flush,
|
||||
.set_color = is31fl3733_set_color,
|
||||
.set_color_all = is31fl3733_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_IS31FL3736)
|
||||
static void flush(void) {
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_2)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_3)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3736_I2C_ADDRESS_4)
|
||||
is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3736_flush,
|
||||
.set_color = is31fl3736_set_color,
|
||||
.set_color_all = is31fl3736_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_IS31FL3737)
|
||||
static void flush(void) {
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_2)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_3)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3737_I2C_ADDRESS_4)
|
||||
is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3737_flush,
|
||||
.set_color = is31fl3737_set_color,
|
||||
.set_color_all = is31fl3737_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_IS31FL3741)
|
||||
static void flush(void) {
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_2)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_3)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2);
|
||||
# if defined(IS31FL3741_I2C_ADDRESS_4)
|
||||
is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = is31fl3741_flush,
|
||||
.set_color = is31fl3741_set_color,
|
||||
.set_color_all = is31fl3741_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(IS31FLCOMMON)
|
||||
static void flush(void) {
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0);
|
||||
# if defined(DRIVER_ADDR_2)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1);
|
||||
# if defined(DRIVER_ADDR_3)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2);
|
||||
# if defined(DRIVER_ADDR_4)
|
||||
IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = IS31FL_common_flush,
|
||||
.set_color = IS31FL_RGB_set_color,
|
||||
.set_color_all = IS31FL_RGB_set_color_all,
|
||||
};
|
||||
|
||||
# elif defined(RGB_MATRIX_SNLED27351)
|
||||
static void flush(void) {
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_2)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_3)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2);
|
||||
# if defined(SNLED27351_I2C_ADDRESS_4)
|
||||
snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = snled27351_flush,
|
||||
.set_color = snled27351_set_color,
|
||||
.set_color_all = snled27351_set_color_all,
|
||||
};
|
||||
@ -418,16 +323,9 @@ static void init(void) {
|
||||
# endif
|
||||
}
|
||||
|
||||
static void flush(void) {
|
||||
aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0);
|
||||
# if defined(AW20216S_CS_PIN_2)
|
||||
aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1);
|
||||
# endif
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.flush = aw20216s_flush,
|
||||
.set_color = aw20216s_set_color,
|
||||
.set_color_all = aw20216s_set_color_all,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user