1 /*
2  * @brief Configuration file needed for USB ROM stack based applications.
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2013
6  * All rights reserved.
7  *
8  * @par
9  * Software that is described herein is for illustrative purposes only
10  * which provides customers with programming information regarding the
11  * LPC products.  This software is supplied "AS IS" without any warranties of
12  * any kind, and NXP Semiconductors and its licensor disclaim any and
13  * all warranties, express or implied, including all implied warranties of
14  * merchantability, fitness for a particular purpose and non-infringement of
15  * intellectual property rights.  NXP Semiconductors assumes no responsibility
16  * or liability for the use of the software, conveys no license or rights under any
17  * patent, copyright, mask work right, or any other intellectual property rights in
18  * or to any products. NXP Semiconductors reserves the right to make changes
19  * in the software without notification. NXP Semiconductors also makes no
20  * representation or warranty that such application will be suitable for the
21  * specified use without further testing or modification.
22  *
23  * @par
24  * Permission to use, copy, modify, and distribute this software and its
25  * documentation is hereby granted, under NXP Semiconductors' and its
26  * licensor's relevant copyrights in the software, without fee, provided that it
27  * is used in conjunction with NXP Semiconductors microcontrollers.  This
28  * copyright, permission, and disclaimer notice must appear in all copies of
29  * this code.
30  */
31 #include "lpc_types.h"
32 #include "error.h"
33 #include "usbd_rom_api.h"
34 
35 #ifndef __APP_USB_CFG_H_
36 #define __APP_USB_CFG_H_
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 /** @ingroup EXAMPLES_USBDROM_15XX_COMPOSITE
44  * @{
45  */
46 
47 /* HID In/Out Endpoint Address */
48 #define HID_EP_IN                           0x81
49 #define USB_HID_IF_NUM                      0
50 /** Interval between mouse reports expressed in milliseconds for full-speed device. */
51 #define HID_MOUSE_REPORT_INTERVAL_MS        10
52 /* bInterval value used in descriptor. For HS this macro will differ from HID_MOUSE_REPORT_INTERVAL_MS macro. */
53 #define HID_MOUSE_REPORT_INTERVAL           10
54 
55 /* Manifest constants defining interface numbers and endpoints used by a
56    CDC class interfaces in this application.
57  */
58 #define USB_CDC_CIF_NUM                     1
59 #define USB_CDC_DIF_NUM                     2
60 #define USB_CDC_IN_EP                       0x82
61 #define USB_CDC_OUT_EP                      0x01
62 #define USB_CDC_INT_EP                      0x83
63 
64 /* The following manifest constants are used to define this memory area to be used
65    by USBD ROM stack.
66  */
67 #define USB_STACK_MEM_BASE      0x02008000
68 #define USB_STACK_MEM_SIZE      0x1000
69 
70 /* Manifest constants used by USBD ROM stack. These values SHOULD NOT BE CHANGED
71    for advance features which require usage of USB_CORE_CTRL_T structure.
72    Since these are the values used for compiling USB stack.
73  */
74 #define USB_MAX_IF_NUM          8		/*!< Max interface number used for building USBDL_Lib. DON'T CHANGE. */
75 #define USB_MAX_EP_NUM          5		/*!< Max number of EP used for building USBD ROM. DON'T CHANGE. */
76 #define USB_MAX_PACKET0         64		/*!< Max EP0 packet size used for building USBD ROM. DON'T CHANGE. */
77 #define USB_FS_MAX_BULK_PACKET  64		/*!< MAXP for FS bulk EPs used for building USBD ROM. DON'T CHANGE. */
78 #define USB_HS_MAX_BULK_PACKET  512		/*!< MAXP for HS bulk EPs used for building USBD ROM. DON'T CHANGE. */
79 #define USB_DFU_XFER_SIZE       2048	/*!< Max DFU transfer size used for building USBD ROM. DON'T CHANGE. */
80 
81 /* USB descriptor arrays defined *_desc.c file */
82 extern const uint8_t USB_DeviceDescriptor[];
83 extern uint8_t USB_HsConfigDescriptor[];
84 extern uint8_t USB_FsConfigDescriptor[];
85 extern const uint8_t USB_StringDescriptor[];
86 extern const uint8_t USB_DeviceQualifier[];
87 
88 /**
89  * @brief	Find the address of interface descriptor for given class type.
90  * @param	pDesc		: Pointer to configuration descriptor in which the desired class
91  *			interface descriptor to be found.
92  * @param	intfClass	: Interface class type to be searched.
93  * @return	If found returns the address of requested interface else returns NULL.
94  */
95 extern USB_INTERFACE_DESCRIPTOR *find_IntfDesc(const uint8_t *pDesc, uint32_t intfClass);
96 
97 /**
98  * @}
99  */
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* __APP_USB_CFG_H_ */
106