summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_isochronous.c
Commit message (Collapse)AuthorAgeFilesLines
* usb_isochronous.c: change usb_isochronous APIWei-Han Chen2018-07-181-14/+35
| | | | | | | | | | | | | | | | | | 1. Export usb_isochronous_write_buffer function. 2. The tx_callback is called in interrupt context, so users can decide to fill the buffer with deferred function or task thread. 3. Allow adding extra endpoints to the interface. BRANCH=none BUG=b:70482333 TEST=tested on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I7bc7f8175803895dae8ebc7720bc7e468db20d1c Reviewed-on: https://chromium-review.googlesource.com/1089599 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* stm32: add usb_isochronousWei-Han Chen2018-01-311-0/+142
Templates for USB isochronous implementation. Current implementation only supports TX transmit. Example of usage can be found in CL:803414. Basically, declare an USB isochronous interface by USB_ISOCHRONOUS_CONFIG_FULL(<NAME>, <INTERFACE_NUM>, <USB_CLASS>, <USB_SUBCLASS>, <SUB_PROTOCOL>, <USB_STR_FOR_INTERFACE_NAME>, <USB_EP_NUM>, <PACKET_SIZE>, <TX_CALLBACK>, <SET_INTERFACE>) where <PACKET_SIZE> is size of each USB packet, <TX_CALLBACK> is called when USB hardware has completed a packet. The buffer that USB is not currently using will be passed to <TX_CALLBACK>, allow applications to write next packet to it. When a SET_INTERFACE packet is received, <SET_INTERFACE> will be called with bAlternateSetting and bInterfaceNumber. We will declare interface descriptor with bAlternateSetting = 0 and 1 for you, if you need more alternate settings, you need to declare by yourself. BUG=b:70482333 TEST=manually on reworked staff board Signed-off-by: Wei-Han Chen <stimim@google.com> Change-Id: Ic6d41da6ddd7945edf0bdfff55ede38a97661783 Reviewed-on: https://chromium-review.googlesource.com/818853 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>