]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/LPCOpen/LPCUSBLib/Drivers/USB/Core/DCD/EndpointCommon.h
Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / LPCOpen / LPCUSBLib / Drivers / USB / Core / DCD / EndpointCommon.h
1 /*\r
2  * @brief Declare common macros, variables that can be shared between\r
3  *                DCD (Endpoint_LPCxxxx, Device_LPCxxxx) and (Endpoint_LPC, EndpointStream_LPC)\r
4  *\r
5  * @note\r
6  * Copyright(C) NXP Semiconductors, 2012\r
7  * All rights reserved.\r
8  *\r
9  * @par\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
23  *\r
24  * @par\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
30  * this code.\r
31  */\r
32 \r
33 /** @ingroup Group_EndpointManagement\r
34  *  @defgroup Group_EndpointCommon Endpoint Buffer for Writing and Reading\r
35  *  @brief Endpoint Buffer for Writing and Reading.\r
36  *\r
37  *  @{\r
38  */\r
39  \r
40 #ifndef __ENDPOINT_COMMON_H__\r
41 #define __ENDPOINT_COMMON_H__\r
42 \r
43 /* Includes: */\r
44 #include "../HAL/HAL.h"\r
45 \r
46 /* Macros: */\r
47 /** Size of share memory buffer that a device uses to communicate with host. */\r
48 #define USB_DATA_BUFFER_TEM_LENGTH      512\r
49 \r
50 /* Global Variables: */\r
51 /** Share memory buffer. */\r
52 /* Control EP buffer */\r
53 extern uint8_t usb_data_buffer[][USB_DATA_BUFFER_TEM_LENGTH];\r
54 /* Non-Control EP IN buffer */\r
55 extern uint8_t usb_data_buffer_IN[][USB_DATA_BUFFER_TEM_LENGTH];\r
56 /* Non-Control EP OUT buffer */\r
57 extern uint8_t usb_data_buffer_OUT[][USB_DATA_BUFFER_TEM_LENGTH];\r
58 /* Control EP buffer size */\r
59 extern volatile int32_t usb_data_buffer_size[];\r
60 /* Non-Control EP OUT buffer index */\r
61 extern volatile uint32_t usb_data_buffer_OUT_size[];\r
62 /** Indexer rolling along the share memory buffer. Used to determine the offset\r
63  *  of next read/write activities on share memory buffer or the total amount of data\r
64  *  ready to be sent.\r
65  */\r
66 extern volatile uint32_t usb_data_buffer_index[];\r
67 extern volatile uint32_t usb_data_buffer_IN_index[];\r
68 extern volatile uint32_t usb_data_buffer_OUT_index[];\r
69 /** Store the current selected endpoint number, always the logical endpint number.\r
70  *  Usually used as index of endpointhandle array.\r
71  */\r
72 extern uint8_t endpointselected[];\r
73 /** Array to store the physical endpoint number or the actual endpoint number that need\r
74  *  to be configured for any USB transactions.\r
75  */\r
76 extern uint8_t endpointhandle0[];\r
77 extern uint8_t endpointhandle1[];\r
78 \r
79 #define endpointhandle(corenum)                         ((corenum) ? endpointhandle1 : endpointhandle0)\r
80 #endif /* __ENDPOINT_COMMON_H__ */\r
81 \r
82 /** @} */\r