-
Notifications
You must be signed in to change notification settings - Fork 178
Initial draft of the HAL USBPhy API #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fill in the USB contributing page for the HAL USBPhy API.
Complete initial copy edit, mostly for active voice and formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some queries related to passive voice for you to address.
- You can use all endpoints in any valid endpoint configuration concurrently. | ||
- The device supports use of at least one control, bulk, interrupt and isochronous in each direction at the same time - at least 8 endpoints. | ||
- The device supports all standard endpoint sizes (wMaxPacketSize). | ||
- The device can handle an interrupt latency of at least 100ms if reset is not being performed and address is not being set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what is not performing the reset? Also, who or what is not sending the address? You, the user?
- The device supports use of at least one control, bulk, interrupt and isochronous in each direction at the same time - at least 8 endpoints. | ||
- The device supports all standard endpoint sizes (wMaxPacketSize). | ||
- The device can handle an interrupt latency of at least 100ms if reset is not being performed and address is not being set. | ||
- USBPhyEvents events are only sent when USBPhy is in the initialized state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what sends USBPhyEvents?
- The device supports all standard endpoint sizes (wMaxPacketSize). | ||
- The device can handle an interrupt latency of at least 100ms if reset is not being performed and address is not being set. | ||
- USBPhyEvents events are only sent when USBPhy is in the initialized state. | ||
- When unpowered, only the `USBPhyEvents::power` event can be sent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what sends the USBPhyEvents::power event?
- The device can handle an interrupt latency of at least 100ms if reset is not being performed and address is not being set. | ||
- USBPhyEvents events are only sent when USBPhy is in the initialized state. | ||
- When unpowered, only the `USBPhyEvents::power` event can be sent. | ||
- On USB reset, all endpoints are removed except for endpoint 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what removes all endpoints? Does the USB reset do this, or is that correlation?
- When unpowered, only the `USBPhyEvents::power` event can be sent. | ||
- On USB reset, all endpoints are removed except for endpoint 0. | ||
- `USBPhyEvents::out` and `USBPhyEvents::in` events only occur for endpoints that you have added. | ||
- A call to `USBPhy::ep0_write` results in `USBPhyEvents::in` being called if not interrupted by a power loss or reset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what calls USBPhyEvents::in?
- On USB reset, all endpoints are removed except for endpoint 0. | ||
- `USBPhyEvents::out` and `USBPhyEvents::in` events only occur for endpoints that you have added. | ||
- A call to `USBPhy::ep0_write` results in `USBPhyEvents::in` being called if not interrupted by a power loss or reset. | ||
- A call to `endpoint_read` followed by `endpoint_read_result` results in `USBPhyEvents::out` being called if not interrupted by a power loss or reset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what calls USBPhyEvents::out?
- `USBPhyEvents::out` and `USBPhyEvents::in` events only occur for endpoints that you have added. | ||
- A call to `USBPhy::ep0_write` results in `USBPhyEvents::in` being called if not interrupted by a power loss or reset. | ||
- A call to `endpoint_read` followed by `endpoint_read_result` results in `USBPhyEvents::out` being called if not interrupted by a power loss or reset. | ||
- Endpoint 0 naks all transactions aside from setup packets until one of `ep0_read`, `ep0_write` or `ep0_stall` has been called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what calls ep0_read, ep0_write or ep0_stall?
|
||
##### Notes | ||
|
||
[Include any potential trouble areas in bullet format here.] | ||
- Make sure USB packets are processed in the correct order when multiple packets are present. IN endpoints should be handled before OUT endpoints if both are pending. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what processes the USB packets?
|
||
##### Notes | ||
|
||
[Include any potential trouble areas in bullet format here.] | ||
- Make sure USB packets are processed in the correct order when multiple packets are present. IN endpoints should be handled before OUT endpoints if both are pending. | ||
- Setup packets may be resent if there is noise on the USB line. The USBPhy should be able to handle this scenario and respond to the setup packet with an ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Who or what resends setup packets?
Change passive to active voice.
Add embedded Doxygen class reference, and add warning for feature-branch docs.
Fill in the USB contributing page for the HAL USBPhy API.