summaryrefslogtreecommitdiffstats
path: root/keyboards/lfkeyboards/lighting.h
blob: cb07755c53b15be334739efbc38e40c0c1a287c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

// rgb_sequence[RGBLED_NUM]
//
// Array used for sequential lighting effects.
//
// Example LFK78 RevC+ RGB Map:
//   27  29  10   9   8   7   6
// 26                                   5
// 25                                   4
// 24                                   3
//   23  22  21  20  14  15  11   1   2
//
// const uint8_t rgb_sequence[] = {
//     27, 29, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
//     11, 15, 14, 20, 21, 22, 23, 24, 25, 26
// };
extern const uint8_t rgb_sequence[RGBLED_NUM];

// switch_matrices[]
//
// The ISSI matrices for switch backlighting
//
// Example LFK78 RevC+ - ISSI Device 0, banks 0 and 1:
// switch_matrices[] = {0, 1};
extern const uint8_t switch_matrices[];

// rgb_matrices[]
// The ISSI matrices for RGB Underglow
//
// Example LFK78 RevC+ - ISSI Device 3, banks 0 and 1:
// rgb_matrices[] = {6, 7};
extern const uint8_t rgb_matrices[];

// switch_leds[MATRIX_ROWS][MATRIX_COLS]
// Maps switch LEDs from Row/Col to ISSI matrix.
// Value breakdown:
//     Bit     | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
//             |   | ISSI Col  |    ISSI Row   |
//             |   |
//             Device
extern const uint8_t switch_leds[MATRIX_ROWS][MATRIX_COLS];

void led_test(void);
void force_issi_refresh(void);
void set_backlight(uint8_t level);
void set_underglow(uint8_t red, uint8_t green, uint8_t blue);
void set_rgb(uint8_t rgb_led, uint8_t red, uint8_t green, uint8_t blue);
void set_backlight_by_keymap(uint8_t col, uint8_t row);