Benutzer:Siro/i2cprotokoll: Unterschied zwischen den Versionen
Siro (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
Siro (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
||
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
Zeile 94: | Zeile 94: | ||
copies complement of inputbuffer to outputbuffer<br> | copies complement of inputbuffer to outputbuffer<br> | ||
to run bus-speed-test<br> | to run bus-speed-test<br> | ||
<br><b>0x02</b> GET | <br><b>0x02</b> GET AENDPOINT DESCRIPTOR<br> | ||
2.byte: endpoint<br> | 2.byte: endpoint<br> | ||
returns information about | returns information about any endpoint<br> | ||
can be display, soundd. ,networkd. ,inputd. ...<br> | can be display, soundd. ,networkd. ,inputd. ...<br> | ||
must be less then max. device endpoints<br> | must be less then max. device endpoints<br> | ||
<br><b>Endpoint 0</b> GET DEVICE DESCRIPTOR<br> | <br><b>Endpoint 0</b> GET DEVICE DESCRIPTOR<br> | ||
returns information about the device<br> | returns information about the device<br> | ||
<table border='1'> | |||
endpoint count< | <tr><td>Header</td><td>DATA1</td><td>DATA2</td><td>DATA3</td></tr> | ||
<tr><td bgcolor=grey></td><td><i>protocol version</i></td><td><i>endpoint count</i></td><td>-</td></tr> | |||
</table> | |||
<br><b>0x03</b> SET CURRENT ENDPOINT<br> | <br><b>0x03</b> SET CURRENT ENDPOINT<br> | ||
2.byte: endpoint<br> | 2.byte: endpoint<br> |
Aktuelle Version vom 1. Februar 2010, 17:43 Uhr
I2C Protokoll[Bearbeiten | Quelltext bearbeiten]
Version 0.4
DEFINITIONS[Bearbeiten | Quelltext bearbeiten]
layer0 | Hardwareebene (i2c) |
layer1 | Packetebene |
endpoint | externe Hardware/Software (nicht näher definiert) |
Vorderungen[Bearbeiten | Quelltext bearbeiten]
Device Overview[Bearbeiten | Quelltext bearbeiten]
Device | ||
|---- | Endpoint 0 | |
|---- | Endpoint 1 | |
... | ||
|---- | Endpoint n | |
|---status_byte | ||
|---in_buffer | ||
|---out_buffer |
Packet[Bearbeiten | Quelltext bearbeiten]
Overview
Packet:
Header | Data |
1 Byte | 1-8 Byte |
Header:
Bit 7 | Bit 6 | Bit 5 - 0 |
Command&!Data | Parity | see below |
Note: Parity can be EVEN, ODD, XOR, NONE, Parity does include packetsize-Bits and all DATA
Note: Command&!DATA marks this packet as either COMMAND packet or as DATA packet
COMMAND PACKET
Header:
Bit 7 | Bit 6 | Bit 5 | Bit 4 - 1 | Bit 0 |
1 | Parity | 0 (reserved) | COMMAND | Data packet count (0 or 1) |
Packet:
Header | Byte 1 |
1X0XXXXX | DATA (only if <header:0> is set) |
handled by layer1
DATA PACKET
Header:
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 - 0 |
0 | Parity | 0 (reserved) | READ&!WRITE | Packetsize |
Packet:
Header | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 |
0X0XXXXX | DATA | DATA (optional) | DATA (optional) | DATA (optional) | DATA (optional) | DATA (optional) | DATA (optional) | DATA (optional) |
Note: READ&!WRITE is the direction of data transfers
handled by userprogram
COMMANDS[Bearbeiten | Quelltext bearbeiten]
all "get" commands load data into the out_buffer & change status to ready for read
all "set" commands store data into the in_buffer & change status to !ready for write
Note:
querry status first !
0x00
invalid (reserved)
0x01 PING
copies complement of inputbuffer to outputbuffer
to run bus-speed-test
0x02 GET AENDPOINT DESCRIPTOR
2.byte: endpoint
returns information about any endpoint
can be display, soundd. ,networkd. ,inputd. ...
must be less then max. device endpoints
Endpoint 0 GET DEVICE DESCRIPTOR
returns information about the device
Header | DATA1 | DATA2 | DATA3 |
protocol version | endpoint count | - |
0x03 SET CURRENT ENDPOINT
2.byte: endpoint
must be less then max. device endpoints
0x04 GET CURRENT ENDPOINT
return active endpoint (default: 0)
0x05 GET CENDPOINT STATUS
return current endpoint status, for example:
ready for read
ready for write
packet was dropped
packet was invalid
...
0x06 CONFIGURE ENDPOINT
manage power, enable/disable endpoint
...
0x07 GET AENDPOINT STATUS
return any endpoint status
2.byte: endpoint
for example:
ready for read
ready for write
...
DATA PACKET[Bearbeiten | Quelltext bearbeiten]
Data packets are stored in the in_buffer of the current endpoint if READ/!WRITE is 0 & buffer is ready. The users programm is notified that theres new data.
Data packets are read from the out_buffer of the current endpoint if READ/!WRITE is 1 & buffer is ready. Packet-length field should be ignored. The users programm is notified that the host request new data.
Device Response[Bearbeiten | Quelltext bearbeiten]
Header is ==0 NO VALID DATA
the buffer you read from was not ready
Header is > 0 DATA
VALID:
data-packet length should be greater than 0
packet parity does match
INVALID:
data-packet length is 0
packet parity doesn't match