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