summaryrefslogtreecommitdiff
path: root/keyboards/xelus/pachi/rgb/rev2/rev2.h
blob: fb0b8639d20526d64d9355922b90fb0c64206842 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Copyright 2023 Harrison Chan (Xelus)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once

#include "quantum.h"

#ifdef VIA_ENABLE
// custom ID codes
enum via_indicator_value {
    id_caps_lock_enable = 1,
    id_caps_lock_brightness,
    id_caps_lock_color,
    id_caps_lock_key,
    id_caps_lock_override,
    id_num_lock_enable,
    id_num_lock_brightness,
    id_num_lock_color,
    id_num_lock_key,
    id_num_lock_override,
    id_scroll_lock_enable,
    id_scroll_lock_brightness,
    id_scroll_lock_color,
    id_scroll_lock_key,
    id_scroll_lock_override,
    id_layer_indicator_enable,
    id_layer_indicator_brightness,
    id_layer_indicator_color,
    id_layer_indicator_key,
    id_layer_indicator_override
};

// struct to save things
typedef struct {
    bool enable_caps_lock:1;            // |
    bool enable_num_lock:1;             // |
    bool enable_scroll_lock:1;          // |
    bool enable_layer_indicator:1;      // |
    bool caps_override_bl:1;            // |
    bool num_override_bl:1;             // |
    bool scroll_override_bl:1;          // |
    bool layer_override_bl:1;           // 1 byte
    HSV caps_lock_indicator;    // 3 bytes
    HSV num_lock_indicator;     // 3 bytes
    HSV scroll_lock_indicator;  // 3 bytes
    HSV layer_indicator;        // 3 bytes
    uint8_t caps_lock_key;      // 1 byte
    uint8_t num_lock_key;       // 1 byte
    uint8_t scroll_lock_key;    // 1 byte
    uint8_t layer_indicator_key;// 1 byte
} indicator_settings_config;
// total 17 bytes

// function declaration
void indicator_config_set_value( uint8_t *data );
void indicator_config_get_value( uint8_t *data );
void indicator_config_save ( void );
void _set_color(HSV *color, uint8_t *data);
void _get_color(HSV *color, uint8_t *data);
#endif