A copy of the mbed USBDevice with USBSerial library

Dependents:   STM32L0_LoRa Smartage STM32L0_LoRa Turtle_RadioShuttle

Committer:
Helmut Tschemernjak
Date:
Sun Feb 24 14:52:33 2019 +0100
Revision:
8:961423d1da74
Parent:
0:a3ea811f80f2
Added sleep manager support to avoids sleeps while a USB CDC
connection is active

Who changed what in which revision?

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