]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/eve/meteor/meteor.c
Adding verd layout to RSII (#7296)
[qmk_firmware.git] / keyboards / eve / meteor / meteor.c
1 /* Copyright 2019 MechMerlin
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15  */
16
17 #include "meteor.h"
18
19 void backlight_init_ports(void) {
20     // initialize pins D0, D1, D4 and D6 as output
21     setPinOutput(D0);
22     setPinOutput(D1);
23     setPinOutput(D4);
24     setPinOutput(D6);
25
26     // turn backlight LEDs on
27     writePinHigh(D0);
28     writePinHigh(D1);
29     writePinHigh(D4);
30     writePinHigh(D6);
31 }
32
33 void backlight_set(uint8_t level) {
34     if (level == 0) {
35         // turn backlight LEDs off
36         writePinLow(D0);
37         writePinLow(D1);
38         writePinLow(D4);
39         writePinLow(D6);
40     } else {
41         // turn backlight LEDs on
42         writePinHigh(D0);
43         writePinHigh(D1);
44         writePinHigh(D4);
45         writePinHigh(D6);
46     }
47 }