diff options
-rw-r--r-- | drivers/issi/is31fl3741.c | 4 | ||||
-rw-r--r-- | drivers/issi/is31fl3741.h | 165 |
2 files changed, 83 insertions, 86 deletions
diff --git a/drivers/issi/is31fl3741.c b/drivers/issi/is31fl3741.c index 99d72b9b0..bc434fb29 100644 --- a/drivers/issi/is31fl3741.c +++ b/drivers/issi/is31fl3741.c | |||
@@ -78,7 +78,6 @@ bool g_scaling_registers_update_required[DRIVER_COUNT] = {false}; | |||
78 | 78 | ||
79 | uint8_t g_scaling_registers[DRIVER_COUNT][ISSI_MAX_LEDS]; | 79 | uint8_t g_scaling_registers[DRIVER_COUNT][ISSI_MAX_LEDS]; |
80 | 80 | ||
81 | |||
82 | void IS31FL3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) { | 81 | void IS31FL3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) { |
83 | g_twi_transfer_buffer[0] = reg; | 82 | g_twi_transfer_buffer[0] = reg; |
84 | g_twi_transfer_buffer[1] = data; | 83 | g_twi_transfer_buffer[1] = data; |
@@ -174,7 +173,7 @@ void IS31FL3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { | |||
174 | g_pwm_buffer[led.driver][led.r] = red; | 173 | g_pwm_buffer[led.driver][led.r] = red; |
175 | g_pwm_buffer[led.driver][led.g] = green; | 174 | g_pwm_buffer[led.driver][led.g] = green; |
176 | g_pwm_buffer[led.driver][led.b] = blue; | 175 | g_pwm_buffer[led.driver][led.b] = blue; |
177 | g_pwm_buffer_update_required = true; | 176 | g_pwm_buffer_update_required = true; |
178 | } | 177 | } |
179 | } | 178 | } |
180 | 179 | ||
@@ -253,4 +252,3 @@ void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t | |||
253 | g_scaling_registers[pled->driver][pled->g] = green; | 252 | g_scaling_registers[pled->driver][pled->g] = green; |
254 | g_scaling_registers[pled->driver][pled->b] = blue; | 253 | g_scaling_registers[pled->driver][pled->b] = blue; |
255 | } | 254 | } |
256 | |||
diff --git a/drivers/issi/is31fl3741.h b/drivers/issi/is31fl3741.h index 69cf206d4..ed5350932 100644 --- a/drivers/issi/is31fl3741.h +++ b/drivers/issi/is31fl3741.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | 24 | ||
25 | typedef struct is31_led { | 25 | typedef struct is31_led { |
26 | uint8_t driver : 2; | 26 | uint8_t driver : 2; |
27 | uint16_t r; | 27 | uint16_t r; |
28 | uint16_t g; | 28 | uint16_t g; |
29 | uint16_t b; | 29 | uint16_t b; |
@@ -51,15 +51,15 @@ void IS31FL3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t | |||
51 | 51 | ||
52 | void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); | 52 | void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); |
53 | 53 | ||
54 | #define CS1_SW1 0x00 | 54 | #define CS1_SW1 0x00 |
55 | #define CS2_SW1 0x01 | 55 | #define CS2_SW1 0x01 |
56 | #define CS3_SW1 0x02 | 56 | #define CS3_SW1 0x02 |
57 | #define CS4_SW1 0x03 | 57 | #define CS4_SW1 0x03 |
58 | #define CS5_SW1 0x04 | 58 | #define CS5_SW1 0x04 |
59 | #define CS6_SW1 0x05 | 59 | #define CS6_SW1 0x05 |
60 | #define CS7_SW1 0x06 | 60 | #define CS7_SW1 0x06 |
61 | #define CS8_SW1 0x07 | 61 | #define CS8_SW1 0x07 |
62 | #define CS9_SW1 0x08 | 62 | #define CS9_SW1 0x08 |
63 | #define CS10_SW1 0x09 | 63 | #define CS10_SW1 0x09 |
64 | #define CS11_SW1 0x0A | 64 | #define CS11_SW1 0x0A |
65 | #define CS12_SW1 0x0B | 65 | #define CS12_SW1 0x0B |
@@ -82,15 +82,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
82 | #define CS29_SW1 0x1C | 82 | #define CS29_SW1 0x1C |
83 | #define CS30_SW1 0x1D | 83 | #define CS30_SW1 0x1D |
84 | 84 | ||
85 | #define CS1_SW2 0x1E | 85 | #define CS1_SW2 0x1E |
86 | #define CS2_SW2 0x1F | 86 | #define CS2_SW2 0x1F |
87 | #define CS3_SW2 0x20 | 87 | #define CS3_SW2 0x20 |
88 | #define CS4_SW2 0x21 | 88 | #define CS4_SW2 0x21 |
89 | #define CS5_SW2 0x22 | 89 | #define CS5_SW2 0x22 |
90 | #define CS6_SW2 0x23 | 90 | #define CS6_SW2 0x23 |
91 | #define CS7_SW2 0x24 | 91 | #define CS7_SW2 0x24 |
92 | #define CS8_SW2 0x25 | 92 | #define CS8_SW2 0x25 |
93 | #define CS9_SW2 0x26 | 93 | #define CS9_SW2 0x26 |
94 | #define CS10_SW2 0x27 | 94 | #define CS10_SW2 0x27 |
95 | #define CS11_SW2 0x28 | 95 | #define CS11_SW2 0x28 |
96 | #define CS12_SW2 0x29 | 96 | #define CS12_SW2 0x29 |
@@ -113,15 +113,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
113 | #define CS29_SW2 0x3A | 113 | #define CS29_SW2 0x3A |
114 | #define CS30_SW2 0x3B | 114 | #define CS30_SW2 0x3B |
115 | 115 | ||
116 | #define CS1_SW3 0x3C | 116 | #define CS1_SW3 0x3C |
117 | #define CS2_SW3 0x3D | 117 | #define CS2_SW3 0x3D |
118 | #define CS3_SW3 0x3E | 118 | #define CS3_SW3 0x3E |
119 | #define CS4_SW3 0x3F | 119 | #define CS4_SW3 0x3F |
120 | #define CS5_SW3 0x40 | 120 | #define CS5_SW3 0x40 |
121 | #define CS6_SW3 0x41 | 121 | #define CS6_SW3 0x41 |
122 | #define CS7_SW3 0x42 | 122 | #define CS7_SW3 0x42 |
123 | #define CS8_SW3 0x43 | 123 | #define CS8_SW3 0x43 |
124 | #define CS9_SW3 0x44 | 124 | #define CS9_SW3 0x44 |
125 | #define CS10_SW3 0x45 | 125 | #define CS10_SW3 0x45 |
126 | #define CS11_SW3 0x46 | 126 | #define CS11_SW3 0x46 |
127 | #define CS12_SW3 0x47 | 127 | #define CS12_SW3 0x47 |
@@ -144,15 +144,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
144 | #define CS29_SW3 0x58 | 144 | #define CS29_SW3 0x58 |
145 | #define CS30_SW3 0x59 | 145 | #define CS30_SW3 0x59 |
146 | 146 | ||
147 | #define CS1_SW4 0x5A | 147 | #define CS1_SW4 0x5A |
148 | #define CS2_SW4 0x5B | 148 | #define CS2_SW4 0x5B |
149 | #define CS3_SW4 0x5C | 149 | #define CS3_SW4 0x5C |
150 | #define CS4_SW4 0x5D | 150 | #define CS4_SW4 0x5D |
151 | #define CS5_SW4 0x5E | 151 | #define CS5_SW4 0x5E |
152 | #define CS6_SW4 0x5F | 152 | #define CS6_SW4 0x5F |
153 | #define CS7_SW4 0x60 | 153 | #define CS7_SW4 0x60 |
154 | #define CS8_SW4 0x61 | 154 | #define CS8_SW4 0x61 |
155 | #define CS9_SW4 0x62 | 155 | #define CS9_SW4 0x62 |
156 | #define CS10_SW4 0x63 | 156 | #define CS10_SW4 0x63 |
157 | #define CS11_SW4 0x64 | 157 | #define CS11_SW4 0x64 |
158 | #define CS12_SW4 0x65 | 158 | #define CS12_SW4 0x65 |
@@ -175,15 +175,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
175 | #define CS29_SW4 0x76 | 175 | #define CS29_SW4 0x76 |
176 | #define CS30_SW4 0x77 | 176 | #define CS30_SW4 0x77 |
177 | 177 | ||
178 | #define CS1_SW5 0x78 | 178 | #define CS1_SW5 0x78 |
179 | #define CS2_SW5 0x79 | 179 | #define CS2_SW5 0x79 |
180 | #define CS3_SW5 0x7A | 180 | #define CS3_SW5 0x7A |
181 | #define CS4_SW5 0x7B | 181 | #define CS4_SW5 0x7B |
182 | #define CS5_SW5 0x7C | 182 | #define CS5_SW5 0x7C |
183 | #define CS6_SW5 0x7D | 183 | #define CS6_SW5 0x7D |
184 | #define CS7_SW5 0x7E | 184 | #define CS7_SW5 0x7E |
185 | #define CS8_SW5 0x7F | 185 | #define CS8_SW5 0x7F |
186 | #define CS9_SW5 0x80 | 186 | #define CS9_SW5 0x80 |
187 | #define CS10_SW5 0x81 | 187 | #define CS10_SW5 0x81 |
188 | #define CS11_SW5 0x82 | 188 | #define CS11_SW5 0x82 |
189 | #define CS12_SW5 0x83 | 189 | #define CS12_SW5 0x83 |
@@ -206,15 +206,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
206 | #define CS29_SW5 0x94 | 206 | #define CS29_SW5 0x94 |
207 | #define CS30_SW5 0x95 | 207 | #define CS30_SW5 0x95 |
208 | 208 | ||
209 | #define CS1_SW6 0x96 | 209 | #define CS1_SW6 0x96 |
210 | #define CS2_SW6 0x97 | 210 | #define CS2_SW6 0x97 |
211 | #define CS3_SW6 0x98 | 211 | #define CS3_SW6 0x98 |
212 | #define CS4_SW6 0x99 | 212 | #define CS4_SW6 0x99 |
213 | #define CS5_SW6 0x9A | 213 | #define CS5_SW6 0x9A |
214 | #define CS6_SW6 0x9B | 214 | #define CS6_SW6 0x9B |
215 | #define CS7_SW6 0x9C | 215 | #define CS7_SW6 0x9C |
216 | #define CS8_SW6 0x9D | 216 | #define CS8_SW6 0x9D |
217 | #define CS9_SW6 0x9E | 217 | #define CS9_SW6 0x9E |
218 | #define CS10_SW6 0x9F | 218 | #define CS10_SW6 0x9F |
219 | #define CS11_SW6 0xA0 | 219 | #define CS11_SW6 0xA0 |
220 | #define CS12_SW6 0xA1 | 220 | #define CS12_SW6 0xA1 |
@@ -237,15 +237,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
237 | #define CS29_SW6 0xB2 | 237 | #define CS29_SW6 0xB2 |
238 | #define CS30_SW6 0xB3 | 238 | #define CS30_SW6 0xB3 |
239 | 239 | ||
240 | #define CS1_SW7 0xB4 | 240 | #define CS1_SW7 0xB4 |
241 | #define CS2_SW7 0xB5 | 241 | #define CS2_SW7 0xB5 |
242 | #define CS3_SW7 0xB6 | 242 | #define CS3_SW7 0xB6 |
243 | #define CS4_SW7 0xB7 | 243 | #define CS4_SW7 0xB7 |
244 | #define CS5_SW7 0xB8 | 244 | #define CS5_SW7 0xB8 |
245 | #define CS6_SW7 0xB9 | 245 | #define CS6_SW7 0xB9 |
246 | #define CS7_SW7 0xBA | 246 | #define CS7_SW7 0xBA |
247 | #define CS8_SW7 0xBB | 247 | #define CS8_SW7 0xBB |
248 | #define CS9_SW7 0xBC | 248 | #define CS9_SW7 0xBC |
249 | #define CS10_SW7 0xBD | 249 | #define CS10_SW7 0xBD |
250 | #define CS11_SW7 0xBE | 250 | #define CS11_SW7 0xBE |
251 | #define CS12_SW7 0xBF | 251 | #define CS12_SW7 0xBF |
@@ -268,15 +268,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
268 | #define CS29_SW7 0xD0 | 268 | #define CS29_SW7 0xD0 |
269 | #define CS30_SW7 0xD1 | 269 | #define CS30_SW7 0xD1 |
270 | 270 | ||
271 | #define CS1_SW8 0xD2 | 271 | #define CS1_SW8 0xD2 |
272 | #define CS2_SW8 0xD3 | 272 | #define CS2_SW8 0xD3 |
273 | #define CS3_SW8 0xD4 | 273 | #define CS3_SW8 0xD4 |
274 | #define CS4_SW8 0xD5 | 274 | #define CS4_SW8 0xD5 |
275 | #define CS5_SW8 0xD6 | 275 | #define CS5_SW8 0xD6 |
276 | #define CS6_SW8 0xD7 | 276 | #define CS6_SW8 0xD7 |
277 | #define CS7_SW8 0xD8 | 277 | #define CS7_SW8 0xD8 |
278 | #define CS8_SW8 0xD9 | 278 | #define CS8_SW8 0xD9 |
279 | #define CS9_SW8 0xDA | 279 | #define CS9_SW8 0xDA |
280 | #define CS10_SW8 0xDB | 280 | #define CS10_SW8 0xDB |
281 | #define CS11_SW8 0xDC | 281 | #define CS11_SW8 0xDC |
282 | #define CS12_SW8 0xDD | 282 | #define CS12_SW8 0xDD |
@@ -299,15 +299,15 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
299 | #define CS29_SW8 0xEE | 299 | #define CS29_SW8 0xEE |
300 | #define CS30_SW8 0xEF | 300 | #define CS30_SW8 0xEF |
301 | 301 | ||
302 | #define CS1_SW9 0xF0 | 302 | #define CS1_SW9 0xF0 |
303 | #define CS2_SW9 0xF1 | 303 | #define CS2_SW9 0xF1 |
304 | #define CS3_SW9 0xF2 | 304 | #define CS3_SW9 0xF2 |
305 | #define CS4_SW9 0xF3 | 305 | #define CS4_SW9 0xF3 |
306 | #define CS5_SW9 0xF4 | 306 | #define CS5_SW9 0xF4 |
307 | #define CS6_SW9 0xF5 | 307 | #define CS6_SW9 0xF5 |
308 | #define CS7_SW9 0xF6 | 308 | #define CS7_SW9 0xF6 |
309 | #define CS8_SW9 0xF7 | 309 | #define CS8_SW9 0xF7 |
310 | #define CS9_SW9 0xF8 | 310 | #define CS9_SW9 0xF8 |
311 | #define CS10_SW9 0xF9 | 311 | #define CS10_SW9 0xF9 |
312 | #define CS11_SW9 0xFA | 312 | #define CS11_SW9 0xFA |
313 | #define CS12_SW9 0xFB | 313 | #define CS12_SW9 0xFB |
@@ -419,4 +419,3 @@ void IS31FL3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, | |||
419 | #define CS37_SW9 0x15C | 419 | #define CS37_SW9 0x15C |
420 | #define CS38_SW9 0x15D | 420 | #define CS38_SW9 0x15D |
421 | #define CS39_SW9 0x15E | 421 | #define CS39_SW9 0x15E |
422 | |||