Skip to content

Commit 73084e0

Browse files
committed
Add additional USBPhy defined behavior
Add additional requirements to the defined and undefined behavior of USBPhy.
1 parent 33f45c6 commit 73084e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

platform/USBPhy.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,23 @@
3131
* isochronous in each direction at the same time - at least 8 endpoints.
3232
* * Device supports all standard endpoint sizes (wMaxPacketSize)
3333
* * Device can handle an interrupt latency of at least 100ms if reset is not being performed and address is not being set
34+
* * USBPhyEvents events are only sent when USBPhy is in the initialized state
35+
* * When unpowered only the USBPhyEvents::power event can be sent
36+
* * On USB reset all endpoints are removed except for endpoint 0
37+
* * USBPhyEvents::out and USBPhyEvents::in events only occur for endpoints which have been added
38+
* * A call to USBPhy::ep0_write results in USBPhyEvents::in getting called if not
39+
* interrupted by a power loss or reset
40+
* * A call to endpoint_read followed by endpoint_read_result results in USBPhyEvents::out getting called if not
41+
* interrupted by a power loss or reset
42+
* * Endpoint 0 naks all transactions aside from setup packets until one
43+
* of ep0_read, ep0_write or ep0_stall has been called
44+
* * Endpoint 0 stall is automatically cleared on reception of a setup packet
3445
*
3546
* # Undefined behavior
3647
* * Calling USBPhy::endpoint_add or USBPhy::endpoint_remove outside of the control requests SetInterface or SetConfiguration
3748
* * Devices behavior is undefined if latency is greater than 2ms when address is being set - see USB spec 9.2.6.3
3849
* * Devices behavior is undefined if latency is greater than 10ms when a reset occurs - see USB spec 7.1.7.5
50+
* * Calling any of the USBPhy::endpoint_* functions on endpoint 0
3951
*
4052
* # Potential bugs
4153
* * Processing control packets in the wrong order when multiple packets are present

0 commit comments

Comments
 (0)