]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/backlight.h
420c9d19edd8529ce402b6de08c1dcafc464ca48
[qmk_firmware.git] / tmk_core / common / backlight.h
1 /*
2 Copyright 2013 Mathias Andersson <wraul@dbox.se>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #pragma once
19
20 #include <stdint.h>
21 #include <stdbool.h>
22
23 typedef union {
24     uint8_t raw;
25     struct {
26         bool    enable :1;
27         uint8_t level  :7;
28     };
29 } backlight_config_t;
30
31 void backlight_init(void);
32 void backlight_increase(void);
33 void backlight_decrease(void);
34 void backlight_toggle(void);
35 void backlight_enable(void);
36 void backlight_disable(void);
37 bool is_backlight_enabled(void);
38 void backlight_step(void);
39 void backlight_set(uint8_t level);
40 void backlight_level(uint8_t level);
41 uint8_t get_backlight_level(void);
42