USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Committer:
Kojto
Date:
Thu Jul 20 10:14:36 2017 +0100
Revision:
70:2c525a50f1b6
Parent:
47:a0cd9646ecd1
Update libraries (ed9d1da)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 8:335f2506f422 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
samux 8:335f2506f422 2 *
samux 8:335f2506f422 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
samux 8:335f2506f422 4 * and associated documentation files (the "Software"), to deal in the Software without
samux 8:335f2506f422 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
samux 8:335f2506f422 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
samux 8:335f2506f422 7 * Software is furnished to do so, subject to the following conditions:
samux 8:335f2506f422 8 *
samux 8:335f2506f422 9 * The above copyright notice and this permission notice shall be included in all copies or
samux 8:335f2506f422 10 * substantial portions of the Software.
samux 8:335f2506f422 11 *
samux 8:335f2506f422 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
samux 8:335f2506f422 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
samux 8:335f2506f422 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
samux 8:335f2506f422 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
samux 8:335f2506f422 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
samux 8:335f2506f422 17 */
samux 8:335f2506f422 18
Kojto 70:2c525a50f1b6 19 #define NUMBER_OF_LOGICAL_ENDPOINTS (4)
samux 8:335f2506f422 20 #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2)
samux 8:335f2506f422 21
samux 8:335f2506f422 22 /* Define physical endpoint numbers */
samux 8:335f2506f422 23
samux 8:335f2506f422 24 /* Endpoint No. */
samux 8:335f2506f422 25 /* ---------------- */
mbed_official 25:7c72828865f3 26 #define EP0OUT (0)
mbed_official 25:7c72828865f3 27 #define EP0IN (1)
mbed_official 25:7c72828865f3 28 #define EP1OUT (2)
mbed_official 25:7c72828865f3 29 #define EP1IN (3)
mbed_official 25:7c72828865f3 30 #define EP2OUT (4)
mbed_official 25:7c72828865f3 31 #define EP2IN (5)
mbed_official 25:7c72828865f3 32 #define EP3OUT (6)
mbed_official 25:7c72828865f3 33 #define EP3IN (7)
samux 8:335f2506f422 34
samux 8:335f2506f422 35 /* Maximum Packet sizes */
samux 8:335f2506f422 36
samux 8:335f2506f422 37 #define MAX_PACKET_SIZE_EP0 (64)
samux 8:335f2506f422 38 #define MAX_PACKET_SIZE_EP1 (64)
samux 8:335f2506f422 39 #define MAX_PACKET_SIZE_EP2 (64)
samux 8:335f2506f422 40 #define MAX_PACKET_SIZE_EP3 (1023)
samux 8:335f2506f422 41
samux 8:335f2506f422 42 /* Generic endpoints - intended to be portable accross devices */
samux 8:335f2506f422 43 /* and be suitable for simple USB devices. */
samux 8:335f2506f422 44
samux 8:335f2506f422 45 /* Bulk endpoints */
samux 8:335f2506f422 46 #define EPBULK_OUT (EP2OUT)
samux 8:335f2506f422 47 #define EPBULK_IN (EP2IN)
mbed_official 47:a0cd9646ecd1 48 #define EPBULK_OUT_callback EP2_OUT_callback
mbed_official 47:a0cd9646ecd1 49 #define EPBULK_IN_callback EP2_IN_callback
samux 8:335f2506f422 50 /* Interrupt endpoints */
samux 8:335f2506f422 51 #define EPINT_OUT (EP1OUT)
samux 8:335f2506f422 52 #define EPINT_IN (EP1IN)
mbed_official 47:a0cd9646ecd1 53 #define EPINT_OUT_callback EP1_OUT_callback
mbed_official 47:a0cd9646ecd1 54 #define EPINT_IN_callback EP1_IN_callback
samux 8:335f2506f422 55 /* Isochronous endpoints */
samux 8:335f2506f422 56 #define EPISO_OUT (EP3OUT)
samux 8:335f2506f422 57 #define EPISO_IN (EP3IN)
mbed_official 47:a0cd9646ecd1 58 #define EPISO_OUT_callback EP3_OUT_callback
mbed_official 47:a0cd9646ecd1 59 #define EPISO_IN_callback EP3_IN_callback
samux 8:335f2506f422 60
samux 8:335f2506f422 61 #define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
samux 8:335f2506f422 62 #define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
samux 8:335f2506f422 63 #define MAX_PACKET_SIZE_EPISO (MAX_PACKET_SIZE_EP3)