[转贴]IPOD接口定义

news/2024/11/24 20:45:47/
[转贴]IPOD接口定义
原文:
http://hi.baidu.com/laoye360/blog/item/ffe4bea4888020f29152ee3c.html

         苹果公司使用了一家名叫JAE公司的接插件,型号为DD1.这个接口有30针,

接口排列方式为:
1.2.3.4.5.6.7.8.9...........29.30

内部焊接点排列为:

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

接口定义为:
1    Ground (-)     地    *                   
2    Line Out - Common Ground (-)    线路输出 地*
3    Line Out - R (+)     R声道线路输出
4    Line Out - L (+)      L声道线路输出
5    Line In - R (+)        R声道线路输入
6    Line In - L (+)        L声道线路输入
7
8    Video Out - Composite Video (for ipod colour when slideshow activated)       复合视频输出 (只有彩屏的ipod有效)******
9
10
11 Serial GND      RS-232串口 地
12 Serial TxD       RS-232串口 TxD
13 Serial RxD       RS-232串口 RxD
14
15 Ground (-)       地    **  
16 USB GND (-)        USB电源负极 **
17
18 3.3V Power (+)     3.3V电源正极
19 Firewire Power 12 VDC (+)     1394火线12V电源 正极 ***
20 Firewire Power 12 VDC (+)      1394火线12V电源 正极***
21 Accessory Indicator        附件识别接口 ****
22 FireWire Data TPA (-)        1394火线数据 TPA(-)
23 USB Power 5 VDC (+)      USB 5V 电源 正极
24 FireWire Data TPA (+)       1394火线数据 TPA(+)
25 USB Data (-)                      USB 数据(-)
26 FireWire Data TPB (-)          1394火线数据 TPA(-)
27 USB Data (+)                     USB 数据(+)
28 FireWire Data TPB (+)        1394火线数据 TPB(+)
29 FireWire Ground (-)           1394火线12V电源 负极*****
30 FireWire Ground (-)           1394火线12V电源 负极*****


特殊定义:
* 1,2 与电路板连接
** 15,16 与电路板连接
*** 19,20 与电路板连接
**** 21     通过一个电阻连接到地。    不同的阻抗表明不同的辅助部件被连接。
           已知的resistances/functions (欧姆) 是如下:
                1k0 - iPod 基座
           10k - 照相机适配器
           500k - RS-232通信
           1M0 - Belkin 自动适配器, iPod 自动地关闭了当力量分开了
***** 29,30 与电路板连接
****** 全部连接在公共地

http://ipodlinux.org/Apple_Accessory_Protocol

Apple Accessory Protocol

From wikiPodLinux

The Apple Accessory Protocol is used for communication between the iPod and serially connected accessories (such as the Remote, iTalk etc). The protocol was introduced with the 3rd generation iPods, and at present it is assumed is also compatible with the 4th generation iPods and mini iPods. (The Dock Connector provides access to this communication channel as well.)

The connections uses a standard 8N1 serial protocol. The original speed rate is 19200 baud - higher rates (up to 57600 baud) work properly (tested the 5G) but make trouble sending large amounts of data (picture blocks) faster than 38400 baud.

 

Table of contents [showhide]
1 Request/Response Structure
2 Mode List
3 Mode Switching (Mode 0)
4 Voice Memo (Mode 1)
5 iPod Remote (Mode 2)
6 Advanced Remote (Mode 4)

6.1 Type Bytes
6.2 Picture Blocks

7 Nike+ (Mode 9)
8 Credits
[ edit]

Request/Response Structure

The request and response messages follow this general form.

Request/Response Message
fieldsizevalue
header20xFF 0x55
length1size of mode + command + parameter
mode1the mode the command is referring to
command2the two byte command
parameter0..noptional parameter, depending on the command
checksum10xXX - (8 bit additive checksum) ( (sum of all length/mode/command/parameter bytes) & 0xFF)

The mode in the message indicates which mode the command belongs to, these same mode values are used in the mode switching command below.

[ edit]

Mode List

List of Modes
Mode NumberPurpose
0x00Mode switching
0x01Voice Recorder
0x02Simple Remote
0x03Request Mode Status
0x04AiR Mode
0x09Nike+ Mode
[ edit]

Mode Switching (Mode 0)

Mode 0 Commands
CommandPurpose
0x01 0x01Switch to Voice Recorder mode (not working on 5G)
0x01 0x02Switch to iPod Remote mode
0x01 0x04Switch to AiR mode
0x03Get current mode status
0x04 0xXX(response) the current mode number (0xXX is the mode returned by the iPod), 0x04 0x01 could also be an indicator that the iPod is currently busy - I frequently get this skipping tracks very fast --- this info is not 100% correct, I´m getting different responses. Will try to work this out later.
0x05Switch to AiR mode (same as 0x01 0x04?)
0x06Switch to iPod Remote mode (same as 0x01 0x02?)

Clearly there's stuff here waiting to be figured out.

[ edit]

Voice Memo (Mode 1)

The mode 1 commands are used for the voice recording functions. To initiate the recording mode on the iPod the send the switch to mode 0x01 command - this will switch the iPod display to the "Voice Memo" screen. When the record button is pressed the iPod will send the command "0x00 0x00", sending the command to switch to mode 0x01 will start the actual recording.

Mode 1 Commands
CommandPurpose
0x01 0x00Recording has started.
0x01 0x01Recording has stopped (or paused).
[ edit]

iPod Remote (Mode 2)

The mode 2 commands are used by the remote control to signal button presses. When a button is pressed the appropriate code is send 66 times per second until the button is released at which point the button released command is sent.

Note that the 3 and 4 byte commands may not work for older (tested on a 3g) iPods. They are valid for newer (tested on an iPod Nano) iPods however.

Mode 2 Commands
CommandPurpose
0x00 0x00Button Released
0x00 0x01Play
0x00 0x02Vol+
0x00 0x04Vol-
0x00 0x08Skip>
0x00 0x10Skip<
0x00 0x20Next Album
0x00 0x40Previous Album
0x00 0x80Stop
0x00 0x00 0x01Play (just play, no pause)
0x00 0x00 0x02Pause (just pause, no play)
0x00 0x00 0x04Mute (toggle)
0x00 0x00 0x20Next Playlist
0x00 0x00 0x40Previous Playlist
0x00 0x00 0x80Toggles Shuffle
0x00 0x00 0x00 0x01Toggles Repeat
0x00 0x00 0x00 0x04Ipod Off
0x00 0x00 0x00 0x08Ipod On
0x00 0x00 0x00 0x40Menu Button
0x00 0x00 0x00 0x80OK/Select Button
0x00 0x00 0x00 0x00 0x01Scroll Up
0x00 0x00 0x00 0x00 0x02Scroll Down
[ edit]

Advanced Remote (Mode 4)

The mode 4 commands are used for the Advanced iPod Remote (AiR) functions. The commands can be used to remotely control much of the iPod functions. Unfortunately when switched to this mode the iPod display changes to "OK to disconnect".

Commands you send to the iPod are in bold, responses to those commands from the iPod are not. The response is always the command + 1.

Mode 4 Commands
CommandParameter (bytes)Purpose
0x00 0x00Result(1) Command(2)think that the result 0x04 means that the command wasn´t understood
0x00 0x01Result(1) Command(2)Gives you feedback on the command you just executed. Result: 0=success, 2=failure, 4=you exceeded the limit of whatever you were requesting/wrong parameter-count, 5=sent an iPod-Answere-Cmd(?). The Command is the command that this is in response to.
0x00 0x02noneperhaps a simple ping-request ?!
0x00 0x038 bytes0xFF 0xFF 0xFF 0xFF 0x00 0x00 0x00 0x00 (echo?)
0x00 0x09none? returns flag set with 0x00 0x0b, don´t know, what this means (perhaps an indicator for track-change - if you set this flag to 0x01 it turns to 0x00 again after changing the track)
0x00 0x0a1 byte0x00 or 0x01
0x00 0x0b1 byteparameter 0x00 & 0x01 result in a success-answere (copare 0x00 0x01), don´t know what happens - seems to be a flag which can be read with 0x00 0x09
0x00 0x0c?(1) (4)position ?(2)the 2-5 bytes of the parameters is the position in the play list. ?? results in a answer 0x0d
0x00 0x0d11 bytes or 1 bytetried some parameters - result seems to dependent on current playlist
parameters 0x00 0x00 0x00 0x00 0x00 0x00 0x00 give (on my Ipod) 11 bytes
(0x00 0x00 0x00 0x00 0x00 0x00 0x02 0xf0 0xdb 0x00 0x00 in main-Playlist - *not* the playlist-number and *not* the count of tracks in this playlist)

This command can also inform the accessory when there is a track change (one song ends and another begins). So it is a "subscription" - some previous query caused the ipod to send this every time the track changes. Probably the parameter bytes are a kind of track ID, maybe based on some filesystem attribute, such as actual position on the hard disk.

0x00 0x12none? Get iPod Type Size ?
0x00 0x132 bytesGen3 20GB: 0x01 0x02 (0x01 = Gen3 iPod, 0x02 = 20GB ??)
Gen4 30GB: 0x01 0x09
Gen5 30GB: 0x01 0x09
0x00 0x14noneGet iPod Name
0x00 0x15namestring(var)iPod Name as a null terminated string
0x00 0x16noneSwitch to the main library playlist (playlist 0)
0x00 0x17type(1) number(4)Switch to item identified by the number and type given.
0x00 0x18type(1)Get Count of the given types (count of playlists, etc)
0x00 0x19number(4)Amount of requested type returned
0x00 0x1Atype(1) number(4) number(4)Get Names for a range of items, first number is starting item offset (0 for the first item), second number is number of items to retrieve. The iPod will send back an entire message for each item requested.
0x00 0x1Bnumber(4) stringoffset, name of the item (note that playlist 0 is the "main library" and will contain all the songs on the iPod and have the same name as the iPod itself as in command 0x00 0x14).
0x00 0x1CnoneGet time and status info
0x00 0x1Dlength(4) time(4) status(1)Track length in milliseconds, elapsed time in milliseconds, status=0x0 stop, 0x01 playing, 0x02 paused
0x00 0x1EnoneGet current position in playlist
0x00 0x1Fposition(4)Current position in playlist
0x00 0x20number(4)Get title of a song number
0x00 0x21stringtitle returned as a null terminated string
0x00 0x22number(4)Get artist of a song number
0x00 0x23stringArtist returned as a null terminated string
0x00 0x24number(4)Get album of a song number
0x00 0x25stringAlbum returned as a null terminated string
0x00 0x26pollingmode(1)Start Polling Mode = 0x01, Stop Polling Mode = 0x00. Polling mode causes the iPod to return the time elapsed (0x00 0x27) every 500 milliseconds.
0x00 0x27number(4)time elapsed on current song
0x00 0x28number(4)Execute Playlist switch specified in command 0x00 0x17, and jump to specified songnumber in the playlist (0xFFFFFFFF = start at the beginning of the playlist, even when shuffled... probably what you want to use)
0x00 0x29command(1)AiR Playback Control. Play/Pause=0x01, Stop=0x02, Skip++=0x03, Skip--=0x04, FFwd=0x05, FRwd=0x06, StopFF/RW=0x07
0x00 0x2CnoneGet Shuffle Mode
0x00 0x2Dshufflemode(1)Returns current Shuffle mode: Off = 0x00, Songs = 0x01, Albums = 0x02
0x00 0x2Eshufflemode(1)Sets the shuffle mode. Off = 0x00, Songs = 0x01, Albums = 0x02.
0x00 0x2FnoneGet Repeat Mode
0x00 0x30repeatmode(1)Returns current Repeat mode: Off = 0x00, One song = 0x01, All songs = 0x02
0x00 0x31repeatmode(1)Sets the repeat mode. Off = 0x00, One song = 0x01, All songs = 0x02
0x00 0x32Picture BlocksUpload Picture for AiR mode (see picture block description below)
0x00 0x33none? Get Max Screen Size for Picture Upload ?
0x00 0x342+2+1 bytesGen3 20GB: 0x00 0x78 0x00 0x41 0x01 => 120 x 65 ?

Gen5 30GB: 0x01 0x36 0x00 0xa8 0x01 => 310 x 168 ?
what means the 0x01 at the end? - perhaps the supported resolution for 1bit bitmaps

0x00 0x35noneGet number of songs in current playlist
0x00 0x36number(4)Number of songs in current playlist
0x00 0x37number(4)Jump to specified Songnumber in the current playlist
0x00 0x38none???
0x00 0x392*(2+2+1) = 10 bytes?? Gen5 30GB: 0x01 0x36 0x00 0xa8 0x02 0x01 0x36 0x00 0xa8 0x03 ... some similarities to 0x00 0x34

perhaps different solutions for different colordepth?

Type bytes
TypePurpose
0x01Playlist
0x02Artist
0x03Album
0x04Genre
0x05Song
0x06Composer
0x08Podcast
[ edit]

Picture Blocks

Transferring a picture to the iPod's screen is done using picture blocks. A picture block is basically the picture command (0x00 0x32). It's complicated enough to deserve its own section.

The parameter bytes of a picture block look like the following:

Picture Block Parameters
fieldsizevalue
block number2number of the block (starting from zero)
unknown1always 1, only in the first block
width2width of the picture, only in the first block
height2height of the picture, only in the first block
bytes per line4number of bytes you will send for each line. Divisible by 4, and only in the first block
picture bytesN3 lines? of pixels to be displayed, every 2 bits represents a pixel (4 color greyscale)

An example would look something like the following:

First block:

0xFF 0x55 (standard header)
0x6E (length of data in this block)
0x04 (mode of the command)
0x00 0x32 (command for picture display)
0x00 0x00 (indicates the first block (block zero))
0x01 (damned if I know.. perhaps indicates that the size info for the picture is here)
0x00 0x78 (width of picture to be displayed)
0x00 0x40 (height of picture to be displayed)
0x00 0x00 0x00 0x20 (number of bytes you're sending for each line of the display - must be a multiple of 8 and has to fit the needed bits!)
The rest is a 4 color picture, with every two bits representing a pixel.
Checksum.

Second block and every block thereafter:

0xFF 0x55 (standard header)
0x65 (length of data in this block)
0x04 (mode of the command)
0x00 0x32 (command for picture display)
0x00 0x01 (indicates the second block (increment as you go))
The rest is a 4 color picture, with every two bits representing a pixel.
Checksum.

Any extra pixels you send outside the range of the picture size on the right or bottom of the picture then get cut off.

You can see if the command was valid when you watch the response string for each block.

Good response is 0xFF 0x55 0x06 0x04 0x00 0x01 0x00 0x00 0x32 0xC3.

Bad response 0xFF 0x55 0x06 0x04 0x00 0x01 0x04 0x00 0x32 0xBF.

Below a width of 0x10 fillbits are used (only every 4th nibble of the picturedata is taken for the picture).

[ edit]

Nike+ (Mode 9)

Mode 9 is apparently used to transmit information and commands associated with the Nike+ product line. Commands can be transmitted to or from the ipod. All data is at 57600 with 8N1 formating.

Two types of commands have been observed; those which are commands to/from the receiver, and data from the wireless sensor. Packets containing data from the wireless sensor have additional structure inside their payload.

Mode 9 Commands
CommandDirectionPurpose
0x00 0x00 0x07To ipodConfirm / Acknowledge / OK, no payload
0x07 0x00 0x25To receiverInitialization, no payload
0x05To receiverEnter linking mode, no payload
unknownTo receiverExit linking mode, use this sensor (based on WU paper)
unknownTo receiver"I am ipod serial number" (based on WU paper)
unknownTo ipod"I am receiver serial number" (based on WU paper)
unknownTo ipod"I am listening for sensor serial number" (based on WU paper)
0x0D 0x0D 0x01To ipodReceived wireless data: complex payload

The received wireless data payload is formated as

  • 4 bytes, unique sensor id
  • 22 bytes, data (structure unknown at this time)
[ edit]

Credits

The bulk of this information is due to the hard work by Christoph, you can find his results at http://stud3.tuwien.ac.at/%7Ee0026607/ipod_remote/ipod_ap.html. Generalisation of the results was the work of Otto, see http://ipodlinux.sourceforge.net/forums/viewtopic.php?p=3362#3362.

 

Retrieved from " http://www.ipodlinux.org/Apple_Accessory_Protocol"

 


http://www.ppmy.cn/news/337509.html

相关文章

iOS设备屏幕尺寸和适配

屏幕尺寸 设备资源分辨率(像素)(UI)设计分辨率(点)(程序开发)屏幕分辨率(像素)说明iPhone6P/6SP2208 * 1242736 * 4141920 * 10803x,资源缩小1.15倍401ppiiPhone6/6S1334 * 750667 * 3751334 * 7502x,326ppiiPhone5/5s/5c(iPod/iPod Touch)1136 * 640568 * 3201136 * 6402x,32…

教你@media媒体查询来适配ipad iphone5678plus 各种屏幕

<style lang"less" rel"stylesheet/less" type"text/less" scoped>/*iPhone6/7/8*/media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-device-pixel-ratio: 2) {/* .属性名{...样式} */}/*iPh…

iphone,iPad,iPod Touch屏幕分辨率(宽高)

iPhone&#xff1a; iPhone 1G 320x480 iPhone 3G 320x480 iPhone 3GS 320x480 iPhone 4 640x960 iPhone 4S 640x960 iPhone 5 640x1136 iPhone 5S 640x1136 iPhone 5C 640x1136 iPhone 6 750x1334 iPhone 6 Plus 1080x1920 &#xff08;开发应按照1242x2208适配&#xff09; i…

iPhone屏幕适配(之屏幕尺寸)

Device screen size 各设备屏幕尺寸 DeviceDimensions (portrait)iPhone 14 Pro Max430x932 pt (1290x2796 px 3x)iPhone 14 Pro393x852 pt (1179x2556 px 3x)iPhone 14 Plus428x926 pt (1284x2778 px 3x)iPhone 14390x844 pt (1170x2532 px 3x)iPhone 13 Pro Max428x926 pt (…

iPhone/iPad 屏幕旋屏 iphone / ipod deployment info 调整

一般新建一个ViewController都会默认有以下这个函数 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; 下面我们来定义各种旋转 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientat…

iphone8投屏电脑 苹果投屏电视的方法

如今苹果用户日益增多&#xff0c;但是仍然有很多用户不知道怎么投屏&#xff0c;因为在生活中&#xff0c;我们总会想把手机和电脑联系起来&#xff0c;虽说手机在现如今已经很方便了&#xff0c;但是屏幕小还是无法阻挡人们对电脑大屏的喜爱&#xff0c;有时候通过电脑看手机…

iphone视图屏幕元素-像素大小 目前iphone,ipod touch 屏幕:320*480

在iphone开发秘籍中称之为 视图设计几何学 目前iphone&#xff0c;ipod touch 屏幕&#xff1a;320*480 1、状态栏 状态栏在iphone的顶端&#xff0c;显示设备的时间、连接性、电池状态、和运营商&#xff08;iphone&#xff09;或型号&#xff08;ipod&#xff09;&#xff0…

usb 的拓扑结构

usb 驱动开发 usb 的基本概念 这个忽略&#xff0c; 基本上usb 是啥都知道 usb 的拓扑结构 usb 是一种主从结构的系统 usb主机由usb主控之器&#xff08;Host Controller)和根集线器&#xff08;Root Hub&#xff09; 构成 usb 主控制器&#xff1a; 主要负责数据处理(就…