Update ISSI LED types (#22099)

This commit is contained in:
Ryan 2023-10-04 20:12:50 +11:00 committed by GitHub
parent c0f16be50f
commit d99dbe4d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
148 changed files with 262 additions and 239 deletions

View File

@ -51,12 +51,12 @@ Here is an example using 2 drivers.
!> Note the parentheses, this is so when `LED_MATRIX_LED_COUNT` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`.
For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`.
For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31fl3731_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31fl3731_leds`.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address

View File

@ -52,12 +52,12 @@ Here is an example using 2 drivers.
!> Note the parentheses, this is so when `RGB_MATRIX_LED_COUNT` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
For split keyboards using `RGB_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`.
For split keyboards using `RGB_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31fl3731_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31fl3731_leds`.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -143,7 +143,7 @@ Currently only 4 drivers are supported, but it would be trivial to support all 8
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -224,7 +224,7 @@ Here is an example using 2 drivers.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3736_led_t PROGMEM g_is31fl3736_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -300,7 +300,7 @@ Here is an example using 2 drivers.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -160,9 +160,9 @@ void is31fl3731_init(uint8_t addr) {
}
void is31fl3731_set_value(int index, uint8_t value) {
is31_led led;
is31fl3731_led_t led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led));
// Subtract 0x24 to get the second index of g_pwm_buffer
@ -181,8 +181,8 @@ void is31fl3731_set_value_all(uint8_t value) {
}
void is31fl3731_set_led_control_register(uint8_t index, bool value) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3731_led_t led;
memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led));
uint8_t control_register = (led.v - 0x24) / 8;
uint8_t bit_value = (led.v - 0x24) % 8;

View File

@ -35,6 +35,9 @@
#ifdef ISSI_3731_DEGHOST
# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST
#endif
#define is31_led is31fl3731_led_t
#define g_is31_leds g_is31fl3731_leds
// ========
#define IS31FL3731_I2C_ADDRESS_GND 0x74
@ -42,12 +45,12 @@
#define IS31FL3731_I2C_ADDRESS_SDA 0x76
#define IS31FL3731_I2C_ADDRESS_VCC 0x77
typedef struct is31_led {
typedef struct is31fl3731_led_t {
uint8_t driver : 2;
uint8_t v;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3731_led_t;
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT];
void is31fl3731_init(uint8_t addr);
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -157,9 +157,9 @@ void is31fl3731_init(uint8_t addr) {
}
void is31fl3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3731_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led));
// Subtract 0x24 to get the second index of g_pwm_buffer
if (g_pwm_buffer[led.driver][led.r - 0x24] == red && g_pwm_buffer[led.driver][led.g - 0x24] == green && g_pwm_buffer[led.driver][led.b - 0x24] == blue) {
@ -179,8 +179,8 @@ void is31fl3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3731_led_t led;
memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led));
uint8_t control_register_r = (led.r - 0x24) / 8;
uint8_t control_register_g = (led.g - 0x24) / 8;

View File

@ -34,6 +34,9 @@
#ifdef ISSI_3731_DEGHOST
# define IS31FL3731_DEGHOST ISSI_3731_DEGHOST
#endif
#define is31_led is31fl3731_led_t
#define g_is31_leds g_is31fl3731_leds
// ========
#define IS31FL3731_I2C_ADDRESS_GND 0x74
@ -41,14 +44,14 @@
#define IS31FL3731_I2C_ADDRESS_SDA 0x76
#define IS31FL3731_I2C_ADDRESS_VCC 0x77
typedef struct is31_led {
typedef struct is31fl3731_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3731_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT];
void is31fl3731_init(uint8_t addr);
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -173,9 +173,9 @@ void is31fl3733_init(uint8_t addr, uint8_t sync) {
}
void is31fl3733_set_value(int index, uint8_t value) {
is31_led led;
is31fl3733_led_t led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
@ -192,8 +192,8 @@ void is31fl3733_set_value_all(uint8_t value) {
}
void is31fl3733_set_led_control_register(uint8_t index, bool value) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3733_led_t led;
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
uint8_t control_register = led.v / 8;
uint8_t bit_value = led.v % 8;

View File

@ -47,6 +47,9 @@
# define IS31FL3733_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3733_led_t
#define g_is31_leds g_is31fl3733_leds
#define PUR_0R IS31FL3733_PUR_0R
#define PUR_05KR IS31FL3733_PUR_05KR
#define PUR_3KR IS31FL3733_PUR_3KR
@ -73,12 +76,12 @@
#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E
#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3733_led_t {
uint8_t driver : 2;
uint8_t v;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3733_led_t;
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[LED_MATRIX_LED_COUNT];
void is31fl3733_init(uint8_t addr, uint8_t sync);
bool is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -172,9 +172,9 @@ void is31fl3733_init(uint8_t addr, uint8_t sync) {
}
void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3733_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
@ -193,8 +193,8 @@ void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3733_led_t led;
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
uint8_t control_register_r = led.r / 8;
uint8_t control_register_g = led.g / 8;

View File

@ -46,6 +46,9 @@
# define IS31FL3733_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3733_led_t
#define g_is31_leds g_is31fl3733_leds
#define PUR_0R IS31FL3733_PUR_0R
#define PUR_05KR IS31FL3733_PUR_05KR
#define PUR_3KR IS31FL3733_PUR_3KR
@ -72,14 +75,14 @@
#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E
#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3733_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3733_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT];
void is31fl3733_init(uint8_t addr, uint8_t sync);
bool is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -158,9 +158,9 @@ void is31fl3736_init(uint8_t addr) {
}
void is31fl3736_set_value(int index, uint8_t value) {
is31_led led;
is31fl3736_led_t led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
@ -177,8 +177,8 @@ void is31fl3736_set_value_all(uint8_t value) {
}
void is31fl3736_set_led_control_register(uint8_t index, bool value) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3736_led_t led;
memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led));
// The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so:
// A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E

View File

@ -41,6 +41,9 @@
# define IS31FL3736_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3736_led_t
#define g_is31_leds g_is31fl3736_leds
#define PUR_0R IS31FL3736_PUR_0R
#define PUR_05KR IS31FL3736_PUR_05KR
#define PUR_1KR IS31FL3736_PUR_1KR
@ -68,12 +71,12 @@
#define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E
#define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3736_led_t {
uint8_t driver : 2;
uint8_t v;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3736_led_t;
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[LED_MATRIX_LED_COUNT];
void is31fl3736_init(uint8_t addr);
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -158,9 +158,9 @@ void is31fl3736_init(uint8_t addr) {
}
void is31fl3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3736_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
@ -179,8 +179,8 @@ void is31fl3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3736_led_t led;
memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led));
// The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so:
// A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E

View File

@ -41,6 +41,9 @@
# define IS31FL3736_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3736_led_t
#define g_is31_leds g_is31fl3736_leds
#define PUR_0R IS31FL3736_PUR_0R
#define PUR_05KR IS31FL3736_PUR_05KR
#define PUR_1KR IS31FL3736_PUR_1KR
@ -68,14 +71,14 @@
#define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E
#define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3736_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3736_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[RGB_MATRIX_LED_COUNT];
void is31fl3736_init(uint8_t addr);
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -161,9 +161,9 @@ void is31fl3737_init(uint8_t addr) {
}
void is31fl3737_set_value(int index, uint8_t value) {
is31_led led;
is31fl3737_led_t led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
@ -180,8 +180,8 @@ void is31fl3737_set_value_all(uint8_t value) {
}
void is31fl3737_set_led_control_register(uint8_t index, bool value) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3737_led_t led;
memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led));
uint8_t control_register = led.v / 8;
uint8_t bit_value = led.v % 8;

View File

@ -61,12 +61,12 @@
#define IS31FL3737_I2C_ADDRESS_SDA 0x5A
#define IS31FL3737_I2C_ADDRESS_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3737_led_t {
uint8_t driver : 2;
uint8_t v;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3737_led_t;
extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT];
extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[LED_MATRIX_LED_COUNT];
void is31fl3737_init(uint8_t addr);
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -161,9 +161,9 @@ void is31fl3737_init(uint8_t addr) {
}
void is31fl3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3737_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
@ -182,8 +182,8 @@ void is31fl3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3737_led_t led;
memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led));
uint8_t control_register_r = led.r / 8;
uint8_t control_register_g = led.g / 8;

View File

@ -46,6 +46,9 @@
# define IS31FL3737_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3737_led_t
#define g_is31_leds g_is31fl3737_leds
#define PUR_0R IS31FL3737_PUR_0R
#define PUR_05KR IS31FL3737_PUR_05KR
#define PUR_1KR IS31FL3737_PUR_1KR
@ -61,14 +64,14 @@
#define IS31FL3737_I2C_ADDRESS_SDA 0x5A
#define IS31FL3737_I2C_ADDRESS_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3737_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3737_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT];
void is31fl3737_init(uint8_t addr);
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -173,9 +173,9 @@ void is31fl3741_init(uint8_t addr) {
}
void is31fl3741_set_value(int index, uint8_t value) {
is31_led led;
is31fl3741_led_t led;
if (index >= 0 && index < LED_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.v] == value) {
return;
@ -192,8 +192,8 @@ void is31fl3741_set_value_all(uint8_t value) {
}
void is31fl3741_set_led_control_register(uint8_t index, bool value) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3741_led_t led;
memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led));
if (value) {
g_scaling_registers[led.driver][led.v] = 0xFF;
@ -216,7 +216,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) {
g_pwm_buffer_update_required[index] = false;
}
void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t value) {
void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t value) {
g_pwm_buffer[pled->driver][pled->v] = value;
g_pwm_buffer_update_required[pled->driver] = true;
@ -246,7 +246,7 @@ void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index) {
}
}
void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t value) {
void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value) {
g_scaling_registers[pled->driver][pled->v] = value;
g_scaling_registers_update_required[pled->driver] = true;

View File

@ -61,12 +61,12 @@
#define IS31FL3741_I2C_ADDRESS_SDA 0x32
#define IS31FL3741_I2C_ADDRESS_VCC 0x33
typedef struct is31_led {
typedef struct is31fl3741_led_t {
uint32_t driver : 2;
uint32_t v : 10;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3741_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT];
void is31fl3741_init(uint8_t addr);
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data);
@ -83,9 +83,9 @@ void is31fl3741_set_led_control_register(uint8_t index, bool value);
// If the buffer is dirty, it will update the driver with the buffer.
void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index);
void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t value);
void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value);
void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t value);
void is31fl3741_set_pwm_buffer(const is31fl3741_led *pled, uint8_t value);
#define IS31FL3741_PUR_0R 0x00 // No PUR resistor
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor

View File

@ -173,9 +173,9 @@ void is31fl3741_init(uint8_t addr) {
}
void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3741_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
@ -194,8 +194,8 @@ void is31fl3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3741_led_t led;
memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led));
if (red) {
g_scaling_registers[led.driver][led.r] = 0xFF;
@ -230,7 +230,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) {
g_pwm_buffer_update_required[index] = false;
}
void is31fl3741_set_pwm_buffer(const is31_led *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) {
g_pwm_buffer[pled->driver][pled->r] = red;
g_pwm_buffer[pled->driver][pled->g] = green;
g_pwm_buffer[pled->driver][pled->b] = blue;
@ -262,7 +262,7 @@ void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index) {
}
}
void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) {
void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue) {
g_scaling_registers[pled->driver][pled->r] = red;
g_scaling_registers[pled->driver][pled->g] = green;
g_scaling_registers[pled->driver][pled->b] = blue;

View File

@ -46,6 +46,9 @@
# define IS31FL3741_GLOBALCURRENT ISSI_GLOBALCURRENT
#endif
#define is31_led is31fl3741_led_t
#define g_is31_leds g_is31fl3741_leds
#define PUR_0R IS31FL3741_PUR_0R
#define PUR_05KR IS31FL3741_PUR_05KR
#define PUR_1KR IS31FL3741_PUR_1KR
@ -61,14 +64,14 @@
#define IS31FL3741_I2C_ADDRESS_SDA 0x32
#define IS31FL3741_I2C_ADDRESS_VCC 0x33
typedef struct is31_led {
typedef struct is31fl3741_led_t {
uint32_t driver : 2;
uint32_t r : 10;
uint32_t g : 10;
uint32_t b : 10;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3741_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT];
void is31fl3741_init(uint8_t addr);
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data);
@ -85,9 +88,9 @@ void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bo
// If the buffer is dirty, it will update the driver with the buffer.
void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index);
void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index);
void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3741_set_pwm_buffer(const is31_led *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);
#define IS31FL3741_PUR_0R 0x00 // No PUR resistor
#define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor

View File

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "rev_a.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_2, J_2, L_2 }, //D402
{ 0, K_3, J_3, L_3 }, //D403
{ 0, K_4, J_4, L_4 }, //D404

View File

@ -16,7 +16,7 @@
#include QMK_KEYBOARD_H
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{0, G_1, I_1, H_1},
{0, G_3, I_3, H_3},
{0, G_4, I_4, H_4},

View File

@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -18,7 +18,7 @@
#include "drivers/led/issi/is31fl3731.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, J_14, K_14, L_14 },
{ 0, J_13, K_13, L_13 },
{ 0, J_12, K_12, L_12 },

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef LED_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -3,7 +3,7 @@
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 1, B_2, A_2, C_2 },
{ 1, E_3, D_3, F_3 },
{ 1, E_4, D_4, F_4 },

View File

@ -3,7 +3,7 @@
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, E_1, D_1, F_1 },
{ 0, E_2, D_2, F_2 },
{ 0, E_3, D_3, F_3 },

View File

@ -3,7 +3,7 @@
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 1, B_2, A_2, C_2 },
{ 1, E_3, D_3, F_3 },
{ 1, E_4, D_4, F_4 },

View File

@ -3,7 +3,7 @@
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
// top underglow sd2-sd17
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -4,7 +4,7 @@
# include "host.h"
# include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_1, J_1, L_1 },// LED1
{ 0, K_2, J_2, L_2 },
{ 0, K_3, J_3, L_3 },

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -19,7 +19,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -19,7 +19,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -1,7 +1,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_14, J_14, L_14 },
{ 0, K_13, J_13, L_13 },
{ 0, K_12, J_12, L_12 },

View File

@ -1,7 +1,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_14, J_14, L_14 },
{ 0, K_13, J_13, L_13 },
{ 0, K_12, J_12, L_12 },

View File

@ -1,7 +1,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, H_15, G_15, I_15 },
{ 0, K_14, J_14, L_14 },
{ 0, K_13, J_13, L_13 },

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_14, J_14, L_14 },
{ 0, K_13, J_13, L_13 },
{ 0, K_12, J_12, L_12 },

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, C8_8, C7_8, C6_8 },
{ 0, C9_8, C7_7, C6_7 },
{ 0, C9_7, C8_7, C6_6 },

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, C8_8, C7_8, C6_8 },
{ 0, C9_8, C7_7, C6_7 },
{ 0, C9_7, C8_7, C6_6 },

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS21_SW1, CS20_SW1, CS19_SW1},
{0, CS21_SW2, CS20_SW2, CS19_SW2},
{0, CS21_SW3, CS20_SW3, CS19_SW3},

View File

@ -17,7 +17,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT] = {
{ 1, K_12, J_12, L_12 },
{ 1, K_11, J_11, L_11 },
{ 1, K_10, J_10, L_10 },

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT] = {
{ 1, K_12, J_12, L_12 },
{ 1, K_11, J_11, L_11 },
{ 1, K_10, J_10, L_10 },

View File

@ -243,7 +243,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
#ifdef RGB_MATRIX_ENABLE
// clang-format off
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* driver
* | R location
* | | G location

View File

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -7,7 +7,7 @@ void matrix_init_kb(void) {
matrix_init_user();
}
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -54,7 +54,7 @@ void set_fallacy_led(int index, bool state) {
/* define LED matrix
*/
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
{0, C1_1},
{0, C2_1},
{0, C3_1},

View File

@ -18,7 +18,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | G location

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
| | 4 | | || | | 4 | |
| 6 | | | 2 || 2 | | | 5 |
*/
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{0, B_1, A_1, C_1},
{0, B_2, A_2, C_2},
{0, B_3, A_3, C_3},

View File

@ -5,7 +5,7 @@
#if defined(RGB_MATRIX_ENABLE)
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -1,6 +1,6 @@
#include "quantum.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{0, C1_8, C2_8, C3_8}, //0 led1
{0, C1_7, C2_7, C3_7}, //1 led2
{0, C1_6, C2_6, C3_6}, //2 led3

View File

@ -22,7 +22,7 @@
#include "rgb_matrix.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -91,7 +91,7 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
#ifdef HS60_ANSI
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -199,7 +199,7 @@ led_config_t g_led_config = { {
#else
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS3_SW1, CS2_SW1, CS1_SW1},
{0, CS3_SW2, CS2_SW2, CS1_SW2},
{0, CS3_SW3, CS2_SW3, CS1_SW3},

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS3_SW1, CS2_SW1, CS1_SW1},
{0, CS3_SW2, CS2_SW2, CS1_SW2},
{0, CS3_SW3, CS2_SW3, CS1_SW3},

View File

@ -20,7 +20,7 @@
#include "hotswap.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -20,7 +20,7 @@
#include "universal.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -171,7 +171,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
#endif
#ifdef LED_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
// The numbers in the comments are the led numbers DXX on the PCB
/* Refer to IS31 manual for these locations
* driver
@ -195,7 +195,7 @@ const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
// 71 70 69
{ 0, C3_7 }, { 0, C2_7 }, { 0, C1_7 },
// Right half (mirrored)
// Due to how LED_MATRIX_SPLIT is implemented, only the first half of g_is31_leds is actually used.
// Due to how LED_MATRIX_SPLIT is implemented, only the first half of g_is31fl3731_leds is actually used.
// Luckily, the right half has the same LED pinouts, just mirrored.
// 45 44 43 42 41 40 39
{ 0, C2_2 }, { 0, C1_2 }, { 0, C5_1 }, { 0, C4_1 }, { 0, C3_1 }, { 0, C2_1 }, { 0, C1_1 },

View File

@ -4,7 +4,7 @@
#include "quantum.h"
#ifdef LED_MATRIX_ENABLE
const is31_led g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address

View File

@ -172,9 +172,9 @@ void is31fl3733_init(uint8_t bus, uint8_t addr, uint8_t sync) {
}
void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
is31_led led;
is31fl3733_led_t led;
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
@ -193,8 +193,8 @@ void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
}
void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
is31_led led;
memcpy_P(&led, (&g_is31_leds[index]), sizeof(led));
is31fl3733_led_t led;
memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led));
uint8_t control_register_r = led.r / 8;
uint8_t control_register_g = led.g / 8;

View File

@ -39,14 +39,14 @@
#define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E
#define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F
typedef struct is31_led {
typedef struct is31fl3733_led_t {
uint8_t driver : 2;
uint8_t r;
uint8_t g;
uint8_t b;
} __attribute__((packed)) is31_led;
} __attribute__((packed)) is31fl3733_led_t;
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT];
void is31fl3733_init(uint8_t bus, uint8_t addr, uint8_t sync);
bool is31fl3733_write_register(uint8_t index, uint8_t addr, uint8_t reg, uint8_t data);

View File

@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGB_MATRIX_ENABLE
# include "is31fl3733-dual.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h"
#ifdef LED_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT] = {
// The numbers in the comments are the led numbers DXX on the PCB
/* Refer to IS31 manual for these locations
* driver

View File

@ -19,7 +19,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -15,7 +15,7 @@
*/
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS18_SW1, CS17_SW1, CS16_SW1}, /* RGB6 */
{0, CS18_SW3, CS17_SW3, CS16_SW3}, /* RGB32 */
{0, CS18_SW4, CS17_SW4, CS16_SW4}, /* RGB45 */

View File

@ -15,7 +15,7 @@
*/
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS18_SW1, CS17_SW1, CS16_SW1}, /* RGB6 */
{0, CS18_SW3, CS17_SW3, CS16_SW3}, /* RGB32 */
{0, CS18_SW4, CS17_SW4, CS16_SW4}, /* RGB45 */

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS21_SW1, CS20_SW1, CS19_SW1},
{0, CS21_SW2, CS20_SW2, CS19_SW2},
{0, CS21_SW3, CS20_SW3, CS19_SW3},

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{0, C8_8, C7_8, C6_8}, // LA17
{0, C9_8, C7_7, C6_7}, // LA16

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{0, C8_8, C7_8, C6_8}, // LA17
{0, C9_8, C7_7, C6_7}, // LA16

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS21_SW1, CS20_SW1, CS19_SW1},
{0, CS21_SW2, CS20_SW2, CS19_SW2},
{0, CS21_SW3, CS20_SW3, CS19_SW3},

View File

@ -1,6 +1,6 @@
#include "quantum.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_9, A_9, C_9 }, //LA33
{ 0, B_10, A_10, C_10 }, //LA37
{ 0, B_11, A_11, C_11 }, //LA41

View File

@ -1,6 +1,6 @@
#include "quantum.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{0, C2_1, C3_1, C4_1}, // LA0
{0, C1_1, C3_2, C4_2}, // LA1
{0, C1_2, C2_2, C4_3}, // LA2

View File

@ -26,8 +26,7 @@ const matrix_row_t matrix_mask[] = {
};
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -26,7 +26,7 @@ const matrix_row_t matrix_mask[] = {
};
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -26,7 +26,7 @@ const matrix_row_t matrix_mask[] = {
};
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -27,7 +27,7 @@ const matrix_row_t matrix_mask[] = {
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#if defined(RGB_MATRIX_ENABLE)
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -22,7 +22,7 @@
# include "is31fl3733.h"
# include "ws2812.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -15,7 +15,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -24,7 +24,7 @@
# include "ws2812.h"
const PROGMEM is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const PROGMEM is31fl3733_led_t g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -21,7 +21,7 @@
# include "is31fl3733.h"
# include "ws2812.h"
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, B_1, A_1, C_1 },
{ 0, B_2, A_2, C_2 },
{ 0, B_3, A_3, C_3 },

View File

@ -17,7 +17,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS6_SW1, CS5_SW1, CS4_SW1},
{0, CS6_SW2, CS5_SW2, CS4_SW2},
{0, CS6_SW3, CS5_SW3, CS4_SW3},

View File

@ -16,7 +16,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS6_SW1, CS5_SW1, CS4_SW1},
{0, CS6_SW3, CS5_SW3, CS4_SW3},
{0, CS6_SW4, CS5_SW4, CS4_SW4},

View File

@ -16,7 +16,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS6_SW1, CS5_SW1, CS4_SW1},
{0, CS6_SW3, CS5_SW3, CS4_SW3},
{0, CS6_SW4, CS5_SW4, CS4_SW4},

View File

@ -17,7 +17,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -16,7 +16,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = {
{ 0, K_13, J_13, L_13 },
{ 0, K_12, J_12, L_12 },
{ 0, K_11, J_11, L_11 },

View File

@ -17,7 +17,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -30,7 +30,7 @@
#endif
// rgb ring leds setting
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -63,7 +63,7 @@ void matrix_scan_kb(void) {
}
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{0, C2_1, C3_1, C4_1}, //D102-A0-0
{0, C5_1, C6_1, C7_1}, //D108-A1-1

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT] = {
{0, CS3_SW5, CS2_SW5, CS1_SW5}, /* D9-K31-00 */
{0, CS6_SW5, CS5_SW5, CS4_SW5}, /* D46-K00-01 */
{0, CS6_SW9, CS5_SW9, CS4_SW9}, /* D59-K01-02 */

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
// left CA
{0, C5_2, C6_2, C7_2}, //D2-0
{0, C1_1, C3_2, C4_2}, //D20-1

View File

@ -17,7 +17,7 @@
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location

Some files were not shown because too many files have changed in this diff Show More