From 70e9c7aed361787a404c4856211ddf53127fca9a Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Thu, 25 Dec 2008 01:46:16 +0000 Subject: 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 --- firmware/export/config-ipod4g.h | 2 ++ firmware/export/config-ipodcolor.h | 2 ++ firmware/export/config-ipodnano.h | 2 ++ firmware/export/config-ipodvideo.h | 2 ++ firmware/export/iap.h | 31 +++++++++++++++++++++++++++++++ firmware/export/kernel.h | 2 ++ firmware/export/serial.h | 5 ++++- 7 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 firmware/export/iap.h (limited to 'firmware/export') diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index 89b14f9907..f6c71f39d8 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h @@ -186,4 +186,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT +#define IPOD_ACCESSORY_PROTOCOL + #endif diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 47b7a4eacf..58a888a969 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h @@ -166,4 +166,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT +#define IPOD_ACCESSORY_PROTOCOL + #endif diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index 6017d0a2e8..8752181bb9 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h @@ -177,4 +177,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT +#define IPOD_ACCESSORY_PROTOCOL + #endif diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index d04e562086..ab974dc236 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h @@ -197,4 +197,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT +#define IPOD_ACCESSORY_PROTOCOL + #endif diff --git a/firmware/export/iap.h b/firmware/export/iap.h new file mode 100644 index 0000000000..6c0b968ab0 --- /dev/null +++ b/firmware/export/iap.h @@ -0,0 +1,31 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: iap.h 17400 2008-05-07 20:22:16Z xxxxxx $ + * + * Copyright (C) 2002 by Alan Korr + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef __IAP_H__ +#define __IAP_H__ + +extern int iap_getc(unsigned char x); +extern void iap_write_pkt(unsigned char data, int len); +extern void iap_setup(int ratenum); +extern void iap_bitrate_set(int ratenum); +extern void iap_periodic(void); +extern void iap_handlepkt(void); +extern void iap_track_changed(void); + +#endif diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index ef65463e5d..29cf8f2eb9 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -78,6 +78,8 @@ #define SYS_REMOTE_UNPLUGGED MAKE_SYS_EVENT(SYS_EVENT_CLS_PLUG, 5) #define SYS_SCREENDUMP MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 0) #define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) +#define SYS_IAP_PERIODIC MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 2) +#define SYS_IAP_HANDLEPKT MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 3) #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) diff --git a/firmware/export/serial.h b/firmware/export/serial.h index 425fc66fc6..8a4780c3f1 100644 --- a/firmware/export/serial.h +++ b/firmware/export/serial.h @@ -22,8 +22,11 @@ #ifndef __SERIAL_H__ #define __SERIAL_H__ -extern void serial_setup (void); +extern void serial_setup(void); +extern void serial_bitrate(int rate); extern int remote_control_rx(void); extern void serial_tx(const unsigned char *buf); +extern void tx_writec(unsigned char c); +extern int tx_rdy(void); #endif -- cgit v1.2.3