2 * @brief USB mode and feature support definitions
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * Copyright(C) Dean Camera, 2011, 2012
\r
7 * All rights reserved.
\r
10 * Software that is described herein is for illustrative purposes only
\r
11 * which provides customers with programming information regarding the
\r
12 * LPC products. This software is supplied "AS IS" without any warranties of
\r
13 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
14 * all warranties, express or implied, including all implied warranties of
\r
15 * merchantability, fitness for a particular purpose and non-infringement of
\r
16 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
17 * or liability for the use of the software, conveys no license or rights under any
\r
18 * patent, copyright, mask work right, or any other intellectual property rights in
\r
19 * or to any products. NXP Semiconductors reserves the right to make changes
\r
20 * in the software without notification. NXP Semiconductors also makes no
\r
21 * representation or warranty that such application will be suitable for the
\r
22 * specified use without further testing or modification.
\r
25 * Permission to use, copy, modify, and distribute this software and its
\r
26 * documentation is hereby granted, under NXP Semiconductors' and its
\r
27 * licensor's relevant copyrights in the software, without fee, provided that it
\r
28 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
29 * copyright, permission, and disclaimer notice must appear in all copies of
\r
33 /** @ingroup Group_USB
\r
34 * @defgroup Group_USBMode USB Mode Tokens
\r
35 * @brief USB mode and feature support definitions.
\r
37 * This file defines macros indicating the type of USB controller the library is being compiled for, and its
\r
38 * capabilities. These macros may then be referenced in the user application to selectively enable or disable
\r
39 * code sections depending on if they are defined or not.
\r
41 * After the inclusion of the master USB driver header, one or more of the following tokens may be defined, to
\r
42 * allow the user code to conditionally enable or disable code based on the USB controller family and allowable
\r
43 * USB modes. These tokens may be tested against to eliminate code relating to a USB mode which is not enabled for
\r
44 * the given compilation.
\r
49 #ifndef __USBMODE_H__
\r
50 #define __USBMODE_H__
\r
52 /* Enable C linkage for C++ Compilers: */
\r
53 #if defined(__cplusplus)
\r
57 /* Preprocessor Checks: */
\r
58 #if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
59 #error Do not include this file directly. Include /software/LPCUSBLib/Drivers/USB/USB.h instead.
\r
62 #include "../../../LPCUSBlibConfig.h"
\r
64 /* Public Interface - May be used in end-application: */
\r
65 #if defined(__DOXYGEN__)
\r
67 /** Indicates that the target microcontroller and compilation settings allow for the
\r
68 * target to be configured in USB Device mode when defined.
\r
70 #define USB_CAN_BE_DEVICE
\r
72 /** Indicates that the target microcontroller and compilation settings allow for the
\r
73 * target to be configured in USB Host mode when defined.
\r
75 #define USB_CAN_BE_HOST
\r
77 /** Indicates that the target microcontroller and compilation settings allow for the
\r
78 * target to be configured in either USB Device or Host mode when defined.
\r
80 #define USB_CAN_BE_BOTH
\r
83 #if (defined(__LPC175X_6X__))||(defined(__LPC177X_8X__))||(defined(__LPC407X_8X__))
\r
84 #define USB_CAN_BE_HOST
\r
85 #define __LPC_OHCI__
\r
86 #define USB_CAN_BE_DEVICE
\r
88 #define MAX_USB_CORE 1
\r
90 #elif (defined (__LPC18XX__)||defined(__LPC43XX__))
\r
91 #define USB_CAN_BE_HOST
\r
92 #define __LPC_EHCI__
\r
93 #define USB_CAN_BE_DEVICE
\r
95 #if (USE_USB_ROM_STACK)
\r
96 #define USB_DEVICE_ROM_DRIVER
\r
99 #define MAX_USB_CORE 2
\r
101 #elif (defined(__LPC11U1X__) || defined(__LPC11U2X_3X__) || defined(__LPC1347__))
\r
102 #define USB_CAN_BE_DEVICE
\r
104 #if ((USE_USB_ROM_STACK) && (defined(__LPC11U2X_3X__) || defined(__LPC1347__)))
\r
105 #define USB_DEVICE_ROM_DRIVER
\r
108 #define MAX_USB_CORE 1
\r
112 #if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
\r
113 #define USB_CAN_BE_BOTH
\r
116 #if defined(USB_HOST_ONLY)
\r
117 #if !defined(USB_CAN_BE_HOST)
\r
118 #error USB_HOST_ONLY is not available for the currently selected microcontroller model.
\r
120 #undef USB_CAN_BE_DEVICE
\r
121 #undef USB_CAN_BE_BOTH
\r
125 #if defined(USB_DEVICE_ONLY)
\r
126 #if !defined(USB_CAN_BE_DEVICE)
\r
127 #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.
\r
129 #undef USB_CAN_BE_HOST
\r
130 #undef USB_CAN_BE_BOTH
\r
134 #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
\r
135 #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
\r
138 #if (!defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST))
\r
139 #error The currently selected device or architecture is not supported under the USB component of the library.
\r
143 /* Disable C linkage for C++ Compilers: */
\r
144 #if defined(__cplusplus)
\r