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
[Silicon Labs] Add support for USBDevice #1287
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Overview This commit provides USB device-mode drivers for Silicon Labs chips. The code is based on the SiLabs USB driver that is part of the Simplicity dev environment. Because Mbed USBDevice class wants to control the USB transactions itself, large parts of the higher level code originally present in the driver have been stripped out. An attempt has been made to keep Mbed code separate enough that patches can be applied with minor effort, if needed. ** Use of dynamic memory Due to requirements imposed by the USB hardware, the driver needs read and write buffers for every enabled endpoint. Since information on what EPs will be used is only available during runtime, dynamic memory allocation is used to minimize memory usage. If needed, dynamic memory use can be disabled via a flag in usbconfig.h. In this case, please read the documentation to see what limitations this imposes. Static memory usage can also be reduced by limiting the maximum number of active endpoints - see configuration in usbconfig.h and USBEndpoints_EFM32.h. ** Power management Driver supports the new SiLabs functionality in Mbed sleep(). Normal sleep (EM1) is always available, and deep sleep (EM2) is available when USB is either disconnected or suspended. How and when different sleep modes are made possible can be configured in usbconfig.h ** Supported hardware Current release officially supports, and has only been tested on Giant Gecko. Upcoming releases will add support for other SiLabs platforms on Mbed.
USB device support for Wonder, Leopard and Happy Gecko. See details on configuration etc on the previous commit. Known issue: USBAudio does not work reliably on Happy Gecko.
Everything should be copyrighted to SiLabs, and licensed under Apache 2.0.
Zero Gecko has no USB support, so don't even try to compile for it.
Use correct function when resetting endpoint 0 (on stall etc) on Happy Gecko.
No USB in Zero Gecko so removed also from here for the sake of clarity.
Happy only has 3 endpoints, so flag out the rest.
Happy Gecko's USB Low Energy Mode does not work properly with isochronous endpoints. Note that Happy Gecko errata USB_E112 states: Do not use the SUSPEND mode of LEMOSCCTRL in USB_CTRL. In rare cases with high data throughput, a transmission can fail when this mode is enabled. Use the GATED mode of LEMOSCCTRL for the best energy efficiency. The NONE mode can be used to disable energy savings However, even using GATE mode causes problems for high-frequency isochronous transfers. The primary effect for OUT endpoints is that the first read will succeed, and the following one (targetting the next frame) will fail with zero bytes incoming data, and PKTDRPSTS is set in the related interrupt status register. Disabling LEMOSCCTRL (set to NONE) solves the problem. Since this will cause increased energy usage, do this only when an ISOC endpoint is added.
Thanks, LGTM |
0xc0170
added a commit
that referenced
this pull request
Aug 13, 2015
Silicon Labs - Add support for USBDevice
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds initial support for adding USBDevice capabilities to Silicon Labs Wonder/Giant/Leopard and Happy Gecko platforms.
There is one outstanding bug impacting this pull request:
#1284