1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
30 bool tuner_power(bool status
)
36 #endif /* #if CONFIG_TUNER */
42 or_l(0x00080000, &GPIO1_OUT
);
43 or_l(0x00080000, &GPIO1_ENABLE
);
44 or_l(0x00080000, &GPIO1_FUNCTION
);
47 /* The boot loader controls the power */
48 ide_power_enable(true);
50 or_l(0x80000000, &GPIO_ENABLE
);
51 or_l(0x80000000, &GPIO_FUNCTION
);
57 bool charger_inserted(void)
59 return (GPIO1_READ
& 0x00400000)?true:false;
61 #endif /* CONFIG_CHARGING */
63 /* Returns true if the unit is charging the batteries. */
64 bool charging_state(void) {
65 return (GPIO_READ
& 0x00800000)?true:false;
69 void ide_power_enable(bool on
)
72 and_l(~0x80000000, &GPIO_OUT
);
74 or_l(0x80000000, &GPIO_OUT
);
78 bool ide_powered(void)
80 return (GPIO_OUT
& 0x80000000)?false:true;
86 set_irq_level(DISABLE_INTERRUPTS
);
87 and_l(~0x00080000, &GPIO1_OUT
);
92 #endif /* SIMULATOR */