65 #ifndef __ENDPOINT_LPC11UXX_H__
66 #define __ENDPOINT_LPC11UXX_H__
68 #include "../EndpointCommon.h"
70 #if defined(__cplusplus)
74 #if !defined(__INCLUDE_FROM_USB_DRIVER)
75 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
78 #if !defined(__DOXYGEN__)
80 #define ENDPOINT_DETAILS_MAXEP 5
81 #define ENDPOINT_DETAILS_MAXEP0 ENDPOINT_DETAILS_MAXEP
82 #define ENDPOINT_DETAILS_MAXEP1 ENDPOINT_DETAILS_MAXEP
84 #if defined(USB_DEVICE_ROM_DRIVER)
87 const unsigned p_usbd;
88 const unsigned p_clib;
89 const unsigned p_cand;
90 #ifdef PWRROMD_PRESENT
93 const unsigned p_pwrd;
95 #ifdef DIVROMD_PRESENT
96 const LPC_ROM_DIV_STRUCT *pROMDiv;
98 const unsigned p_dev1;
100 const unsigned p_dev2;
101 const unsigned p_dev3;
102 const unsigned p_dev4;
105 #define ROM_FUNCTION_TABLE_PTR_ADDR (0x1FFF1FF8UL)
106 #define ROM_USBD_PTR ((*(ROM_FUNCTION_TABLE * *) (ROM_FUNCTION_TABLE_PTR_ADDR))->p_usbd)
108 #define ROMDRIVER_USB0_BASE LPC_USB0_BASE
109 #define ROMDRIVER_USB1_BASE LPC_USB0_BASE
110 #define ROMDRIVER_MEM_SIZE 0x500
111 extern uint8_t usb_RomDriver_buffer[ROMDRIVER_MEM_SIZE];
113 #define ROMDRIVER_MSC_MEM_SIZE 0x100
114 extern uint8_t usb_RomDriver_MSC_buffer[ROMDRIVER_MSC_MEM_SIZE];
116 #define ROMDRIVER_CDC_MEM_SIZE 0x8
117 extern uint8_t usb_RomDriver_CDC_buffer[ROMDRIVER_CDC_MEM_SIZE];
119 #if (USB_FORCED_FULLSPEED)
120 #define CDC_MAX_BULK_EP_SIZE 64
122 #define CDC_MAX_BULK_EP_SIZE 512
124 extern uint8_t UsbdCdc_EPIN_buffer[CDC_MAX_BULK_EP_SIZE];
125 extern uint8_t UsbdCdc_EPOUT_buffer[CDC_MAX_BULK_EP_SIZE];
127 #define ROMDRIVER_HID_MEM_SIZE 0x8
128 extern uint8_t usb_RomDriver_HID_buffer[ROMDRIVER_HID_MEM_SIZE];
134 bool Endpoint_ConfigureEndpoint_Prv(uint8_t corenum,
135 const uint8_t Number,
136 const uint8_t UECFG0XData,
137 const uint8_t UECFG1XData);
140 #define USED_PHYSICAL_ENDPOINTS (ENDPOINT_DETAILS_MAXEP * 2)
142 #define USB_EN (0x1 << 7)
143 #define USB_SETUP_RCVD (0x1 << 8)
144 #define USB_PLL_ON (0x1 << 9)
145 #define USB_LPM (0x1 << 11)
146 #define USB_IntOnNAK_AO (0x1 << 12)
147 #define USB_IntOnNAK_AI (0x1 << 13)
148 #define USB_IntOnNAK_CO (0x1 << 14)
149 #define USB_IntOnNAK_CI (0x1 << 15)
150 #define USB_DCON (0x1 << 16)
151 #define USB_DSUS (0x1 << 17)
152 #define USB_LPM_SUS (0x1 << 19)
153 #define USB_REMOTE_WAKE (0x1 << 20)
154 #define USB_DCON_C (0x1 << 24)
155 #define USB_DSUS_C (0x1 << 25)
156 #define USB_DRESET_C (0x1 << 26)
157 #define USB_VBUS_DBOUNCE (0x1 << 28)
159 #define EP0_INT (0x1 << 0)
160 #define EP1_INT (0x1 << 1)
161 #define EP2_INT (0x1 << 2)
162 #define EP3_INT (0x1 << 3)
163 #define EP4_INT (0x1 << 4)
164 #define EP5_INT (0x1 << 5)
165 #define EP6_INT (0x1 << 6)
166 #define EP7_INT (0x1 << 7)
167 #define EP8_INT (0x1 << 8)
168 #define EP9_INT (0x1 << 9)
169 #define FRAME_INT (0x1 << 30)
170 #define DEV_STAT_INT (0x80000000)
172 #define PKT_LNGTH_MASK 0x000003FF
174 #define ERR_NOERROR 0x00
175 #define ERR_PID_ENCODE 0x01
176 #define ERR_UNKNOWN_PID 0x02
177 #define ERR_UNEXPECT_PKT 0x03
178 #define ERR_TCRC 0x04
179 #define ERR_DCRC 0x05
180 #define ERR_TIMEOUT 0x06
181 #define ERR_BABBIE 0x07
182 #define ERR_EOF_PKT 0x08
183 #define ERR_TX_RX_NAK 0x09
184 #define ERR_SENT_STALL 0x0A
185 #define ERR_BUF_OVERRUN 0x0B
186 #define ERR_SENT_EPT_PKT 0x0C
187 #define ERR_BIT_STUFF 0x0D
188 #define ERR_SYNC 0x0E
189 #define ERR_TOGGLE_BIT 0x0F
199 uint16_t totalpackets, uint16_t dummypackets);
204 const uint8_t Number,
208 const uint8_t Banks) ;
293 return EndPointCmdStsList[PhyEP][0].
Active ?
false :
true;
358 EndPointCmdStsList[1][0].
Stall = 1;
386 #if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
389 #define USB_Device_ControlEndpointSize FIXED_CONTROL_ENDPOINT_SIZE
396 #if defined(__cplusplus)