Add _flush() functions to LED drivers (#22308)

This commit is contained in:
Ryan 2023-10-23 03:32:27 +10:00 committed by GitHub
parent 1e9b299fb0
commit cf7d3435d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 346 additions and 319 deletions

View File

@ -166,3 +166,10 @@ void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index) {
} }
g_pwm_buffer_update_required[index] = false; 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
}

View File

@ -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_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_update_pwm_buffers(pin_t cs_pin, uint8_t index);
void aw20216s_flush(void);
#define CS1_SW1 0x00 #define CS1_SW1 0x00
#define CS2_SW1 0x01 #define CS2_SW1 0x01
#define CS3_SW1 0x02 #define CS3_SW1 0x02

View File

@ -211,3 +211,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3731_update_led_control_registers(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_1 0x24
#define C1_2 0x25 #define C1_2 0x25
#define C1_3 0x26 #define C1_3 0x26

View File

@ -223,3 +223,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) {
} }
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3731_update_led_control_registers(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_1 0x24
#define C1_2 0x25 #define C1_2 0x25
#define C1_3 0x26 #define C1_3 0x26

View File

@ -233,3 +233,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3733_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #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 #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time

View File

@ -248,3 +248,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3733_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #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 #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time

View File

@ -220,3 +220,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3736_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor
#define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor #define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor

View File

@ -237,3 +237,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3736_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor
#define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor #define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor

View File

@ -217,3 +217,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3737_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL #define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL
#define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL #define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL

View File

@ -233,3 +233,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3737_update_led_control_registers(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_0R 0x00 // No PUR resistor
#define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL #define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL
#define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL #define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL

View File

@ -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; 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
}

View File

@ -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_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_0R 0x00 // No PUR resistor
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor
#define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor #define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor

View File

@ -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; 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
}

View File

@ -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_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_0R 0x00 // No PUR resistor
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor
#define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor #define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor

View File

@ -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 #ifdef RGB_MATRIX_ENABLE
// Colour is set by adjusting PWM register // Colour is set by adjusting PWM register
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {

View File

@ -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_pwm_register(uint8_t addr, uint8_t index);
void IS31FL_common_update_scaling_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 #ifdef RGB_MATRIX_ENABLE
// RGB Matrix Specific scripts // RGB Matrix Specific scripts
void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);

View File

@ -203,6 +203,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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) { void snled27351_sw_return_normal(uint8_t addr) {
// Select to function page // Select to function page
snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE); snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE);

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void snled27351_update_led_control_registers(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_return_normal(uint8_t addr);
void snled27351_sw_shutdown(uint8_t addr); void snled27351_sw_shutdown(uint8_t addr);

View File

@ -218,6 +218,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) {
g_led_control_registers_update_required[index] = false; 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) { void snled27351_sw_return_normal(uint8_t addr) {
// Select to function page // Select to function page
snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE); snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE);

View File

@ -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_pwm_buffers(uint8_t addr, uint8_t index);
void snled27351_update_led_control_registers(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_return_normal(uint8_t addr);
void snled27351_sw_shutdown(uint8_t addr); void snled27351_sw_shutdown(uint8_t addr);

View File

@ -145,8 +145,10 @@ led_config_t g_led_config = { {
// Custom Driver // Custom Driver
static void init(void) { static void init(void) {
i2c_init(); i2c_init();
is31fl3731_init(IS31FL3731_I2C_ADDRESS_1); is31fl3731_init(IS31FL3731_I2C_ADDRESS_1);
is31fl3731_init(IS31FL3731_I2C_ADDRESS_2); is31fl3731_init(IS31FL3731_I2C_ADDRESS_2);
for (int index = 0; index < ISSI_DRIVER_TOTAL; index++) { for (int index = 0; index < ISSI_DRIVER_TOTAL; index++) {
bool enabled = !( ( index == 18+5) || //B5 bool enabled = !( ( index == 18+5) || //B5
( index == 36+17) || //C17 ( index == 36+17) || //C17
@ -154,29 +156,16 @@ static void init(void) {
); );
is31fl3731_set_led_control_register(index, enabled, enabled, enabled); 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_1, 0);
is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_2, 1); 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3731_flush,
.set_color = set_color, .set_color = is31fl3731_set_color,
.set_color_all = set_color_all .set_color_all = is31fl3731_set_color_all
}; };
#endif #endif

View File

@ -36,7 +36,7 @@ void init_fallacy_leds(void) {
/* update the buffer /* update the buffer
*/ */
void update_fallacy_leds(void) { void update_fallacy_leds(void) {
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); is31fl3731_flush();
} }

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 #define RGB_MATRIX_LED_COUNT 64
// These define which keys in the matrix are alphas/mods // These define which keys in the matrix are alphas/mods

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 #define RGB_MATRIX_LED_COUNT 64
// These define which keys in the matrix are alphas/mods // These define which keys in the matrix are alphas/mods

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 #define RGB_MATRIX_LED_COUNT 64
// These define which keys in the matrix are alphas/mods // These define which keys in the matrix are alphas/mods

View File

@ -9,9 +9,9 @@
{ C11 } { C11 }
/* I2C Config for LED Driver */ /* I2C Config for LED Driver */
#define DRIVER_COUNT 2 #define SNLED27351_DRIVER_COUNT 2
#define DRIVER_ADDR_1 0b1110100 #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND
#define DRIVER_ADDR_2 0b1110111 #define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO
#define I2C1_SDA_PIN B7 #define I2C1_SDA_PIN B7
#define I2C1_SCL_PIN B6 #define I2C1_SCL_PIN B6
#define I2C1_SCL_PAL_MODE 4 #define I2C1_SCL_PAL_MODE 4

View File

@ -33,7 +33,7 @@
] ]
}, },
"rgb_matrix": { "rgb_matrix": {
"driver": "ckled2001", "driver": "snled27351",
"max_brightness": 180, "max_brightness": 180,
"animations": { "animations": {
"solid_color": true, "solid_color": true,

View File

@ -5,7 +5,7 @@
// clang-format off // clang-format off
#ifdef RGB_MATRIX_ENABLE #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 /* Refer to IS31 manual for these locations
* driver * driver
* | R location * | R location

View File

@ -248,3 +248,10 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) {
} }
g_led_control_registers_update_required[index] = false; 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
}

View File

@ -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_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_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_0R 0x00 // No PUR resistor
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #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 #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time

View File

@ -38,16 +38,9 @@ static void init(void) {
# endif # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3733_flush,
.set_color = is31fl3733_set_color, .set_color = is31fl3733_set_color,
.set_color_all = is31fl3733_set_color_all, .set_color_all = is31fl3733_set_color_all,
}; };

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 IS31FL3733_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 128 #define RGB_MATRIX_LED_COUNT 128

View File

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "drivers/issi/is31fl3733.h" #include "drivers/led/issi/is31fl3733.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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; static uint16_t ledTimer;
uint8_t R = 0; /* First led*/ uint8_t r = 0; /* First led*/
uint8_t G = 0; /* Second led*/ uint8_t g = 0; /* Second led*/
uint8_t B = 0; /* Third led*/ uint8_t b = 0; /* Third led*/
/* Boot animation parameters */ /* Boot animation parameters */
@ -74,44 +74,44 @@ bool bootAnimation(void){
if (bootFirst>0 || bootSec>0){ if (bootFirst>0 || bootSec>0){
if(bootFirst!=0){ if(bootFirst!=0){
if (timer_elapsed(ledTimer) > 150){ if (timer_elapsed(ledTimer) > 150){
G = 255; g = 255;
R = 0; r = 0;
B = 0; b = 0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
} }
if (timer_elapsed(ledTimer) > 300){ if (timer_elapsed(ledTimer) > 300){
G = 255; g = 255;
R = 255; r = 255;
B = 0; b = 0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
} }
if (timer_elapsed(ledTimer) > 400){ if (timer_elapsed(ledTimer) > 400){
G = 255; g = 255;
R = 255; r = 255;
B = 255; b = 255;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
} }
if (timer_elapsed(ledTimer) > 500){ if (timer_elapsed(ledTimer) > 500){
G = 0; g = 0;
R = 0; r = 0;
B = 0; b = 0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
ledTimer = timer_read(); ledTimer = timer_read();
bootFirst--; bootFirst--;
} }
} }
if (bootFirst==0 && bootSec!=0){ if (bootFirst==0 && bootSec!=0){
if (timer_elapsed(ledTimer) > 200) { if (timer_elapsed(ledTimer) > 200) {
G = 255; g = 255;
R = 255; r = 255;
B = 255; b = 255;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
} }
if (timer_elapsed(ledTimer) > 400){ if (timer_elapsed(ledTimer) > 400){
G = 0; g = 0;
R = 0; r = 0;
B = 0; b = 0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
ledTimer = timer_read(); ledTimer = timer_read();
bootSec--; bootSec--;
} }
@ -125,29 +125,29 @@ bool bootAnimation(void){
void breathing(void) { void breathing(void) {
if(timer_elapsed(ledTimer)<travelTime){ if(timer_elapsed(ledTimer)<travelTime){
time = timer_elapsed(ledTimer); time = timer_elapsed(ledTimer);
if((time - previousTime) > fadeTime && R<maxBrightness){ if((time - previousTime) > fadeTime && r<maxBrightness){
G+=fadeStep; g+=fadeStep;
R+=fadeStep; r+=fadeStep;
B+=fadeStep; b+=fadeStep;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
previousTime = time; previousTime = time;
} }
} }
else if(timer_elapsed(ledTimer)<(travelTime * 2)){ else if(timer_elapsed(ledTimer)<(travelTime * 2)){
time = timer_elapsed(ledTimer); time = timer_elapsed(ledTimer);
if((time - previousTime) > fadeTime && R>minBrightness){ if((time - previousTime) > fadeTime && r>minBrightness){
G-=fadeStep; g-=fadeStep;
R-=fadeStep; r-=fadeStep;
B-=fadeStep; b-=fadeStep;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
previousTime = time; previousTime = time;
} }
} }
else { else {
R=0; r=0;
G=0; g=0;
B=0; b=0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
previousTime = 0; previousTime = 0;
time = 0; time = 0;
ledTimer=timer_read(); ledTimer=timer_read();
@ -166,10 +166,10 @@ void matrix_scan_user(void){
prevCapsState = capsState; prevCapsState = capsState;
} }
else if(!capsState && capsState != prevCapsState){ else if(!capsState && capsState != prevCapsState){
G = 0; g = 0;
R = 0; r = 0;
B = 0; b = 0;
is31fl3733_set_color( 6+64-1, R, G, B ); is31fl3733_set_color( 6+64-1, r, g, b );
prevCapsState = capsState; prevCapsState = capsState;
} }
} }

View File

@ -396,7 +396,7 @@ void rgb_ring_task(void)
break; break;
}; };
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); is31fl3731_flush();
} }
bool process_record_kb(uint16_t keycode, keyrecord_t *record) bool process_record_kb(uint16_t keycode, keyrecord_t *record)

View File

@ -36,9 +36,9 @@
#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) #define WEAR_LEVELING_BACKING_SIZE (8 * 1024)
/* I2C Config for LED Driver */ /* I2C Config for LED Driver */
#define DRIVER_COUNT 2 #define SNLED27351_DRIVER_COUNT 2
#define DRIVER_ADDR_1 0b1110100 #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND
#define DRIVER_ADDR_2 0b1110111 #define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO
#define I2C1_OPMODE OPMODE_I2C #define I2C1_OPMODE OPMODE_I2C
#define I2C1_CLOCK_SPEED 400000 /* 400000 */ #define I2C1_CLOCK_SPEED 400000 /* 400000 */

View File

@ -31,7 +31,7 @@
"caps_lock": "A15" "caps_lock": "A15"
}, },
"rgb_matrix": { "rgb_matrix": {
"driver": "ckled2001", "driver": "snled27351",
"max_brightness": 160, "max_brightness": 160,
"animations": { "animations": {
"breathing": true, "breathing": true,

View File

@ -17,7 +17,7 @@
#include "quantum.h" #include "quantum.h"
// clang-format off // clang-format off
#ifdef RGB_MATRIX_ENABLE #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 /* Refer to IS31 manual for these locations
* driver * driver
* | R location * | R location

View File

@ -341,10 +341,7 @@ void housekeeping_task_kb(void)
} }
} }
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); is31fl3731_flush();
#ifdef IS31FL3731_I2C_ADDRESS_2
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
#endif
housekeeping_task_user(); housekeeping_task_user();
} }

View File

@ -343,10 +343,7 @@ void housekeeping_task_kb(void)
} }
} }
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); is31fl3731_flush();
#ifdef IS31FL3731_I2C_ADDRESS_2
is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1);
#endif
housekeeping_task_user(); housekeeping_task_user();
} }

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 IS31FL3733_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 128 #define RGB_MATRIX_LED_COUNT 128

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 IS31FL3733_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 128 #define RGB_MATRIX_LED_COUNT 128

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 IS31FL3731_DRIVER_COUNT 1
#define RGB_MATRIX_LED_COUNT 16 #define RGB_MATRIX_LED_COUNT 16

View File

@ -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_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .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 IS31FL3733_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 128 #define RGB_MATRIX_LED_COUNT 128

View File

@ -48,6 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#else #else
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 67 #define RGB_MATRIX_LED_COUNT 67

View File

@ -79,6 +79,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define DRIVER_INDICATOR_LED_TOTAL 0 # define DRIVER_INDICATOR_LED_TOTAL 0
#else #else
// WT_RGB IS31FL3741 driver code // WT_RGB IS31FL3741 driver code
# define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND
# define IS31FL3741_DRIVER_COUNT 1 # define IS31FL3741_DRIVER_COUNT 1
# define RGB_MATRIX_LED_COUNT 98 # define RGB_MATRIX_LED_COUNT 98

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -21,6 +21,7 @@
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
// IS31FL3731 driver // IS31FL3731 driver
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_DRIVER_COUNT 1 #define IS31FL3731_DRIVER_COUNT 1
#define RGB_MATRIX_LED_COUNT 12 #define RGB_MATRIX_LED_COUNT 12

View File

@ -21,6 +21,8 @@
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -21,6 +21,8 @@
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -21,6 +21,8 @@
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -38,6 +38,9 @@
//#define NO_ACTION_ONESHOT //#define NO_ACTION_ONESHOT
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 3
#define RGB_MATRIX_LED_COUNT 108 #define RGB_MATRIX_LED_COUNT 108

View File

@ -23,6 +23,8 @@
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -23,6 +23,8 @@
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -23,6 +23,8 @@
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -469,7 +469,7 @@ void backlight_config_save(void)
void backlight_update_pwm_buffers(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) bool process_record_backlight(uint16_t keycode, keyrecord_t *record)

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 72 #define RGB_MATRIX_LED_COUNT 72

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
// IS31FL3731 driver // 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 IS31FL3731_DRIVER_COUNT 2
#define RGB_MATRIX_LED_COUNT 64 #define RGB_MATRIX_LED_COUNT 64

View File

@ -226,13 +226,9 @@ static void init(void) {
is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0); 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3741_flush,
.set_color = is31fl3741_set_color, .set_color = is31fl3741_set_color,
.set_color_all = is31fl3741_set_color_all .set_color_all = is31fl3741_set_color_all
}; };

View File

@ -232,13 +232,9 @@ static void init(void) {
is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0); 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3741_flush,
.set_color = is31fl3741_set_color, .set_color = is31fl3741_set_color,
.set_color_all = is31fl3741_set_color_all .set_color_all = is31fl3741_set_color_all
}; };

View File

@ -249,159 +249,64 @@ static void init(void) {
} }
# if defined(LED_MATRIX_IS31FL3218) # if defined(LED_MATRIX_IS31FL3218)
static void flush(void) {
is31fl3218_update_pwm_buffers();
}
const led_matrix_driver_t led_matrix_driver = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3218_update_pwm_buffers,
.set_value = is31fl3218_set_value, .set_value = is31fl3218_set_value,
.set_value_all = is31fl3218_set_value_all, .set_value_all = is31fl3218_set_value_all,
}; };
# elif defined(LED_MATRIX_IS31FL3731) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3731_flush,
.set_value = is31fl3731_set_value, .set_value = is31fl3731_set_value,
.set_value_all = is31fl3731_set_value_all, .set_value_all = is31fl3731_set_value_all,
}; };
# elif defined(LED_MATRIX_IS31FL3733) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3733_flush,
.set_value = is31fl3733_set_value, .set_value = is31fl3733_set_value,
.set_value_all = is31fl3733_set_value_all, .set_value_all = is31fl3733_set_value_all,
}; };
# elif defined(LED_MATRIX_IS31FL3736) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3736_flush,
.set_value = is31fl3736_set_value, .set_value = is31fl3736_set_value,
.set_value_all = is31fl3736_set_value_all, .set_value_all = is31fl3736_set_value_all,
}; };
# elif defined(LED_MATRIX_IS31FL3737) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3737_flush,
.set_value = is31fl3737_set_value, .set_value = is31fl3737_set_value,
.set_value_all = is31fl3737_set_value_all, .set_value_all = is31fl3737_set_value_all,
}; };
# elif defined(LED_MATRIX_IS31FL3741) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3741_flush,
.set_value = is31fl3741_set_value, .set_value = is31fl3741_set_value,
.set_value_all = is31fl3741_set_value_all, .set_value_all = is31fl3741_set_value_all,
}; };
# elif defined(IS31FLCOMMON) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = IS31FL_common_flush,
.set_value = IS31FL_simple_set_brightness, .set_value = IS31FL_simple_set_brightness,
.set_value_all = IS31FL_simple_set_brigntness_all, .set_value_all = IS31FL_simple_set_brigntness_all,
}; };
# elif defined(LED_MATRIX_SNLED27351) # 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 = { const led_matrix_driver_t led_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = snled27351_flush,
.set_value = snled27351_set_value, .set_value = snled27351_set_value,
.set_value_all = snled27351_set_value_all, .set_value_all = snled27351_set_value_all,
}; };

View File

@ -247,160 +247,65 @@ static void init(void) {
} }
# if defined(RGB_MATRIX_IS31FL3218) # if defined(RGB_MATRIX_IS31FL3218)
static void flush(void) {
is31fl3218_update_pwm_buffers();
}
const rgb_matrix_driver_t rgb_matrix_driver = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3218_update_pwm_buffers,
.set_color = is31fl3218_set_color, .set_color = is31fl3218_set_color,
.set_color_all = is31fl3218_set_color_all, .set_color_all = is31fl3218_set_color_all,
}; };
# elif defined(RGB_MATRIX_IS31FL3731) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3731_flush,
.set_color = is31fl3731_set_color, .set_color = is31fl3731_set_color,
.set_color_all = is31fl3731_set_color_all, .set_color_all = is31fl3731_set_color_all,
}; };
# elif defined(RGB_MATRIX_IS31FL3733) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3733_flush,
.set_color = is31fl3733_set_color, .set_color = is31fl3733_set_color,
.set_color_all = is31fl3733_set_color_all, .set_color_all = is31fl3733_set_color_all,
}; };
# elif defined(RGB_MATRIX_IS31FL3736) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3736_flush,
.set_color = is31fl3736_set_color, .set_color = is31fl3736_set_color,
.set_color_all = is31fl3736_set_color_all, .set_color_all = is31fl3736_set_color_all,
}; };
# elif defined(RGB_MATRIX_IS31FL3737) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3737_flush,
.set_color = is31fl3737_set_color, .set_color = is31fl3737_set_color,
.set_color_all = is31fl3737_set_color_all, .set_color_all = is31fl3737_set_color_all,
}; };
# elif defined(RGB_MATRIX_IS31FL3741) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = is31fl3741_flush,
.set_color = is31fl3741_set_color, .set_color = is31fl3741_set_color,
.set_color_all = is31fl3741_set_color_all, .set_color_all = is31fl3741_set_color_all,
}; };
# elif defined(IS31FLCOMMON) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = IS31FL_common_flush,
.set_color = IS31FL_RGB_set_color, .set_color = IS31FL_RGB_set_color,
.set_color_all = IS31FL_RGB_set_color_all, .set_color_all = IS31FL_RGB_set_color_all,
}; };
# elif defined(RGB_MATRIX_SNLED27351) # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = snled27351_flush,
.set_color = snled27351_set_color, .set_color = snled27351_set_color,
.set_color_all = snled27351_set_color_all, .set_color_all = snled27351_set_color_all,
}; };
@ -418,16 +323,9 @@ static void init(void) {
# endif # 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 = { const rgb_matrix_driver_t rgb_matrix_driver = {
.init = init, .init = init,
.flush = flush, .flush = aw20216s_flush,
.set_color = aw20216s_set_color, .set_color = aw20216s_set_color,
.set_color_all = aw20216s_set_color_all, .set_color_all = aw20216s_set_color_all,
}; };