1
0
Fork 0

Infer LED DRIVER_COUNT from configured addresses (#22311)

This commit is contained in:
Joel Challis 2023-11-10 05:14:22 +00:00 committed by GitHub
parent 8136cf4bfb
commit 84df69572c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 138 additions and 57 deletions

View file

@ -23,9 +23,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define AW20216S_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef AW_SCALING_MAX
# define AW20216S_SCALING_MAX AW_SCALING_MAX
#endif
@ -59,6 +56,12 @@
# define AW20216S_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(AW20216S_CS_PIN_2)
# define AW20216S_DRIVER_COUNT 2
#elif defined(AW20216S_CS_PIN_1)
# define AW20216S_DRIVER_COUNT 1
#endif
typedef struct aw20216s_led_t {
uint8_t driver : 2;
uint8_t r;

View file

@ -36,9 +36,6 @@
#ifdef LED_DRIVER_ADDR_4
# define IS31FL3731_I2C_ADDRESS_4 LED_DRIVER_ADDR_4
#endif
#ifdef LED_DRIVER_COUNT
# define IS31FL3731_DRIVER_COUNT LED_DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -62,6 +59,16 @@
# define IS31FL3731_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined IS31FL3731_I2C_ADDRESS_4
# define IS31FL3731_DRIVER_COUNT 4
#elif defined IS31FL3731_I2C_ADDRESS_3
# define IS31FL3731_DRIVER_COUNT 3
#elif defined IS31FL3731_I2C_ADDRESS_2
# define IS31FL3731_DRIVER_COUNT 2
#elif defined IS31FL3731_I2C_ADDRESS_1
# define IS31FL3731_DRIVER_COUNT 1
#endif
typedef struct is31fl3731_led_t {
uint8_t driver : 2;
uint8_t v;

View file

@ -35,9 +35,6 @@
#ifdef DRIVER_ADDR_4
# define IS31FL3731_I2C_ADDRESS_4 DRIVER_ADDR_4
#endif
#ifdef DRIVER_COUNT
# define IS31FL3731_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3731_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -61,6 +58,16 @@
# define IS31FL3731_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3731_I2C_ADDRESS_4)
# define IS31FL3731_DRIVER_COUNT 4
#elif defined(IS31FL3731_I2C_ADDRESS_3)
# define IS31FL3731_DRIVER_COUNT 3
#elif defined(IS31FL3731_I2C_ADDRESS_2)
# define IS31FL3731_DRIVER_COUNT 2
#elif defined(IS31FL3731_I2C_ADDRESS_1)
# define IS31FL3731_DRIVER_COUNT 1
#endif
typedef struct is31fl3731_led_t {
uint8_t driver : 2;
uint8_t r;

View file

@ -26,9 +26,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef LED_DRIVER_COUNT
# define IS31FL3733_DRIVER_COUNT LED_DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -81,6 +78,16 @@
# define IS31FL3733_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3733_I2C_ADDRESS_4)
# define IS31FL3733_DRIVER_COUNT 4
#elif defined(IS31FL3733_I2C_ADDRESS_3)
# define IS31FL3733_DRIVER_COUNT 3
#elif defined(IS31FL3733_I2C_ADDRESS_2)
# define IS31FL3733_DRIVER_COUNT 2
#elif defined(IS31FL3733_I2C_ADDRESS_1)
# define IS31FL3733_DRIVER_COUNT 1
#endif
typedef struct is31fl3733_led_t {
uint8_t driver : 2;
uint8_t v;

View file

@ -49,9 +49,6 @@
#ifdef DRIVER_ADDR_4
# define IS31FL3733_SYNC_4 DRIVER_SYNC_4
#endif
#ifdef DRIVER_COUNT
# define IS31FL3733_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3733_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -104,6 +101,16 @@
# define IS31FL3733_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3733_I2C_ADDRESS_4)
# define IS31FL3733_DRIVER_COUNT 4
#elif defined(IS31FL3733_I2C_ADDRESS_3)
# define IS31FL3733_DRIVER_COUNT 3
#elif defined(IS31FL3733_I2C_ADDRESS_2)
# define IS31FL3733_DRIVER_COUNT 2
#elif defined(IS31FL3733_I2C_ADDRESS_1)
# define IS31FL3733_DRIVER_COUNT 1
#endif
typedef struct is31fl3733_led_t {
uint8_t driver : 2;
uint8_t r;

View file

@ -23,9 +23,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define IS31FL3736_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -76,6 +73,16 @@
# define IS31FL3736_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3736_I2C_ADDRESS_4)
# define IS31FL3736_DRIVER_COUNT 4
#elif defined(IS31FL3736_I2C_ADDRESS_3)
# define IS31FL3736_DRIVER_COUNT 3
#elif defined(IS31FL3736_I2C_ADDRESS_2)
# define IS31FL3736_DRIVER_COUNT 2
#elif defined(IS31FL3736_I2C_ADDRESS_1)
# define IS31FL3736_DRIVER_COUNT 1
#endif
typedef struct is31fl3736_led_t {
uint8_t driver : 2;
uint8_t v;

View file

@ -35,9 +35,6 @@
#ifdef DRIVER_ADDR_4
# define IS31FL3736_I2C_ADDRESS_4 DRIVER_ADDR_4
#endif
#ifdef DRIVER_COUNT
# define IS31FL3736_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3736_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -88,6 +85,16 @@
# define IS31FL3736_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3736_I2C_ADDRESS_4)
# define IS31FL3736_DRIVER_COUNT 4
#elif defined(IS31FL3736_I2C_ADDRESS_3)
# define IS31FL3736_DRIVER_COUNT 3
#elif defined(IS31FL3736_I2C_ADDRESS_2)
# define IS31FL3736_DRIVER_COUNT 2
#elif defined(IS31FL3736_I2C_ADDRESS_1)
# define IS31FL3736_DRIVER_COUNT 1
#endif
typedef struct is31fl3736_led_t {
uint8_t driver : 2;
uint8_t r;

View file

@ -25,9 +25,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define IS31FL3737_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -66,6 +63,16 @@
# define IS31FL3737_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3737_I2C_ADDRESS_4)
# define IS31FL3737_DRIVER_COUNT 4
#elif defined(IS31FL3737_I2C_ADDRESS_3)
# define IS31FL3737_DRIVER_COUNT 3
#elif defined(IS31FL3737_I2C_ADDRESS_2)
# define IS31FL3737_DRIVER_COUNT 2
#elif defined(IS31FL3737_I2C_ADDRESS_1)
# define IS31FL3737_DRIVER_COUNT 1
#endif
typedef struct is31fl3737_led_t {
uint8_t driver : 2;
uint8_t v;

View file

@ -37,9 +37,6 @@
#ifdef DRIVER_ADDR_4
# define IS31FL3737_I2C_ADDRESS_4 DRIVER_ADDR_4
#endif
#ifdef DRIVER_COUNT
# define IS31FL3737_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3737_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -81,6 +78,16 @@
# define IS31FL3737_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3737_I2C_ADDRESS_4)
# define IS31FL3737_DRIVER_COUNT 4
#elif defined(IS31FL3737_I2C_ADDRESS_3)
# define IS31FL3737_DRIVER_COUNT 3
#elif defined(IS31FL3737_I2C_ADDRESS_2)
# define IS31FL3737_DRIVER_COUNT 2
#elif defined(IS31FL3737_I2C_ADDRESS_1)
# define IS31FL3737_DRIVER_COUNT 1
#endif
typedef struct is31fl3737_led_t {
uint8_t driver : 2;
uint8_t r;

View file

@ -25,9 +25,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define IS31FL3741_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -66,6 +63,16 @@
# define IS31FL3741_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3741_I2C_ADDRESS_4)
# define IS31FL3741_DRIVER_COUNT 4
#elif defined(IS31FL3741_I2C_ADDRESS_3)
# define IS31FL3741_DRIVER_COUNT 3
#elif defined(IS31FL3741_I2C_ADDRESS_2)
# define IS31FL3741_DRIVER_COUNT 2
#elif defined(IS31FL3741_I2C_ADDRESS_1)
# define IS31FL3741_DRIVER_COUNT 1
#endif
typedef struct is31fl3741_led_t {
uint8_t driver : 2;
uint16_t v : 9;

View file

@ -37,9 +37,6 @@
#ifdef DRIVER_ADDR_4
# define IS31FL3741_I2C_ADDRESS_4 DRIVER_ADDR_4
#endif
#ifdef DRIVER_COUNT
# define IS31FL3741_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef ISSI_TIMEOUT
# define IS31FL3741_I2C_TIMEOUT ISSI_TIMEOUT
#endif
@ -81,6 +78,16 @@
# define IS31FL3741_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(IS31FL3741_I2C_ADDRESS_4)
# define IS31FL3741_DRIVER_COUNT 4
#elif defined(IS31FL3741_I2C_ADDRESS_3)
# define IS31FL3741_DRIVER_COUNT 3
#elif defined(IS31FL3741_I2C_ADDRESS_2)
# define IS31FL3741_DRIVER_COUNT 2
#elif defined(IS31FL3741_I2C_ADDRESS_1)
# define IS31FL3741_DRIVER_COUNT 1
#endif
typedef struct is31fl3741_led_t {
uint8_t driver : 2;
uint16_t r : 9;

View file

@ -36,7 +36,7 @@
// Set defaults for Spread Spectrum Register
#ifndef ISSI_SSR_1
# if DRIVER_COUNT == 1
# ifndef DRIVER_ADDR_2
# define ISSI_SSR_1 0x00
# else
# define ISSI_SSR_1 0xC0

View file

@ -36,7 +36,7 @@
// Set defaults for Spread Spectrum Register
#ifndef ISSI_SSR_1
# if DRIVER_COUNT == 1
# ifndef DRIVER_ADDR_2
# define ISSI_SSR_1 0x00
# else
# define ISSI_SSR_1 0xC0

View file

@ -36,6 +36,16 @@
# include "is31fl3746.h"
#endif
#if defined DRIVER_ADDR_4
# define DRIVER_COUNT 4
#elif defined DRIVER_ADDR_3
# define DRIVER_COUNT 3
#elif defined DRIVER_ADDR_2
# define DRIVER_COUNT 2
#elif defined DRIVER_ADDR_1
# define DRIVER_COUNT 1
#endif
#ifdef RGB_MATRIX_ENABLE
typedef struct is31_led {
uint8_t driver : 2;

View file

@ -22,9 +22,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define SNLED27351_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef CKLED2001_TIMEOUT
# define SNLED27351_I2C_TIMEOUT CKLED2001_TIMEOUT
#endif
@ -64,6 +61,16 @@
# define SNLED27351_LED_COUNT LED_MATRIX_LED_COUNT
#endif
#if defined(SNLED27351_I2C_ADDRESS_4)
# define SNLED27351_DRIVER_COUNT 4
#elif defined(SNLED27351_I2C_ADDRESS_3)
# define SNLED27351_DRIVER_COUNT 3
#elif defined(SNLED27351_I2C_ADDRESS_2)
# define SNLED27351_DRIVER_COUNT 2
#elif defined(SNLED27351_I2C_ADDRESS_1)
# define SNLED27351_DRIVER_COUNT 1
#endif
typedef struct snled27351_led_t {
uint8_t driver : 2;
uint8_t v;

View file

@ -22,9 +22,6 @@
#include "util.h"
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef DRIVER_COUNT
# define SNLED27351_DRIVER_COUNT DRIVER_COUNT
#endif
#ifdef DRIVER_ADDR_1
# define SNLED27351_I2C_ADDRESS_1 DRIVER_ADDR_1
#endif
@ -76,6 +73,16 @@
# define SNLED27351_LED_COUNT RGB_MATRIX_LED_COUNT
#endif
#if defined(SNLED27351_I2C_ADDRESS_4)
# define SNLED27351_DRIVER_COUNT 4
#elif defined(SNLED27351_I2C_ADDRESS_3)
# define SNLED27351_DRIVER_COUNT 3
#elif defined(SNLED27351_I2C_ADDRESS_2)
# define SNLED27351_DRIVER_COUNT 2
#elif defined(SNLED27351_I2C_ADDRESS_1)
# define SNLED27351_DRIVER_COUNT 1
#endif
typedef struct snled27351_led_t {
uint8_t driver : 2;
uint8_t r;