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

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