fixed up calibration significantly
[openmag.git] / src / dusi / backlight.h
blobbe658f7f13d502271e0c00bcdd45b5034d1f112e
1 /* Copyright (C) 2008 Sean D'Epagnier <sean@depagnier.com>
3 * This Program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public
5 * License as published by the Free Software Foundation; either
6 * version 3 of the License, or (at your option) any later version.
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.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 * For more information on the GPL, please go to:
18 * http://www.gnu.org/copyleft/gpl.html
21 #define BACKLIGHT_DDR DDRF
22 #define BACKLIGHT_PORT PORTF
23 #define BACKLIGHTWHITE PF2
24 #define BACKLIGHTGREEN PF3
26 void backlight_set(uint8_t white, uint8_t green)
28 BACKLIGHT_DDR |= _BV(BACKLIGHTWHITE) | _BV(BACKLIGHTGREEN);
29 if(white)
30 BACKLIGHT_PORT &= ~_BV(BACKLIGHTWHITE);
31 else
32 BACKLIGHT_PORT |= _BV(BACKLIGHTWHITE);
34 if(green)
35 BACKLIGHT_PORT &= ~_BV(BACKLIGHTGREEN);
36 else
37 BACKLIGHT_PORT |= _BV(BACKLIGHTGREEN);