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
Update libraries (ed9d1da)

Who changed what in which revision?

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