forked from mirrors/qmk_userspace
LED drivers: add defines for PWM and LED control register counts (#22383)
This commit is contained in:
parent
0a94c2951f
commit
a27bc60703
15 changed files with 130 additions and 91 deletions
|
@ -40,6 +40,8 @@
|
|||
#define IS31FL3741_REG_PWM_FREQUENCY 0x36 // PG4
|
||||
#define IS31FL3741_REG_RESET 0x3F // PG4
|
||||
|
||||
#define IS31FL3741_PWM_REGISTER_COUNT 351
|
||||
|
||||
#ifndef IS31FL3741_I2C_TIMEOUT
|
||||
# define IS31FL3741_I2C_TIMEOUT 100
|
||||
#endif
|
||||
|
@ -68,8 +70,6 @@
|
|||
# define IS31FL3741_GLOBALCURRENT 0xFF
|
||||
#endif
|
||||
|
||||
#define IS31FL3741_MAX_LEDS 351
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20] = {0xFF};
|
||||
|
||||
|
@ -79,11 +79,11 @@ uint8_t g_twi_transfer_buffer[20] = {0xFF};
|
|||
// We could optimize this and take out the unused registers from these
|
||||
// buffers and the transfers in is31fl3741_write_pwm_buffer() but it's
|
||||
// probably not worth the extra complexity.
|
||||
uint8_t g_pwm_buffer[IS31FL3741_DRIVER_COUNT][IS31FL3741_MAX_LEDS];
|
||||
uint8_t g_pwm_buffer[IS31FL3741_DRIVER_COUNT][IS31FL3741_PWM_REGISTER_COUNT];
|
||||
bool g_pwm_buffer_update_required[IS31FL3741_DRIVER_COUNT] = {false};
|
||||
bool g_scaling_registers_update_required[IS31FL3741_DRIVER_COUNT] = {false};
|
||||
|
||||
uint8_t g_scaling_registers[IS31FL3741_DRIVER_COUNT][IS31FL3741_MAX_LEDS];
|
||||
uint8_t g_scaling_registers[IS31FL3741_DRIVER_COUNT][IS31FL3741_PWM_REGISTER_COUNT];
|
||||
|
||||
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue