LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USBMode.h
Go to the documentation of this file.
1 /*
2  * @brief USB mode and feature support definitions
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2012
6  * Copyright(C) Dean Camera, 2011, 2012
7  * All rights reserved.
8  *
9  * @par
10  * Software that is described herein is for illustrative purposes only
11  * which provides customers with programming information regarding the
12  * LPC products. This software is supplied "AS IS" without any warranties of
13  * any kind, and NXP Semiconductors and its licensor disclaim any and
14  * all warranties, express or implied, including all implied warranties of
15  * merchantability, fitness for a particular purpose and non-infringement of
16  * intellectual property rights. NXP Semiconductors assumes no responsibility
17  * or liability for the use of the software, conveys no license or rights under any
18  * patent, copyright, mask work right, or any other intellectual property rights in
19  * or to any products. NXP Semiconductors reserves the right to make changes
20  * in the software without notification. NXP Semiconductors also makes no
21  * representation or warranty that such application will be suitable for the
22  * specified use without further testing or modification.
23  *
24  * @par
25  * Permission to use, copy, modify, and distribute this software and its
26  * documentation is hereby granted, under NXP Semiconductors' and its
27  * licensor's relevant copyrights in the software, without fee, provided that it
28  * is used in conjunction with NXP Semiconductors microcontrollers. This
29  * copyright, permission, and disclaimer notice must appear in all copies of
30  * this code.
31  */
32 
49 #ifndef __USBMODE_H__
50 #define __USBMODE_H__
51 
52  /* Enable C linkage for C++ Compilers: */
53  #if defined(__cplusplus)
54  extern "C" {
55  #endif
56 
57  /* Preprocessor Checks: */
58  #if !defined(__INCLUDE_FROM_USB_DRIVER)
59  #error Do not include this file directly. Include /software/LPCUSBLib/Drivers/USB/USB.h instead.
60  #endif
61 
62  #include "../../../LPCUSBlibConfig.h"
63 
64  /* Public Interface - May be used in end-application: */
65  #if defined(__DOXYGEN__)
66 
70  #define USB_CAN_BE_DEVICE
71 
75  #define USB_CAN_BE_HOST
76 
80  #define USB_CAN_BE_BOTH
81  #else
82  /* Macros: */
83  #if (defined(__LPC175X_6X__))||(defined(__LPC177X_8X__))||(defined(__LPC407X_8X__))
84  #define USB_CAN_BE_HOST
85  #define __LPC_OHCI__
86  #define USB_CAN_BE_DEVICE
87 
88  #define MAX_USB_CORE 1
89 
90  #elif (defined (__LPC18XX__)||defined(__LPC43XX__))
91  #define USB_CAN_BE_HOST
92  #define __LPC_EHCI__
93  #define USB_CAN_BE_DEVICE
94 
95  #if (USE_USB_ROM_STACK)
96  #define USB_DEVICE_ROM_DRIVER
97  #endif
98 
99  #define MAX_USB_CORE 2
100 
101  #elif (defined(__LPC11U1X__) || defined(__LPC11U2X_3X__) || defined(__LPC1347__))
102  #define USB_CAN_BE_DEVICE
103 
104  #if ((USE_USB_ROM_STACK) && (defined(__LPC11U2X_3X__) || defined(__LPC1347__)))
105  #define USB_DEVICE_ROM_DRIVER
106  #endif
107 
108  #define MAX_USB_CORE 1
109 
110  #endif
111 
112  #if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
113  #define USB_CAN_BE_BOTH
114  #endif
115 
116  #if defined(USB_HOST_ONLY)
117  #if !defined(USB_CAN_BE_HOST)
118  #error USB_HOST_ONLY is not available for the currently selected microcontroller model.
119  #else
120  #undef USB_CAN_BE_DEVICE
121  #undef USB_CAN_BE_BOTH
122  #endif
123  #endif
124 
125  #if defined(USB_DEVICE_ONLY)
126  #if !defined(USB_CAN_BE_DEVICE)
127  #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.
128  #else
129  #undef USB_CAN_BE_HOST
130  #undef USB_CAN_BE_BOTH
131  #endif
132  #endif
133 
134  #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
135  #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
136  #endif
137 
138  #if (!defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST))
139  #error The currently selected device or architecture is not supported under the USB component of the library.
140  #endif
141  #endif
142 
143  /* Disable C linkage for C++ Compilers: */
144  #if defined(__cplusplus)
145  }
146  #endif
147 
148 #endif
149