USBDevice stack

Dependents:   erg USBSerial_HelloWorld Slingshot SuperScanner ... more

Committer:
samux
Date:
Wed May 30 18:28:11 2012 +0000
Revision:
0:140cdf8e2d60

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 0:140cdf8e2d60 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
samux 0:140cdf8e2d60 2 *
samux 0:140cdf8e2d60 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
samux 0:140cdf8e2d60 4 * and associated documentation files (the "Software"), to deal in the Software without
samux 0:140cdf8e2d60 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
samux 0:140cdf8e2d60 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
samux 0:140cdf8e2d60 7 * Software is furnished to do so, subject to the following conditions:
samux 0:140cdf8e2d60 8 *
samux 0:140cdf8e2d60 9 * The above copyright notice and this permission notice shall be included in all copies or
samux 0:140cdf8e2d60 10 * substantial portions of the Software.
samux 0:140cdf8e2d60 11 *
samux 0:140cdf8e2d60 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
samux 0:140cdf8e2d60 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
samux 0:140cdf8e2d60 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
samux 0:140cdf8e2d60 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
samux 0:140cdf8e2d60 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
samux 0:140cdf8e2d60 17 */
samux 0:140cdf8e2d60 18
samux 0:140cdf8e2d60 19 #ifndef USBENDPOINTS_H
samux 0:140cdf8e2d60 20 #define USBENDPOINTS_H
samux 0:140cdf8e2d60 21
samux 0:140cdf8e2d60 22 /* SETUP packet size */
samux 0:140cdf8e2d60 23 #define SETUP_PACKET_SIZE (8)
samux 0:140cdf8e2d60 24
samux 0:140cdf8e2d60 25 /* Options flags for configuring endpoints */
samux 0:140cdf8e2d60 26 #define DEFAULT_OPTIONS (0)
samux 0:140cdf8e2d60 27 #define SINGLE_BUFFERED (1U << 0)
samux 0:140cdf8e2d60 28 #define ISOCHRONOUS (1U << 1)
samux 0:140cdf8e2d60 29 #define RATE_FEEDBACK_MODE (1U << 2) /* Interrupt endpoints only */
samux 0:140cdf8e2d60 30
samux 0:140cdf8e2d60 31 /* Endpoint transfer status, for endpoints > 0 */
samux 0:140cdf8e2d60 32 typedef enum {
samux 0:140cdf8e2d60 33 EP_COMPLETED, /* Transfer completed */
samux 0:140cdf8e2d60 34 EP_PENDING, /* Transfer in progress */
samux 0:140cdf8e2d60 35 EP_INVALID, /* Invalid parameter */
samux 0:140cdf8e2d60 36 EP_STALLED, /* Endpoint stalled */
samux 0:140cdf8e2d60 37 } EP_STATUS;
samux 0:140cdf8e2d60 38
samux 0:140cdf8e2d60 39 /* Include configuration for specific target */
samux 0:140cdf8e2d60 40 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
samux 0:140cdf8e2d60 41 #include "USBEndpoints_LPC17_LPC23.h"
samux 0:140cdf8e2d60 42 #elif defined(TARGET_LPC11U24)
samux 0:140cdf8e2d60 43 #include "USBEndpoints_LPC11U.h"
samux 0:140cdf8e2d60 44 #else
samux 0:140cdf8e2d60 45 #error "Unknown target type"
samux 0:140cdf8e2d60 46 #endif
samux 0:140cdf8e2d60 47
samux 0:140cdf8e2d60 48 #endif