Benutzer:Siro/i2cprotokoll: Unterschied zwischen den Versionen
Siro (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<b>I2C Protokoll</b> DEF:<br> layer0 Hardwareebene (i2c)<br> layer1 Packetebene<br> endpoint externe Hardware (nicht näher definiert) Vorderungen: <li> Alle …“) |
Siro (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
<b>I2C Protokoll</b> | == <b>I2C Protokoll</b> == | ||
Version 0.1 | |||
Vorderungen | == DEFINITIONS == | ||
<table> | |||
<tr><td>layer0</td><td>Hardwareebene (i2c)</td></tr> | |||
<tr><td>layer1</td><td>Packetebene</td></tr> | |||
<tr><td>endpoint </td><td>externe Hardware (nicht näher definiert)</td></tr> | |||
</table> | |||
<br> | |||
== Vorderungen == | |||
<li> Alle Devices sollen die max. Busgeschwindigkeit verwenden | <li> Alle Devices sollen die max. Busgeschwindigkeit verwenden | ||
<li> Alle Daten werden in | <li> Alle Daten werden in Paketen übertragen | ||
<li> Alle Daten werden vom Master "gepollt" | <li> Alle Daten werden vom Master "gepollt" | ||
<li> Alle Devices können bis zu 254 Endpoints haben | <li> Alle Devices können bis zu 254 Endpoints haben (<i>Endpoint 0 reserved</i>) | ||
< | |||
== <i>Packet</i> == | |||
<table border='1'><tr><td>Header</td><td>Data</td></tr><tr><td>1 Byte</td><td>1-8 Byte</td></tr></table> | <table border='1'><tr><td>Header</td><td>Data</td></tr><tr><td>1 Byte</td><td>1-8 Byte</td></tr></table> | ||
Zeile 32: | Zeile 38: | ||
handled by userprogram<br> | handled by userprogram<br> | ||
<br> | <br> | ||
== COMMANDS == | |||
<br> | |||
<b>0x00</b><br> | <b>0x00</b><br> | ||
NOP<br> | NOP<br> | ||
<b>0x01</b><br> | <b>0x01</b><br> | ||
GET DEVICE INFO<br> | GET DEVICE INFO<br> | ||
returns information about the device<br> | |||
max supported protocol version<br> | |||
endpoint count<br> | |||
...<br> | |||
<b>0x02</b><br> | <b>0x02</b><br> | ||
GET ENDPOINT INFO<br> | GET ENDPOINT INFO<br> | ||
2.byte: endpoint<br> | 2.byte: endpoint<br> | ||
returns information about the endpoint<br> | |||
must be less then max. device endpoints<br> | |||
<b>0x03</b><br> | <b>0x03</b><br> | ||
SET ENDPOINT<br> | SET ENDPOINT<br> | ||
2.byte: endpoint<br> | 2.byte: endpoint<br> | ||
must be less then max. device endpoints<br> | |||
<b>0x04</b><br> | <b>0x04</b><br> | ||
GET CURRENT ENDPOINT<br> | GET CURRENT ENDPOINT<br> | ||
return active endpoint (default: 0)<br> | |||
<b>0x05</b><br> | <b>0x05</b><br> | ||
SEND DATA<br> | SEND DATA<br> | ||
sends data to current endpoint (default: 0)<br> | |||
<b>0x05</b><br> | <b>0x05</b><br> | ||
GET DATA<br> | GET DATA<br> | ||
get data to current endpoint (default: 0)<br> |
Version vom 28. Januar 2010, 21:38 Uhr
I2C Protokoll
Version 0.1
DEFINITIONS
layer0 | Hardwareebene (i2c) |
layer1 | Packetebene |
endpoint | externe Hardware (nicht näher definiert) |
Vorderungen
Packet
Header | Data |
1 Byte | 1-8 Byte |
Header:
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 - 0 |
reserved | reserved | Command/!Data | Parity | Packetsize |
Note: Parity can be EVEN, ODD, XOR, NONE, Parity does include packetsize-Bits and all DATA
Note: Command/!DATA marks this packet as COMMAND packet or as DATA packet
COMMAND PACKET
COMMAND PACKET: size >= 1
1. byte: COMMAND
2. - 8. byte:DATA (optional)
handled by layer1
DATA PACKET
handled by userprogram
COMMANDS
0x00
NOP
0x01
GET DEVICE INFO
returns information about the device
max supported protocol version
endpoint count
...
0x02
GET ENDPOINT INFO
2.byte: endpoint
returns information about the endpoint
must be less then max. device endpoints
0x03
SET ENDPOINT
2.byte: endpoint
must be less then max. device endpoints
0x04
GET CURRENT ENDPOINT
return active endpoint (default: 0)
0x05
SEND DATA
sends data to current endpoint (default: 0)
0x05
GET DATA
get data to current endpoint (default: 0)