1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Karl Kurbjun
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
30 #include "backlight.h"
31 #include "backlight-target.h"
32 #include "lcd-remote-target.h"
36 /* Initialize IDE power pin */
37 /* set GIO17 (ATA power) on and output */
38 ide_power_enable(true);
43 unsigned int power_input_status(void)
45 /* Charger is active low */
46 if(!(IO_GIO_BITSET1
&(1<<9)))
48 return POWER_INPUT_MAIN_CHARGER
;
50 return POWER_INPUT_NONE
;
53 /* Returns true if the unit is charging the batteries. */
54 bool charging_state(void)
59 void ide_power_enable(bool on
)
62 IO_GIO_BITCLR1
=(1<<1);
64 IO_GIO_BITSET1
=(1<<1);
67 bool ide_powered(void)
69 return !(IO_GIO_BITSET1
&(1<<1));
74 /* turn off backlight and wait for 1 second */
80 IO_GIO_DIR1
&=~(1<<10);
81 IO_GIO_BITSET1
|=1<<10;