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
This commit is contained in:
Michael Giacomelli 2008-12-25 01:46:16 +00:00
parent f921f74873
commit 70e9c7aed3
24 changed files with 1283 additions and 28 deletions

View file

@ -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)

View file

@ -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

View file

@ -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();