; This file defines the transfers from a serial device ;
[Protocol]
name = SerialBus bitwise
[DEBUG]
;DebugOn ; Uncomment this to turn on Debug Packets
[Packet] [Start]
type = value ; Look for a value in the data to start the packet
value = 6211h ; NOTE: This value is assumed MSbit first in ; the data stream!
bits = 16 mask = FFFFh [End]
type = length
bitlength = 64 ; End of command after 64 bits [Decode]
[Fields]
; Send out the bits of the packet
106 USBee DX Test Pod User’s Manual
USB PROTOCOL EXAMPLE
; USB Bus Protocol Definition File
; This file defines the transfers to/from a custom USB device ;
[Protocol]
name = USBBus bitwise [DEBUG]
;DebugOn ; Uncomment this to turn on Debug Packets [Packet]
[Start]
type = event
event = 1 ; Setup/In or Out found [End]
type = event
event = 6 ; ACK, NAK or Stall found or no handshake found [Decode]
[Fields]
; Any Packet - No Response
Fields Sync.8.i, PID.8.L, Addr.7l.d, EP.4l.d, CRC5.5.i, ; Token [4] ; No Handshake ; Setup – Nakd ; Token
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, HS.8=01011010b.L ; Handshake
; IN - Nakd
Fields Sync.8.i, PID.8=10010110b.L, Addr.7L.d, EP.4L.d, CRC5.5.i, Sync.8.i, HS.8=01011010b.L ; Handshake
; OUT - Nakd
Fields Sync.8.i, PID.8=10000111b.L, Addr.7L.d, EP.4L.d, CRC5.5.i, Sync.8.i, HS.8=01011010b.L ; Handshake
; Setup
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=1.$Clear Feature, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=0.$Get Status, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=8.$Get Configuration, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=6.$Get Descriptor, bValueL.8L.I, Type.8L.L, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i,
Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=16.$Get Interface, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=5.$Set Address, Address.16L.h, bLength.16L.i, bLength.16L.i, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=9.$Set Configuration, Config.16L.h,
bLength.16L.i, bLength.16L.i, CRC16.16.i, Sync.8.i, HS.8.L Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i,
Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=7.$Set Descriptor, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=3.$Set Feature, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=10.$Get Interface, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i, Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=11.$Set Interface, AltSetting.16L.h,
Interface.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L Fields Sync.8.i, PID.8=10110100b.L, Addr.7l.d, EP.4l.d, CRC5.5.i,
Sync.8.i, PID.8.L, Rtype.8.i,
bRequest.8L=12.$Sync Frame, bValue.16L.h, bIndex.16L.H, bLength.16L.H, CRC16.16.i, Sync.8.i, HS.8.L
; IN
Fields Sync.8.i, PID.8=10010110b.L, Addr.7L.d, EP.4L.d, CRC5.5.i, Sync.8.i, PID.8.L, InData.NL.h, CRC16.16.i, ; Data Sync.8.i, HS.8.L ; Handshake ; OUT
Fields Sync.8.i, PID.8=10000111b.L, Addr.7L.d, EP.4L.d, CRC5.5.i, Sync.8.i, PID.8.L, OutData.NL.h, CRC16.16.i, ; Data Sync.8.i, HS.8.L ; Handshake ; Catch all Fields Data.NL.h Lookup Type [1]=$Device [2]=$Config [3]=$String Lookup PID [11000011b]=$DATA0 [11010010b]=$DATA1 [01001011b]=$ACK [01011010b]=$NAK [01111000b]=$STALL [10110100b]=$SETUP [10000111b]=$OUT [10010110b]=$IN [10100101b]=$SOF Lookup HS [01001011b]=$ACK [01011010b]=$NAK [01111000b]=$STALL