Benutzer:Siro/i2cprotokoll: Unterschied zwischen den Versionen

Aus LaborWiki
Wechseln zu: Navigation, Suche
KKeine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 62: Zeile 62:
return active endpoint (default: 0)<br>
return active endpoint (default: 0)<br>
<b>0x05</b><br>
<b>0x05</b><br>
SEND DATA<br>
 
sends data to current endpoint (default: 0)<br>
<b>0x06</b><br>
<b>0x06</b><br>
GET DATA<br>
get data to current endpoint (default: 0)<br>

Version vom 29. Januar 2010, 00:34 Uhr

I2C Protokoll

Version 0.1


DEFINITIONS

layer0Hardwareebene (i2c)
layer1Packetebene
endpoint    externe Hardware (nicht näher definiert)


Vorderungen

  • Alle Devices sollen die max. Busgeschwindigkeit verwenden
  • Alle Daten werden in Paketen übertragen
  • Alle Daten werden vom Master "gepollt"
  • Alle Devices können bis zu 254 Endpoints haben (Endpoint 0 reserved)

    Packet

    HeaderData
    1 Byte1-8 Byte

    Header:

    Bit 7Bit 6Bit 5Bit 4Bit 3 - 0
    reservedreservedCommand/!DataParityPacketsize

    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

    0x06