USB device stack

Dependents:   blinky_max32630fthr FTHR_USB_serial FTHR_OLED HSP_RPC_GUI_3_0_1 ... more

Fork of USBDevice by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers USBEndpoints.h Source File

USBEndpoints.h

00001 /* Copyright (c) 2010-2011 mbed.org, MIT License
00002 *
00003 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
00004 * and associated documentation files (the "Software"), to deal in the Software without
00005 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
00006 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
00007 * Software is furnished to do so, subject to the following conditions:
00008 *
00009 * The above copyright notice and this permission notice shall be included in all copies or
00010 * substantial portions of the Software.
00011 *
00012 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
00013 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00014 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00015 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00016 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00017 */
00018 
00019 #ifndef USBENDPOINTS_H
00020 #define USBENDPOINTS_H
00021 
00022 /* SETUP packet size */
00023 #define SETUP_PACKET_SIZE (8)
00024 
00025 /* Options flags for configuring endpoints */
00026 #define DEFAULT_OPTIONS     (0)
00027 #define SINGLE_BUFFERED     (1U << 0)
00028 #define ISOCHRONOUS         (1U << 1)
00029 #define RATE_FEEDBACK_MODE  (1U << 2) /* Interrupt endpoints only */
00030 
00031 /* Endpoint transfer status, for endpoints > 0 */
00032 typedef enum {
00033     EP_COMPLETED,   /* Transfer completed */
00034     EP_PENDING,     /* Transfer in progress */
00035     EP_INVALID,     /* Invalid parameter */
00036     EP_STALLED,     /* Endpoint stalled */
00037 } EP_STATUS;
00038 
00039 /* Include configuration for specific target */
00040 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC2460) || defined(TARGET_LPC4088_DM)
00041 #include "USBEndpoints_LPC17_LPC23.h"
00042 #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347) || defined (TARGET_LPC11U6X) || defined (TARGET_LPC1549)
00043 #include "USBEndpoints_LPC11U.h"
00044 #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)
00045 #include "USBEndpoints_KL25Z.h"
00046 #elif defined (TARGET_STM32F4)
00047 #include "USBEndpoints_STM32F4.h"
00048 #elif defined (TARGET_RZ_A1H) || defined (TARGET_VK_RZ_A1H)
00049 #include "USBEndpoints_RZ_A1H.h"
00050 #elif defined(TARGET_Maxim)
00051 #include "USBEndpoints_Maxim.h"
00052 #elif defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32WG_STK3800) || defined(TARGET_EFM32HG_STK3400)
00053 #include "USBEndpoints_EFM32.h"
00054 #else
00055 #error "Unknown target type"
00056 #endif
00057 
00058 #endif