summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2008-12-25 01:46:16 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2008-12-25 01:46:16 +0000
commit70e9c7aed361787a404c4856211ddf53127fca9a (patch)
tree3072967cf3ed2779acf939e150694ef437cbad2d /firmware/target
parentf921f74873a1439cf4e25b87192b31c079863924 (diff)
Commit FS#8624 by Linus Nielsen, Ryan Press, Craig Elliott, and Kenderes Tamas. Adds preliminary support for numerous accessories that use the ipod serial port on the dock connector. See IpodAccessories for a list of tested devices.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19585 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/ipod/button-clickwheel.c4
-rw-r--r--firmware/target/arm/ipod/button-target.h15
-rw-r--r--firmware/target/arm/system-pp502x.c6
3 files changed, 25 insertions, 0 deletions
diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c
index e36c928fb0..21bbca62f0 100644
--- a/firmware/target/arm/ipod/button-clickwheel.c
+++ b/firmware/target/arm/ipod/button-clickwheel.c
@@ -316,7 +316,11 @@ int button_read_device(void)
}
/* The int_btn variable is set in the button interrupt handler */
+#ifdef IPOD_ACCESSORY_PROTOCOL
+ return int_btn | remote_control_rx();
+#else
return int_btn;
+#endif
}
bool button_hold(void)
diff --git a/firmware/target/arm/ipod/button-target.h b/firmware/target/arm/ipod/button-target.h
index a0ac372839..67bdc72955 100644
--- a/firmware/target/arm/ipod/button-target.h
+++ b/firmware/target/arm/ipod/button-target.h
@@ -50,7 +50,22 @@ void ipod_4g_button_int(void);
|BUTTON_LEFT|BUTTON_RIGHT|BUTTON_SCROLL_FWD\
|BUTTON_SCROLL_BACK|BUTTON_PLAY)
+ /* Remote control's buttons */
+#ifdef IPOD_ACCESSORY_PROTOCOL
+#define BUTTON_RC_PLAY 0x00100000
+#define BUTTON_RC_STOP 0x00080000
+
+#define BUTTON_RC_LEFT 0x00040000
+#define BUTTON_RC_RIGHT 0x00020000
+#define BUTTON_RC_VOL_UP 0x00010000
+#define BUTTON_RC_VOL_DOWN 0x00008000
+
+#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
+ |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
+ |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
+#else
#define BUTTON_REMOTE 0
+#endif
/* This is for later
#define BUTTON_SCROLL_TOUCH 0x00000200
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index d683b3a561..b1f178c8d5 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -32,6 +32,7 @@
#ifndef BOOTLOADER
extern void TIMER1(void);
extern void TIMER2(void);
+extern void SERIAL0(void);
extern void ipod_mini_button_int(void); /* iPod Mini 1st gen only */
extern void ipod_4g_button_int(void); /* iPod 4th gen and higher only */
@@ -78,6 +79,11 @@ void irq(void)
button_int();
}
#endif
+#ifdef IPOD_ACCESSORY_PROTOCOL
+ else if (CPU_HI_INT_STAT & SER0_MASK) {
+ SERIAL0();
+ }
+#endif
#ifdef HAVE_USBSTACK
else if (CPU_INT_STAT & USB_MASK) {
usb_drv_int();