2 Copyright 2014 Ralf Schmitt <ralf@bunkertor.net>
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.
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.
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/>.
19 #include "backlight.h"
22 void backlight_init_ports()
24 DDRB |= 0b11100000; // PB7 (switch), PB6 (pcb), PB5 (caps)
27 void led_set(uint8_t usb_led)
29 (usb_led & (1<<USB_LED_CAPS_LOCK)) ? backlight_caps_enable() : backlight_caps_disable();
32 void backlight_set(uint8_t level)
34 (level & BACKLIGHT_SWITCH) ? backlight_switch_enable() : backlight_switch_disable();
35 (level & BACKLIGHT_PCB) ? backlight_pcb_enable() : backlight_pcb_disable();
38 void backlight_switch_enable()
43 void backlight_switch_disable()
48 void backlight_switch_invert()
53 void backlight_pcb_enable()
58 void backlight_pcb_disable()
63 void backlight_pcb_invert()
68 void backlight_caps_enable()
73 void backlight_caps_disable()
78 void backlight_caps_invert()