USB device stack, fixes for USBSerial & KL25Z

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)
00041 #include "USBEndpoints_LPC17_LPC23.h"
00042 #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347)
00043 #include "USBEndpoints_LPC11U.h"
00044 #elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) | defined(TARGET_K64F)
00045 #include "USBEndpoints_KL25Z.h"
00046 #elif defined (TARGET_STM32F4XX)
00047 #include "USBEndpoints_STM32F4.h"
00048 #else
00049 #error "Unknown target type"
00050 #endif
00051 
00052 #endif