summaryrefslogtreecommitdiff
path: root/keyboards/lfkeyboards/lighting.h
blob: 69e63268ddfcb71c47791e20d3b1be4811a08b87 (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
50
51
52
53
#ifndef LIGHTING_H
#define LIGHTING_H


// 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);

#endif