summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-03-14 08:59:51 +0000
committerJens Arnold <amiconn@rockbox.org>2008-03-14 08:59:51 +0000
commit3894a442027445e562323fee60ddb296ca41f828 (patch)
tree8290d6d97421044f2ecd25e03600f57c1f7d3241
parent8a6291dd63063bea12805a41fd43f13c17aa2be5 (diff)
downloadrockbox-3894a442027445e562323fee60ddb296ca41f828.tar.gz
rockbox-3894a442027445e562323fee60ddb296ca41f828.zip
More iAudio M3 work. Target build compiles, but same problem regarding plugins as the simulator. Boots to the menu, but it can't be used yet because only main & remote Play button work. USB works.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16661 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/iaudio/m3/usb-m3.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iaudio/m3/usb-m3.c b/firmware/target/coldfire/iaudio/m3/usb-m3.c
new file mode 100644
index 0000000000..f37c69574c
--- /dev/null
+++ b/firmware/target/coldfire/iaudio/m3/usb-m3.c
@@ -0,0 +1,47 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Jens Arnold
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include <stdbool.h>
22#include "cpu.h"
23#include "system.h"
24#include "usb.h"
25
26void usb_init_device(void)
27{
28 and_l(~0x10000000, &GPIO_OUT); /* USB enable bit */
29 or_l(0x10000000, &GPIO_ENABLE);
30 or_l(0x10000000, &GPIO_FUNCTION);
31
32 or_l(0x00000400, &GPIO1_FUNCTION); /* USB detect */
33}
34
35int usb_detect(void)
36{
37 return (GPIO1_READ & 0x00000400) ? USB_INSERTED : USB_EXTRACTED;
38}
39
40void usb_enable(bool on)
41{
42 if(on) {
43 or_l(0x10000000, &GPIO_OUT);
44 } else {
45 and_l(~0x10000000, &GPIO_OUT);
46 }
47}