Difference between revisions of "Interprocessor (51-51d) protocol FAQ"
Jump to navigation
Jump to search
m (→Definitions) |
(Added definitions →Definitions) |
||
Line 24: | Line 24: | ||
#define TEXT_DISK 0x00 |
#define TEXT_DISK 0x00 |
||
#define TEXT_TRACK 0x01 |
#define TEXT_TRACK 0x01 |
||
+ | |||
− | #define QUERY_NUM_DISKS 0x21 |
||
− | #define |
+ | #define SSA_MODE_NORMAL 0x00 |
− | #define |
+ | #define SSA_MODE_ARTIST 0x01 |
− | #define |
+ | #define SSA_MODE_GENRE 0x02 |
− | #define |
+ | #define SSA_MODE_ALBUM 0x03 |
+ | |||
− | #define REPEAT_DISK 0x34 |
||
+ | |||
⚫ | |||
+ | #define 51D_INIT 0x10 /* 4Bytes */ |
||
− | #define RANDOM_DISK 0x40 |
||
+ | #define 8051_INIT 0x11 /* 4Bytes: SSAMode(1) + RunType(1) + Lot(2) */ |
||
⚫ | |||
+ | #define 51D_REINIT 0x13 /* Not sure what this does or syntax */ |
||
− | #define RANDOM_NEXT 0x45 |
||
+ | #define ACTIVATE_PLUGIN 0x15 /* 2Bytes: PWid(1) + Activate(1) */ |
||
⚫ | |||
− | #define |
+ | #define QUERY_NUM_DISKS 0x21 /* 0Bytes */ |
+ | #define QUERY_NUM_TRACKS 0x20 /* 2Bytes: Disk(2) */ |
||
− | #define ASCII_FOLLOWS 0x50 |
||
+ | #define PLAY_TRACK 0x30 /* 6Bytes: Track(2) + Disk(2) + Offset(2) */ |
||
⚫ | |||
+ | #define STOP 0x32 /* 0Bytes */ |
||
⚫ | |||
− | #define |
+ | #define REPEAT_TRACK 0x33 /* 0Bytes */ |
− | #define |
+ | #define REPEAT_DISK 0x34 /* 0Bytes */ |
− | #define |
+ | #define REPEAT_OFF 0x35 /* 0Bytes */ |
− | #define |
+ | #define BEGIN_SEEK 0x36 /* 1Byte */ |
+ | #define AUDIO_ID 0x38 /* 4Bytes: Track(2) + Disk(2) */ |
||
⚫ | |||
+ | #define RANDOM_DISK 0x40 /* 5Bytes: ?0x0b?(1) + Track?(2) + Disk?(2) */ |
||
− | #define ACK_CONTINUE 0xac |
||
+ | #define RANDOM_MAG 0x41 /* 5Bytes: ?0x76?(1) + Track?(2) + Disk?(2) */ |
||
− | #define CONTINUE 0xbd |
||
− | #define |
+ | #define RANDOM_NEXT 0x45 /* 0Bytes */ |
⚫ | |||
+ | #define PLAYING_TRACK 0x48 /* 4Bytes: Track(2) + Disk(2) */ |
||
+ | #define ASCII_FOLLOWS 0x50 /* 14Bytes: Type(1) + PacketNum(1) + ASCII(12) */ |
||
⚫ | |||
⚫ | |||
+ | #define SHUTDOWN 0x61 /* 0Bytes */ |
||
+ | #define PING 0x66 /* 0Bytes */ |
||
+ | #define PONG 0x70 /* 0Bytes */ |
||
+ | #define SSA_PLAY_MODE 0x90 /* 1Byte: 0=Normal, 1=Artists, 2=Genres, 3=Albums */ |
||
+ | #define TRACKS 0x7c /* 4Bytes: Track(2) + Disk(2) */ |
||
+ | #define DISKS 0x7d /* 2Bytes: Disks(2) */ |
||
+ | #define FIRMWARE_UPLOAD 0xa3 /* 8Bytes: DATA */ |
||
⚫ | |||
⚫ | |||
⚫ | |||
== Protocol Examples == |
== Protocol Examples == |
Revision as of 11:14, 5 July 2005
The 51d program running on the 7312 and the Winbond '51 chip communicate over /dev/ttyS1 at 115200 bps.
Here is what we know so far about the communications protocol:
Last byte of multi-byte strings is a checksum that appears to be calculated by (0xff - (all bytes before checksum added together) + 0x01) workable code:
unsigned char calcsum(int bytec, char bytes[]) { unsigned char sum=0; int i; for (i=0;i<bytec;i++) { sum = (sum+bytes[i])&0xff; } return (0xff-sum+1); }
Obtained from strace at http://downloads.phathack.com/sbingner/strace-51d.log
Definitions
#define TEXT_DISK 0x00 #define TEXT_TRACK 0x01 #define SSA_MODE_NORMAL 0x00 #define SSA_MODE_ARTIST 0x01 #define SSA_MODE_GENRE 0x02 #define SSA_MODE_ALBUM 0x03
#define 51D_INIT 0x10 /* 4Bytes */ #define 8051_INIT 0x11 /* 4Bytes: SSAMode(1) + RunType(1) + Lot(2) */ #define 51D_REINIT 0x13 /* Not sure what this does or syntax */ #define ACTIVATE_PLUGIN 0x15 /* 2Bytes: PWid(1) + Activate(1) */ #define QUERY_NUM_DISKS 0x21 /* 0Bytes */ #define QUERY_NUM_TRACKS 0x20 /* 2Bytes: Disk(2) */ #define PLAY_TRACK 0x30 /* 6Bytes: Track(2) + Disk(2) + Offset(2) */ #define STOP 0x32 /* 0Bytes */ #define REPEAT_TRACK 0x33 /* 0Bytes */ #define REPEAT_DISK 0x34 /* 0Bytes */ #define REPEAT_OFF 0x35 /* 0Bytes */ #define BEGIN_SEEK 0x36 /* 1Byte */ #define AUDIO_ID 0x38 /* 4Bytes: Track(2) + Disk(2) */ #define RANDOM_DISK 0x40 /* 5Bytes: ?0x0b?(1) + Track?(2) + Disk?(2) */ #define RANDOM_MAG 0x41 /* 5Bytes: ?0x76?(1) + Track?(2) + Disk?(2) */ #define RANDOM_NEXT 0x45 /* 0Bytes */ #define RANDOM_OFF 0x47 /* 0Bytes */ #define PLAYING_TRACK 0x48 /* 4Bytes: Track(2) + Disk(2) */ #define ASCII_FOLLOWS 0x50 /* 14Bytes: Type(1) + PacketNum(1) + ASCII(12) */ #define QUERY_TRACK_NAME 0x56 /* 4Bytes: Track(2) + Disk(2) */ #define QUERY_DISK_NAME 0x57 /* 2Bytes: Disk(2) */ #define SHUTDOWN 0x61 /* 0Bytes */ #define PING 0x66 /* 0Bytes */ #define PONG 0x70 /* 0Bytes */ #define SSA_PLAY_MODE 0x90 /* 1Byte: 0=Normal, 1=Artists, 2=Genres, 3=Albums */ #define TRACKS 0x7c /* 4Bytes: Track(2) + Disk(2) */ #define DISKS 0x7d /* 2Bytes: Disks(2) */ #define FIRMWARE_UPLOAD 0xa3 /* 8Bytes: DATA */ #define HEADER_ACK 0xac #define BLOCK_ACK 0xbd #define PACKET_ACK 0xce
Protocol Examples
ASCII Text is sent 12 Bytes at a time, in multiple 'packets'
7312 | 8052 | Possible Meaning |
---|---|---|
0xf9 | ?? | |
0x53 | ?? | |
0x10 | ?? | |
0x21,0xdf | Query total disc | |
0xce | ACK | |
0x7d | Total Disks follows | |
0xac | OK, Continue | |
0x00 | First byte | |
0xbd | Continue | |
0x0f | Second Byte (total 15 disks) | |
0xbd | Continue | |
0x74 | End of Stream | |
0xce | ACK | |
0x20,0x00,0x01,0xdf | Query total tracks in disc 1 (0x00, 0x01) | |
0xce | ACK | |
0x7c | Total tracks follows | |
0xac | OK, Continue | |
0x00 | First byte of total tracks | |
0xbd | Continue | |
0x01 | Second Byte of total tracks (1 track in disk 1) | |
0xbd | Continue | |
0x00 | First byte of disknum | |
0xbd | Continue | |
0x01 | Second Byte of disknum | |
0xbd | Continue | |
0x82 | End of Stream | |
0xce | ACK | |
0x30 0x00 0x01 0x00 0x02 0x00 0x00 0xcd | Play Disk 2 Track 1 Offset 0 | |
0xce | ACK | |
0x57,0x00,0x02,0xa7 | Name of disk 2? (Answering "PLY2: Alternative") | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x00 | Type of Text (0x00 = Disk Name) | |
0xbd | Continue | |
0x00 | Packet Number | |
0xbd | Continue | |
P | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'LY2: Altern' | ||
0xc9 | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x00 | Type of Text (0x00 = Disk Name) | |
0xbd | Continue | |
0x01 | Packet Number | |
0xbd | Continue | |
a | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'tive' | ||
0x00 | NULL | |
0xbd | Continue | |
Above 2 lines repeat 6 more times | ||
0x96 | Checksum? | |
0xce | ACK | |
0x56,0x00,0x01,0x00,0x02,0xa7 | Name of disk 2, track 1? (returning "3 Doors Down - ") | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x00 | Packet Number | |
0xbd | Continue | |
3 | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters ' Doors Down' | ||
0x9d | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x01 | Packet Number | |
0xbd | Continue | |
0x20 | ASCII Text (space) | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters ' - Duck And ' | ||
0x67 | Checksum? | |
0xce | ACK | |
0x50 | ACSII Follows | |
0xac | OK, Continue | |
0x01 | Type of Text (0x01 = Track Name) | |
0xbd | Continue | |
0x02 | Packet Number | |
0xbd | Continue | |
R | ASCII Text | |
0xbd | Continue | |
Above 2 lines repeats for each of the letters 'Run (Live)' | ||
0x00 | NULL | |
0xbd | Continue | |
0x00 | NULL | |
0xbd | Continue | |
0x77 | Checksum? | |
0xce | ACK | |
0x66, 0x9a | 8052 PING | |
0xce | ACK | |
0x70 | 51d PONG | |
0xac | ACK, Continue | |
0x90 | Checksum | |
0xce | ACK | |
- Heartbeat:
If the Winbond chip does not see a "heartbeat" signal every 10 seconds, it will kill power to the 7312 and reboot it. It's a two-part sequence:
7312 > 0x70 0xAC < 51 > 0x90 0xCE < 51
Must repeat within 10 seconds, or the Winbond chip will output 0x66,0x9A 3 times and reboot.