USBDevice for STM support

Dependents:   Nucleo_Usb_JoyMouse Nucleo_usbmouse ELEC350_1-referral-2018-usb-hid USBJoystick_HelloWorld2_wip ... more

This library contains all mbed usb device library (mbed-os\features\unsupported\USBDevice).

Committer:
frq08711@LMECWL0871.LME.ST.COM
Date:
Tue Mar 28 11:00:57 2017 +0200
Branch:
master
Revision:
4:50ec00aa4515
Parent:
3:d9c7334e2183
update for 5.4.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 2 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 4 * and associated documentation files (the "Software"), to deal in the Software without
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 7 * Software is furnished to do so, subject to the following conditions:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 8 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 9 * The above copyright notice and this permission notice shall be included in all copies or
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 10 * substantial portions of the Software.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 11 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 17 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 18
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 19 #ifndef USBENDPOINTS_H
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 20 #define USBENDPOINTS_H
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 21
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 22 /* SETUP packet size */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 23 #define SETUP_PACKET_SIZE (8)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 24
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 25 /* Options flags for configuring endpoints */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 26 #define DEFAULT_OPTIONS (0)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 27 #define SINGLE_BUFFERED (1U << 0)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 28 #define ISOCHRONOUS (1U << 1)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 29 #define RATE_FEEDBACK_MODE (1U << 2) /* Interrupt endpoints only */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 30
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 31 /* Endpoint transfer status, for endpoints > 0 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 32 typedef enum {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 33 EP_COMPLETED, /* Transfer completed */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 34 EP_PENDING, /* Transfer in progress */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 35 EP_INVALID, /* Invalid parameter */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 36 EP_STALLED, /* Endpoint stalled */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 37 } EP_STATUS;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 38
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 39 /* Include configuration for specific target */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 40 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460) || defined(TARGET_LPC4088_DM)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 41 #include "USBEndpoints_LPC17_LPC23.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 42 #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347) || defined (TARGET_LPC11U6X) || defined (TARGET_LPC1549)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 43 #include "USBEndpoints_LPC11U.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 44 #elif defined(TARGET_KL25Z) | defined(TARGET_KL26Z) | defined(TARGET_KL27Z) | defined(TARGET_KL43Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D50M) | defined(TARGET_K64F) | defined(TARGET_K22F) | defined(TARGET_TEENSY3_1)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 45 #include "USBEndpoints_KL25Z.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 46 #elif !defined(USB_STM_HAL) && defined(TARGET_STM32F4)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 47 #include "USBEndpoints_STM32F4.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 48 #elif defined (TARGET_STM32F4) || defined (TARGET_STM32F2) || defined (TARGET_STM32F7) || defined (TARGET_STM32F3) || defined(TARGET_STM32L4)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 49 #include "USBEndpoints_STM32.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 50 #elif defined (TARGET_RZ_A1H) || defined (TARGET_VK_RZ_A1H)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 51 #include "USBEndpoints_RZ_A1H.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 52 #elif defined(TARGET_Maxim)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 53 #include "USBEndpoints_Maxim.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 54 #elif defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32WG_STK3800) || defined(TARGET_EFM32HG_STK3400)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 55 #include "USBEndpoints_EFM32.h"
frq08711@LMECWL0871.LME.ST.COM 3:d9c7334e2183 56 #elif defined(TARGET_NUMAKER_PFM_NUC472)
frq08711@LMECWL0871.LME.ST.COM 3:d9c7334e2183 57 #include "USBEndpoints_NUC472.h"
frq08711@LMECWL0871.LME.ST.COM 3:d9c7334e2183 58 #elif defined(TARGET_NUMAKER_PFM_M453)
frq08711@LMECWL0871.LME.ST.COM 3:d9c7334e2183 59 #include "USBEndpoints_M453.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 60 #else
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 61 #error "Unknown target type"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 62 #endif
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 63
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 64 #endif