1 /******************************************************************************
2 ** File Name: usb20_v3_reg.h *
3 ** Author: Daniel.Ding *
5 ** Copyright: 2005 Spreatrum, Incoporated. All Rights Reserved. *
7 ******************************************************************************/
8 /******************************************************************************
10 **---------------------------------------------------------------------------*
11 ** DATE NAME DESCRIPTION *
12 ** 11/13/2005 Daniel.Ding Create. *
13 ******************************************************************************/
14 #ifndef _USB20_V3_REG_H_
15 #define _USB20_V3_REG_H_
16 /*----------------------------------------------------------------------------*
18 **------------------------------------------------------------------------- */
20 /**---------------------------------------------------------------------------*
22 **--------------------------------------------------------------------------*/
27 /**---------------------------------------------------------------------------*
29 **---------------------------------------------------------------------------*/
35 //**************** Core Global CSR ***************************
36 #define USB_GOTGCTL (USB_REG_BASE + 0x0000)
37 #define USB_GOTGINT (USB_REG_BASE + 0x0004)
38 #define USB_GAHBCFG (USB_REG_BASE + 0x0008)
39 #define USB_GUSBCFG (USB_REG_BASE + 0x000c)
40 #define USB_GRSTCTL (USB_REG_BASE + 0x0010)
41 #define USB_GINTSTS (USB_REG_BASE + 0x0014)
42 #define USB_GINTMSK (USB_REG_BASE + 0x0018)
43 #define USB_GRXSTSR (USB_REG_BASE + 0x001c)
44 #define USB_GRXSTSP (USB_REG_BASE + 0x0020)
45 #define USB_GRXFSIZ (USB_REG_BASE + 0x0024)
46 #define USB_GNPTXFSIZ (USB_REG_BASE + 0x0028)
47 #define USB_GNPTXSTS (USB_REG_BASE + 0x002c)
48 #define USB_GI2CCTL (USB_REG_BASE + 0x0030)
49 #define USB_GPVNDCTL (USB_REG_BASE + 0x0034)
50 #define USB_GGPIO (USB_REG_BASE + 0x0038)
51 #define USB_GUID (USB_REG_BASE + 0x003c)
52 #define USB_GSNPSID (USB_REG_BASE + 0x0040)
53 #define USB_GHWCFG1 (USB_REG_BASE + 0x0044)
54 #define USB_GHWCFG2 (USB_REG_BASE + 0x0048)
55 #define USB_GHWCFG3 (USB_REG_BASE + 0x004c)
56 #define USB_GHWCFG4 (USB_REG_BASE + 0x0050)
57 #define USB_GLPMCFG (USB_REG_BASE + 0x0054)
58 #define USB_HPTXFSIZ (USB_REG_BASE + 0x0100)
59 #define USB_DPTXFSIZ(n) (USB_REG_BASE + 0x0104+(n-1)*0x04) // n(1-15)
60 #define USB_DIEPTXF(n) (USB_REG_BASE + 0x0104+(n-1)*0x04) // n(1-15)
62 //**************** Power and Clock geting CSR ****************
63 #define USB_PCGCR (USB_REG_BASE + 0x0E00)
65 //**************** Device CSR *********************************
66 #define USB_DCFG (USB_REG_BASE + 0x0800)
67 #define USB_DCTL (USB_REG_BASE + 0x0804)
68 #define USB_DSTS (USB_REG_BASE + 0x0808)
69 #define USB_DIEPMSK (USB_REG_BASE + 0x0810)
70 #define USB_DOEPMSK (USB_REG_BASE + 0x0814)
71 #define USB_DAINT (USB_REG_BASE + 0x0818)
72 #define USB_DAINTMSK (USB_REG_BASE + 0x081c)
73 #define USB_DTKNQR1 (USB_REG_BASE + 0x0820)
74 #define USB_DTKNQR2 (USB_REG_BASE + 0x0824)
75 #define USB_DTKNQR3 (USB_REG_BASE + 0x0830)
76 #define USB_DTKNQR4 (USB_REG_BASE + 0x0834)
77 #define USB_DVBUSDIS (USB_REG_BASE + 0x0828)
78 #define USB_DVBUSPULSE (USB_REG_BASE + 0x082c)
79 #define USB_DTHRCTL (USB_REG_BASE + 0x0830)
80 #define USB_DIEPEMPMSK (USB_REG_BASE + 0x0834)
81 #define USB_DEACHINT (USB_REG_BASE + 0x0838)
82 #define USB_DEACHINTMSK (USB_REG_BASE + 0x083c)
83 #define USB_DIACHINTMSK(n) (USB_REG_BASE + 0x0840+n*0x04) // n(0-15)
84 #define USB_DOACHINTMSK(n) (USB_REG_BASE + 0x0880+n*0x04) // n(0-15)
85 #define USB_DIEP0CTL (USB_REG_BASE + 0x0900)
86 #define USB_DIEPCTL(n) (USB_REG_BASE + 0x0900+n*0x20) // n(1-15)
87 #define USB_DIEPINT(n) (USB_REG_BASE + 0x0908+n*0x20) // n(0-15)
88 #define USB_DIEP0TSIZ (USB_REG_BASE + 0x0910)
89 #define USB_DIEPTSIZ(n) (USB_REG_BASE + 0x0910+n*0x20) // n(1-15)
90 #define USB_DIEPDMA(n) (USB_REG_BASE + 0x0914+n*0x20) // n(0-15)
91 #define USB_DTXFSTS(n) (USB_REG_BASE + 0x0918+n*0x20) // n(0-15)
92 #define USB_DIEPDMAB(n) (USB_REG_BASE + 0x091c+n*0x20) // n(0-15)
93 #define USB_DOEP0CTL (USB_REG_BASE + 0x0b00)
94 #define USB_DOEPCTL(n) (USB_REG_BASE + 0x0b00+n*0x20) // n(1-15)
95 #define USB_DOEPINT(n) (USB_REG_BASE + 0x0b08+n*0x20) // n(0-15)
96 #define USB_DOEP0TSIZ (USB_REG_BASE + 0x0b10)
97 #define USB_DOEPTSIZ(n) (USB_REG_BASE + 0x0b10+n*0x20) // n(1-15)
98 #define USB_DOEPDMA(n) (USB_REG_BASE + 0x0b14+n*0x20) // n(0-15)
99 #define USB_DOEPDMAB(n) (USB_REG_BASE + 0x0b1c+n*0x20) // n(0-15)
102 //**************** Device EP FIFO base address *********************************
104 #define USB_DEPFIFOBA(n) (USB_REG_BASE + (n+1)*0x1000) // n(0-15)
107 //#define USB_FIFO_MAX_WORD 128
108 //#define USB_FIFO_MAX_BYTE 512
110 #define USB_CTRL_END 0x203FFFFF
111 #define USB_CLK_12M 12000000
112 #define USB_CLK_48M 48000000
117 #define USB_INTERFACE 1
118 #define USB_ENDPOINT 2
119 #define USB_RECIPIENT_OTHER 3
121 #define ENPOINT_HALT 0
123 #define USB_CONNECTTED 0
124 #define USB_POWERED 1
125 #define USB_DEFAULT 2
126 #define USB_ADDRESSED 3
127 #define USB_CONFIGED 4
130 #define USB_EP_DIR_OUT 1
131 #define USB_EP_DIR_IN 0
134 #define USB_PACKET_16 0x10
135 #define USB_PACKET_32 0x20
136 #define USB_PACKET_64 0x40
137 #define USB_PACKET_128 0x80
138 #define USB_PACKET_256 0x100
139 #define USB_PACKET_512 0x200
140 #define USB_PACKET_1024 0x400
147 USB_EP_TYPE_CONTROL = 0,
150 USB_EP_TYPE_INTERRUPT ,
178 #define USB_INT_SOF (BIT_0)
179 #define USB_INT_SPEND (BIT_1)
180 #define USB_INT_RESUM (BIT_2)
181 #define USB_INT_RST (BIT_3)
182 #define USB_INT_UNPID (BIT_4)
183 #define USB_INT_EPID (BIT_5)
184 #define USB_INT_CHANGE (BIT_6)
185 #define USB_INT_DEVICE (BIT_7)
186 #define USB_INT_EP0 (BIT_8)
187 #define USB_INT_EP1 (BIT_9)
188 #define USB_INT_EP2 (BIT_10)
189 #define USB_INT_EP3 (BIT_11)
190 #define USB_INT_EP4 (BIT_12)
193 /**----------------------------------------------------------------------------*
195 **----------------------------------------------------------------------------*/
197 //************************** Core Global Register Prototype *******************/
199 typedef union usb_gahbcfg_tag
201 struct usb_gahbcfg_map
203 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
205 volatile unsigned int reserved_2 :23;
206 volatile unsigned int ptxfemplvl :1; //periodic_txfifo_empty_level
207 volatile unsigned int nptxfemplvl :1; //non_periodic_txfifo_empty_level
208 volatile unsigned int reserved_1 :1;
209 volatile unsigned int dma_enable :1; //dma_enable
210 volatile unsigned int burst_length :4; //burst_length
211 volatile unsigned int global_int_mask :1; //global_interrupt_mask
213 volatile unsigned int global_int_mask :1; //global_interrupt_mask
214 volatile unsigned int burst_length :4; //burst_length
215 volatile unsigned int dma_enable :1; //dma_enable
216 volatile unsigned int reserved_1 :1;
217 volatile unsigned int nptxfemplvl :1; //non_periodic_txfifo_empty_level
218 volatile unsigned int ptxfemplvl :1; //periodic_txfifo_empty_level
219 volatile unsigned int reserved_2 :23;
222 volatile unsigned int dwValue ;
225 typedef union usb_gusbcfg_tag
227 struct usb_gusbcfg_map
229 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
230 volatile unsigned int corrupt_tx_packet :1; //Corrupt TX packet
231 volatile unsigned int force_dev_mod :1; //Force device mode
232 volatile unsigned int force_hst_mod :1; //Force host mode
233 volatile unsigned int tx_end_delay :1; //TX end delay
234 volatile unsigned int ic_usb_tri :1; //IC USB Tranfic Pull Remove Control
235 volatile unsigned int ic_usb_cap :1; //IC USB capable
236 volatile unsigned int reserved_3 :3;
237 volatile unsigned int temseldlpulse :1; //Termsel Dline PUlsing Sleection
238 volatile unsigned int reserved_2 :2;
239 volatile unsigned int ulpiclksusm :1; //ULPI clock suspendM
240 volatile unsigned int ulpiautores :1; //ULPI auto resume
241 volatile unsigned int ulpifsls :1; //ULPI FS/LS select
242 volatile unsigned int otgi2csel :1; //UTMIFS or I2C interface select
243 volatile unsigned int phylpwrclksel :1; //PHY low power clock select
244 volatile unsigned int reserved_1 :1;
245 volatile unsigned int usbtrdtim :4; //USB turnaroud time
246 volatile unsigned int hnpcap :1; //HNP capable
247 volatile unsigned int srpcap :1; //SRP capable
248 volatile unsigned int ddrsel :1; //ULPI DDR select
249 volatile unsigned int physel :1; //USB 2.0 high speed PHY or USB 1.1 FULL speed serial transceiver select
250 volatile unsigned int fsintf :1; //FULL speed serial interface select
251 volatile unsigned int ulpiutmisel :1; //ULPI or UTMI+ select
252 volatile unsigned int phyintf :1; //PHY interface
253 volatile unsigned int toutcal :3; //HS/FS time out calibration
255 volatile unsigned int toutcal :3; //HS/FS time out calibration
256 volatile unsigned int phyintf :1; //PHY interface
257 volatile unsigned int ulpiutmisel :1; //ULPI or UTMI+ select
258 volatile unsigned int fsintf :1; //FULL speed serial interface select
259 volatile unsigned int physel :1; //USB 2.0 high speed PHY or USB 1.1 FULL speed serial transceiver select
260 volatile unsigned int ddrsel :1; //ULPI DDR select
261 volatile unsigned int srpcap :1; //SRP capable
262 volatile unsigned int hnpcap :1; //HNP capable
263 volatile unsigned int usbtrdtim :4; //USB turnaroud time
264 volatile unsigned int reserved_1 :1;
265 volatile unsigned int phylpwrclksel :1; //PHY low power clock select
266 volatile unsigned int otgi2csel :1; //UTMIFS or I2C interface select
267 volatile unsigned int ulpifsls :1; //ULPI FS/LS select
268 volatile unsigned int ulpiautores :1; //ULPI auto resume
269 volatile unsigned int ulpiclksusm :1; //ULPI clock suspendM
270 volatile unsigned int reserved_2 :2;
271 volatile unsigned int temseldlpulse :1; //Termsel Dline PUlsing Sleection
272 volatile unsigned int reserved_3 :3;
273 volatile unsigned int ic_usb_cap :1; //IC USB capable
274 volatile unsigned int ic_usb_tri :1; //IC USB Tranfic Pull Remove Control
275 volatile unsigned int tx_end_delay :1; //TX end delay
276 volatile unsigned int force_hst_mod :1; //Force host mode
277 volatile unsigned int force_dev_mod :1; //Force device mode
278 volatile unsigned int corrupt_tx_packet :1; //Corrupt TX packet
281 volatile unsigned int dwValue ;
284 typedef union usb_grstctl_tag
286 struct usb_grstctl_map
288 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
289 volatile unsigned int ahbidle :1; //AHB Master idle
290 volatile unsigned int dmareq :1; //DMA request signal
291 volatile unsigned int reserved :19;
292 volatile unsigned int txfnum :5; //TX fifo number
293 volatile unsigned int txfflush :1; //TX fifo flush
294 volatile unsigned int rxfflush :1; //RX fifo flush
295 volatile unsigned int intknqflsh :1; //in token sequence learning queue flush
296 volatile unsigned int frmcntrrst :1; //host frame counter reset
297 volatile unsigned int fsftrst :1; //Hclock soft reset
298 volatile unsigned int csftrst :1; //Core soft reset
300 volatile unsigned int csftrst :1; //Core soft reset
301 volatile unsigned int fsftrst :1; //Hclock soft reset
302 volatile unsigned int frmcntrrst :1; //host frame counter reset
303 volatile unsigned int intknqflsh :1; //in token sequence learning queue flush
304 volatile unsigned int rxfflush :1; //RX fifo flush
305 volatile unsigned int txfflush :1; //TX fifo flush
306 volatile unsigned int txfnum :5; //TX fifo number
307 volatile unsigned int reserved :19;
308 volatile unsigned int dmareq :1; //DMA request signal
309 volatile unsigned int ahbidle :1; //AHB Master idle
312 volatile unsigned int dwValue ;
315 typedef union usb_gintsts_tag
317 struct usb_gintsts_map
319 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
320 volatile unsigned int wkupint :1; //resume/remote wakeup dedected interrupt
321 volatile unsigned int sessreqint :1; //session request
322 volatile unsigned int reserved_3 :1;
323 volatile unsigned int conidstschng :1; //connecter id status change interupt
324 volatile unsigned int lpmint :1; //LPM tranction received interrupt
325 volatile unsigned int reserved_2 :3;
326 volatile unsigned int resetdet :1; //reset detected interrupt
327 volatile unsigned int fetsusp :1; //data fetch suspend
328 volatile unsigned int incomip :1; //incompleteperiodic transfer
329 volatile unsigned int incomplsoin :1; //incomplete iso in transfer
330 volatile unsigned int oepint :1; //out endpoint interrupt
331 volatile unsigned int iepint :1; //in endpoint interrupt
332 volatile unsigned int epmis :1; //endpoint mismatch interrupt
333 volatile unsigned int reserved_1 :1;
334 volatile unsigned int eopf :1; //end of periodic frame interrupt
335 volatile unsigned int isooutdrop :1; //iso out packet dropped interrupt
336 volatile unsigned int enumdone :1; //enumeration done
337 volatile unsigned int usbrst :1; //usb reset
338 volatile unsigned int usbsusp :1; //usb suspend
339 volatile unsigned int erlususp :1; //early suspend
340 volatile unsigned int i2cint :1; //I2C interrupt
341 volatile unsigned int ulpickint :1; //ULPI carkit interrupt
342 volatile unsigned int goutnakeff :1; //global out nak effective
343 volatile unsigned int ginnakeff :1; //global in nak effective
344 volatile unsigned int nptxfemp :1; //non periodic nak effective
345 volatile unsigned int rxflvl :1; //RX fifo non empty
346 volatile unsigned int sof :1; //start of frame
347 volatile unsigned int otgint :1; //otg interrupt
348 volatile unsigned int modemis :1; //mode mismatch interrupt
349 volatile unsigned int curmod :1; //current mode of opration
351 volatile unsigned int curmod :1; //current mode of opration
352 volatile unsigned int modemis :1; //mode mismatch interrupt
353 volatile unsigned int otgint :1; //otg interrupt
354 volatile unsigned int sof :1; //start of frame
355 volatile unsigned int rxflvl :1; //RX fifo non empty
356 volatile unsigned int nptxfemp :1; //non periodic nak effective
357 volatile unsigned int ginnakeff :1; //global in nak effective
358 volatile unsigned int goutnakeff :1; //global out nak effective
359 volatile unsigned int ulpickint :1; //ULPI carkit interrupt
360 volatile unsigned int i2cint :1; //I2C interrupt
361 volatile unsigned int erlususp :1; //early suspend
362 volatile unsigned int usbsusp :1; //usb suspend
363 volatile unsigned int usbrst :1; //usb reset
364 volatile unsigned int enumdone :1; //enumeration done
365 volatile unsigned int isooutdrop :1; //iso out packet dropped interrupt
366 volatile unsigned int eopf :1; //end of periodic frame interrupt
367 volatile unsigned int reserved_1 :1;
368 volatile unsigned int epmis :1; //endpoint mismatch interrupt
369 volatile unsigned int iepint :1; //in endpoint interrupt
370 volatile unsigned int oepint :1; //out endpoint interrupt
371 volatile unsigned int incomplsoin :1; //incomplete iso in transfer
372 volatile unsigned int incomip :1; //incompleteperiodic transfer
373 volatile unsigned int fetsusp :1; //data fetch suspend
374 volatile unsigned int resetdet :1; //reset detected interrupt
375 volatile unsigned int reserved_2 :3;
376 volatile unsigned int lpmint :1; //LPM tranction received interrupt
377 volatile unsigned int conidstschng :1; //connecter id status change interupt
378 volatile unsigned int reserved_3 :1;
379 volatile unsigned int sessreqint :1; //session request
380 volatile unsigned int wkupint :1; //resume/remote wakeup dedected interrupt
384 volatile unsigned int dwValue ;
387 typedef union usb_gintmsk_tag
389 struct usb_gintmsk_map
391 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
392 volatile unsigned int wkupintmsk :1; //resume/remote wakeup dedected interrupt
393 volatile unsigned int sessreqintmsk :1; //session request
394 volatile unsigned int disconintmsk :1; // disconnect detected interrupt mask
395 volatile unsigned int conidstschngmsk :1; //connecter id status change interupt
396 volatile unsigned int lpmintmsk :1; //LPM tranction received interrupt
397 volatile unsigned int reserved_3 :3;
398 volatile unsigned int resetdetmsk :1; //reset detected interrupt
399 volatile unsigned int fetsuspmsk :1; //data fetch suspend
400 volatile unsigned int incomipmsk :1; //data fetch suspend
401 volatile unsigned int incomplsoinmsk :1; //incomplete iso in transfer,incompleteperiodic transfer
402 volatile unsigned int oepintmsk :1; //out endpoint interrupt
403 volatile unsigned int iepintmsk :1; //in endpoint interrupt
404 volatile unsigned int epmismsk :1; //endpoint mismatch interrupt
405 volatile unsigned int reserved_2 :1;
406 volatile unsigned int eopfmsk :1; //end of periodic frame interrupt
407 volatile unsigned int isooutdropmsk :1; //iso out packet dropped interrupt
408 volatile unsigned int enumdonemsk :1; //enumeration done
409 volatile unsigned int usbrstmsk :1; //usb reset
410 volatile unsigned int usbsuspmsk :1; //usb suspend
411 volatile unsigned int erlususpmsk :1; //early suspend
412 volatile unsigned int i2cintmsk :1; //I2C interrupt
413 volatile unsigned int ulpickintmsk :1; //ULPI carkit interrupt
414 volatile unsigned int goutnakeffmsk :1; //global out nak effective
415 volatile unsigned int ginnakeffmsk :1; //global in nak effective
416 volatile unsigned int nptxfempmsk :1; //non periodic nak effective
417 volatile unsigned int rxflvlmsk :1; //RX fifo non empty
418 volatile unsigned int sofmsk :1; //start of frame
419 volatile unsigned int otgintmsk :1; //otg interrupt
420 volatile unsigned int modemismsk :1; //mode mismatch interrupt
421 volatile unsigned int reserved_1 :1;
423 volatile unsigned int reserved_1 :1;
424 volatile unsigned int modemismsk :1; //mode mismatch interrupt
425 volatile unsigned int otgintmsk :1; //otg interrupt
426 volatile unsigned int sofmsk :1; //start of frame
427 volatile unsigned int rxflvlmsk :1; //RX fifo non empty
428 volatile unsigned int nptxfempmsk :1; //non periodic nak effective
429 volatile unsigned int ginnakeffmsk :1; //global in nak effective
430 volatile unsigned int goutnakeffmsk :1; //global out nak effective
431 volatile unsigned int ulpickintmsk :1; //ULPI carkit interrupt
432 volatile unsigned int i2cintmsk :1; //I2C interrupt
433 volatile unsigned int erlususpmsk :1; //early suspend
434 volatile unsigned int usbsuspmsk :1; //usb suspend
435 volatile unsigned int usbrstmsk :1; //usb reset
436 volatile unsigned int enumdonemsk :1; //enumeration done
437 volatile unsigned int isooutdropmsk :1; //iso out packet dropped interrupt
438 volatile unsigned int eopfmsk :1; //end of periodic frame interrupt
439 volatile unsigned int reserved_2 :1;
440 volatile unsigned int epmismsk :1; //endpoint mismatch interrupt
441 volatile unsigned int iepintmsk :1; //in endpoint interrupt
442 volatile unsigned int oepintmsk :1; //out endpoint interrupt
443 volatile unsigned int incomplsoinmsk :1; //incomplete iso in transfer,incompleteperiodic transfer
444 volatile unsigned int incomipmsk :1; //data fetch suspend
445 volatile unsigned int fetsuspmsk :1; //data fetch suspend
446 volatile unsigned int resetdetmsk :1; //reset detected interrupt
447 volatile unsigned int reserved_3 :3;
448 volatile unsigned int lpmintmsk :1; //LPM tranction received interrupt
449 volatile unsigned int conidstschngmsk :1; //connecter id status change interupt
450 volatile unsigned int disconintmsk :1; // disconnect detected interrupt mask
451 volatile unsigned int sessreqintmsk :1; //session request
452 volatile unsigned int wkupintmsk :1; //resume/remote wakeup dedected interrupt
456 volatile unsigned int dwValue ;
459 typedef union usb_grxstsp_tag
461 struct usb_grxstsp_map
463 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
464 volatile uint32 reserved :7;
465 volatile uint32 frame_number :4; //frame nummber
466 volatile uint32 packet_status :4; //packet status
467 volatile uint32 data_pid :2; //data PID
468 volatile uint32 byte_count :11; //byte count
469 volatile uint32 endpoint_number :4; //endpoint nummber
471 volatile uint32 endpoint_number :4; //endpoint nummber
472 volatile uint32 byte_count :11; //byte count
473 volatile uint32 data_pid :2; //data PID
474 volatile uint32 packet_status :4; //packet status
475 volatile uint32 frame_number :4; //frame nummber
476 volatile uint32 reserved :7;
480 volatile unsigned int dwValue ;
483 typedef union usb_grxstsr_tag
485 struct usb_grxstsr_map
487 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
488 volatile uint32 reserved :7;
489 volatile uint32 frame_number :4; //frame nummber
490 volatile uint32 packet_status :4; //packet status
491 volatile uint32 data_pid :2; //data PID
492 volatile uint32 byte_count :11; //byte count
493 volatile uint32 endpoint_number :4; //endpoint nummber
495 volatile uint32 endpoint_number :4; //endpoint nummber
496 volatile uint32 byte_count :11; //byte count
497 volatile uint32 data_pid :2; //data PID
498 volatile uint32 packet_status :4; //packet status
499 volatile uint32 frame_number :4; //frame nummber
500 volatile uint32 reserved :7;
504 volatile unsigned int dwValue ;
507 typedef union usb_grxfsiz_tag
509 struct usbgrxfsiz__map
511 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
512 volatile unsigned int reserved :16;
513 volatile unsigned int rxfdep :16; //RX fifo deepth
515 volatile unsigned int rxfdep :16; //RX fifo deepth
516 volatile unsigned int reserved :16;
519 volatile unsigned int dwValue ;
522 typedef union usb_gnptxfsiz_tag
524 struct usb_gnptxfsiz_map
526 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
527 volatile unsigned int nptxfdep :16; //non periodic TX fifo deepth
528 volatile unsigned int nptxfstaddr :16; //non periodic transmit ram start address
530 volatile unsigned int nptxfstaddr :16; //non periodic transmit ram start address
531 volatile unsigned int nptxfdep :16; //non periodic TX fifo deepth
536 volatile unsigned int dwValue ;
539 typedef union usb_gnptxsts_tag
541 struct usb_gnptxsts_map
543 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
544 volatile unsigned int reserved :1;
545 volatile unsigned int nptxqtop :7; //top of non periodic transmit request queue
546 volatile unsigned int nptxqspcavail :8; //non periodic transmit request queue space available
547 volatile unsigned int nptxfsavail :16; //non periodic tx fifo space available
549 volatile unsigned int nptxfsavail :16; //non periodic tx fifo space available
550 volatile unsigned int nptxqspcavail :8; //non periodic transmit request queue space available
551 volatile unsigned int nptxqtop :7; //top of non periodic transmit request queue
552 volatile unsigned int reserved :1;
556 volatile unsigned int dwValue ;
559 typedef union usb_ggpio_tag
563 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
564 volatile unsigned int gpo :16; //general purpose output
565 volatile unsigned int gpi :16; //general purpose input
567 volatile unsigned int gpi :16; //general purpose input
568 volatile unsigned int gpo :16; //general purpose output
571 volatile unsigned int dwValue ;
574 typedef union usb_ghwcfg1_tag
576 struct usb_ghwcfg1_map
578 volatile unsigned int epfir :32; //endpoint dirction
580 volatile unsigned int dwValue ;
583 typedef union usb_ghwcfg2_tag
585 struct usb_ghwcfg2_map
587 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
588 volatile unsigned int reserved_2 :1;
589 volatile unsigned int tknqdepth :5; //device mode in taken sequence learning queue depth
590 volatile unsigned int ptxqdepth :2; //host mode periodic request queue deepth
591 volatile unsigned int nptxqdepth :2; //non periodic request queue deepth
592 volatile unsigned int reserved_1 :1;
593 volatile unsigned int multiprocintprt :1; //multi processor interrupt enable
594 volatile unsigned int dynfifosizing :1; //dynamic fifo size enable
595 volatile unsigned int periodicsupport :1; //periodic out channels support in host mode
596 volatile unsigned int numhstchnl :4; //nummber of host channel
597 volatile unsigned int numdeveps :4; //nummber of device endpoint
598 volatile unsigned int fsphytype :2; //FS PHY interface type
599 volatile unsigned int hsphytype :2; //HS PHY interface type
600 volatile unsigned int singpnt :1; //point to point
601 volatile unsigned int architechure :2; //architechure
602 volatile unsigned int otgmode :3; //mode of opration
604 volatile unsigned int otgmode :3; //mode of opration
605 volatile unsigned int architechure :2; //architechure
606 volatile unsigned int singpnt :1; //point to point
607 volatile unsigned int hsphytype :2; //HS PHY interface type
608 volatile unsigned int fsphytype :2; //FS PHY interface type
609 volatile unsigned int numdeveps :4; //nummber of device endpoint
610 volatile unsigned int numhstchnl :4; //nummber of host channel
611 volatile unsigned int periodicsupport :1; //periodic out channels support in host mode
612 volatile unsigned int dynfifosizing :1; //dynamic fifo size enable
613 volatile unsigned int multiprocintprt :1; //multi processor interrupt enable
614 volatile unsigned int reserved_1 :1;
615 volatile unsigned int nptxqdepth :2; //non periodic request queue deepth
616 volatile unsigned int ptxqdepth :2; //host mode periodic request queue deepth
617 volatile unsigned int tknqdepth :5; //device mode in taken sequence learning queue depth
618 volatile unsigned int reserved_2 :1;
622 volatile unsigned int dwValue ;
625 typedef union usb_ghwcfg3_tag
627 struct usb_ghwcfg3_map
629 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
630 volatile unsigned int dfifodepth :16; // D FIFO depth
631 volatile unsigned int otgenablelpm :1; //
632 volatile unsigned int reserved :1; //
633 volatile unsigned int othenablehsic :1; //
634 volatile unsigned int otgenableicusb :1; //
635 volatile unsigned int rsttype :1; //
636 volatile unsigned int optfeature :1; //
637 volatile unsigned int vndctlsupt :1; //
638 volatile unsigned int i2cselect :1; //
639 volatile unsigned int otgen :1; //
640 volatile unsigned int pktsizewidth :3; //width of packet size counter
641 volatile unsigned int xfersizewidth :4; //width of transfer size counter
643 volatile unsigned int xfersizewidth :4; //width of transfer size counter
644 volatile unsigned int pktsizewidth :3; //width of packet size counter
645 volatile unsigned int otgen :1; //
646 volatile unsigned int i2cselect :1; //
647 volatile unsigned int vndctlsupt :1; //
648 volatile unsigned int optfeature :1; //
649 volatile unsigned int rsttype :1; //
650 volatile unsigned int otgenableicusb :1; //
651 volatile unsigned int othenablehsic :1; //
652 volatile unsigned int reserved :1; //
653 volatile unsigned int otgenablelpm :1; //
654 volatile unsigned int dfifodepth :16; // D FIFO depth
658 volatile unsigned int dwValue ;
661 typedef union usb_ghwcfg4_tag
663 struct usb_ghwcfg4_map
665 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
666 volatile unsigned int sgdma :1;
667 volatile unsigned int sgdmac :1;
668 volatile unsigned int ineps :4; //nummber of decice mode in endpoint include control endpoint
669 volatile unsigned int dedfifomod :1;
670 volatile unsigned int sessendfltr :1;
671 volatile unsigned int bvalidfltr :1;
672 volatile unsigned int avalidfltr :1;
673 volatile unsigned int vbusvalidfltr :1;
674 volatile unsigned int iddgfltr :1;
675 volatile unsigned int numctleps :4; //nummber of device mode control endpoint in addition to endpoint 0
676 volatile unsigned int phydatawidth :2; //UTMI+ PHY/ULPI to internal UTMI+ Wrapper data width
677 volatile unsigned int reserved :8;
678 volatile unsigned int ahbfreq :1; //minimum ahb frequency less then 60MHz
679 volatile unsigned int enablepwropt :1; //enable power optimization
680 volatile unsigned int numdevperioeps :4; //nummber of device mode periodic in endpoint
682 volatile unsigned int numdevperioeps :4; //nummber of device mode periodic in endpoint
683 volatile unsigned int enablepwropt :1; //enable power optimization
684 volatile unsigned int ahbfreq :1; //minimum ahb frequency less then 60MHz
685 volatile unsigned int reserved :8;
686 volatile unsigned int phydatawidth :2; //UTMI+ PHY/ULPI to internal UTMI+ Wrapper data width
687 volatile unsigned int numctleps :4; //nummber of device mode control endpoint in addition to endpoint 0
688 volatile unsigned int iddgfltr :1;
689 volatile unsigned int vbusvalidfltr :1;
690 volatile unsigned int avalidfltr :1;
691 volatile unsigned int bvalidfltr :1;
692 volatile unsigned int sessendfltr :1;
693 volatile unsigned int dedfifomod :1;
694 volatile unsigned int ineps :4; //nummber of decice mode in endpoint include control endpoint
695 volatile unsigned int sgdmac :1;
696 volatile unsigned int sgdma :1;
700 volatile unsigned int dwValue ;
703 typedef union usb_dptxfsiz_tag
705 struct usb_dptxfsiz_map
707 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
708 volatile unsigned int dptxfsize :16; //device periodic TX fifo size
709 volatile unsigned int dptxfstraddr :16; //device periodic TX fifo ram start address
711 volatile unsigned int dptxfstraddr :16; //device periodic TX fifo ram start address
712 volatile unsigned int dptxfsize :16; //device periodic TX fifo size
716 volatile unsigned int dwValue ;
719 typedef union usb_dieptxf_tag
721 struct usb_dieptxf_map
723 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
724 volatile unsigned int ineptxfsize :16; //in endpoint TX fifo depth
725 volatile unsigned int ineptxfstraddr :16; //in endpoint fifo transmit ram start address
727 volatile unsigned int ineptxfstraddr :16; //in endpoint fifo transmit ram start address
728 volatile unsigned int ineptxfsize :16; //in endpoint TX fifo depth
731 volatile unsigned int dwValue ;
735 /*********************Device Register Prototype****************/
737 typedef union usb_dcfg_tag
741 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
743 volatile unsigned int reserved_2 :6;
744 volatile unsigned int perschintvl :2;
745 volatile unsigned int descdma :1;
746 volatile unsigned int inepmiscnt :5; //in endpoint mismatch count
747 volatile unsigned int reserved :5;
748 volatile unsigned int perfrint :2; //periodic frame interval
749 volatile unsigned int devaddr :7; //device address
750 volatile unsigned int reserved_1 :1;
751 volatile unsigned int nzstsouthshk :1; //non zero length status out handshake
752 volatile unsigned int devspeed :2; //device speed
754 volatile unsigned int devspeed :2; //device speed
755 volatile unsigned int nzstsouthshk :1; //non zero length status out handshake
756 volatile unsigned int reserved_1 :1;
757 volatile unsigned int devaddr :7; //device address
758 volatile unsigned int perfrint :2; //periodic frame interval
759 volatile unsigned int reserved :5;
760 volatile unsigned int inepmiscnt :5; //in endpoint mismatch count
761 volatile unsigned int descdma :1;
762 volatile unsigned int perschintvl :2;
763 volatile unsigned int reserved_2 :6;
767 volatile unsigned int dwValue ;
770 typedef union usb_dctl_tag
774 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
775 volatile unsigned int reserved_2 :15;
776 volatile unsigned int setnak :1; //
777 volatile unsigned int ignrfrmnum :1; //
778 volatile unsigned int gmc :2; //global muti count
779 volatile unsigned int reserved_1 :1;
780 volatile unsigned int pwronprgdone :1; //power on programing done
781 volatile unsigned int cgoutnak :1; //clear out nak
782 volatile unsigned int sgoutnak :1; //set out nak
783 volatile unsigned int cgnpinnak :1; //clear global non periodic in nak
784 volatile unsigned int sgnpinnak :1; //set global non periodic in nak
785 volatile unsigned int tstctl :3; //test control
786 volatile unsigned int goutnaksts :1; //global out nak status
787 volatile unsigned int gnpinnaksts :1; //global non periodic in nak status
788 volatile unsigned int sftdiscon :1; //soft disconect
789 volatile unsigned int rmtwkupsig :1; //remote wakeup signaling
791 volatile unsigned int rmtwkupsig :1; //remote wakeup signaling
792 volatile unsigned int sftdiscon :1; //soft disconect
793 volatile unsigned int gnpinnaksts :1; //global non periodic in nak status
794 volatile unsigned int goutnaksts :1; //global out nak status
795 volatile unsigned int tstctl :3; //test control
796 volatile unsigned int sgnpinnak :1; //set global non periodic in nak
797 volatile unsigned int cgnpinnak :1; //clear global non periodic in nak
798 volatile unsigned int sgoutnak :1; //set out nak
799 volatile unsigned int cgoutnak :1; //clear out nak
800 volatile unsigned int pwronprgdone :1; //power on programing done
801 volatile unsigned int reserved_1 :1; //power on programing done
802 volatile unsigned int gmc :2; //global muti count
803 volatile unsigned int ignrfrmnum :1; //
804 volatile unsigned int setnak :1; //
805 volatile unsigned int reserved_2 :15;
809 volatile unsigned int dwValue ;
813 typedef union usb_dsts_tag
817 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
818 volatile unsigned int reserved_2 :10;
819 volatile unsigned int soffn :14; //frame or microframe nummber of the recieved SOF
820 volatile unsigned int reserved_1 :4;
821 volatile unsigned int errticerr :1; //erratic error
822 volatile unsigned int enumspd :2; //enumeration speed
823 volatile unsigned int suspsts :1; // suspend status
825 volatile unsigned int suspsts :1; // suspend status
826 volatile unsigned int enumspd :2; //enumeration speed
827 volatile unsigned int errticerr :1; //erratic error
828 volatile unsigned int reserved_1 :4;
829 volatile unsigned int soffn :14; //frame or microframe nummber of the recieved SOF
830 volatile unsigned int reserved_2 :10;
834 volatile unsigned int dwValue ;
837 typedef union usb_diepmsk_tag
839 struct usb_diepmsk_map
841 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
842 volatile unsigned int reserved_3 :18;
843 volatile unsigned int nakmsk :1; //NAK interrupt mask
844 volatile unsigned int reserved_2 :3;
845 volatile unsigned int bnakintmsk :1; //BNK interrupt mask
846 volatile unsigned int fifounmsk :1; //fifo underrun mask
847 volatile unsigned int reserve_1 :1;
848 volatile unsigned int inepnakeffmsk :1; //in endpoint nak effective mask
849 volatile unsigned int intknepmismsk :1; //in token recieved with ep mismatch mask
850 volatile unsigned int intkntxfempmsk :1; //in token recieved when tx fifo empty mask
851 volatile unsigned int timeoutmsk :1; //time out mask
852 volatile unsigned int ahberrmsk :1; //ahb error mask
853 volatile unsigned int epdisbidmsk :1; //endpoint disabled interrupt mask
854 volatile unsigned int xfercompimsk :1; //transfer completed interrupt mask
856 volatile unsigned int xfercompimsk :1; //transfer completed interrupt mask
857 volatile unsigned int epdisbidmsk :1; //endpoint disabled interrupt mask
858 volatile unsigned int ahberrmsk :1; //ahb error mask
859 volatile unsigned int timeoutmsk :1; //time out mask
860 volatile unsigned int intkntxfempmsk :1; //in token recieved when tx fifo empty mask
861 volatile unsigned int intknepmismsk :1; //in token recieved with ep mismatch mask
862 volatile unsigned int inepnakeffmsk :1; //in endpoint nak effective mask
863 volatile unsigned int reserve_1 :1;
864 volatile unsigned int fifounmsk :1; //fifo underrun mask
865 volatile unsigned int bnakintmsk :1; //BNK interrupt mask
866 volatile unsigned int reserved_2 :3;
867 volatile unsigned int nakmsk :1; //NAK interrupt mask
868 volatile unsigned int reserved_3 :18;
872 volatile unsigned int dwValue ;
875 typedef union usb_doepmsk_tag
877 struct usb_doepmsk_map
879 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
880 volatile unsigned int reserved_4 :17;
881 volatile unsigned int nyetmsk :1; //NYET mask
882 volatile unsigned int nakmsk :1; //NAK mask
883 volatile unsigned int bbleerrmsk :1; //Babble error mask
884 volatile unsigned int reserved_3 :2;
885 volatile unsigned int bnkmsk :1; //BNK mask
886 volatile unsigned int outperrmsk :1; //out packet error mask
887 volatile unsigned int reserved_2 :1;
888 volatile unsigned int b2bsetup :1; //back to back setup packet recieved mask
889 volatile unsigned int reserved_1 :1;
890 volatile unsigned int outtknepdismsk :1; //out token recieved when endpoint disabled mask
891 volatile unsigned int setupmsk :1; //setup phase done interrupt
892 volatile unsigned int ahberr :1; //ahb error
893 volatile unsigned int epdismsk :1; //endpopint disabled interrupt mask
894 volatile unsigned int xfercompmsk :1; //transfer completed interrupt mask
896 volatile unsigned int xfercompmsk :1; //transfer completed interrupt mask
897 volatile unsigned int epdismsk :1; //endpopint disabled interrupt mask
898 volatile unsigned int ahberr :1; //ahb error
899 volatile unsigned int setupmsk :1; //setup phase done interrupt
900 volatile unsigned int outtknepdismsk :1; //out token recieved when endpoint disabled mask
901 volatile unsigned int reserved_1 :1;
902 volatile unsigned int b2bsetup :1; //back to back setup packet recieved mask
903 volatile unsigned int reserved_2 :1;
904 volatile unsigned int outperrmsk :1; //out packet error mask
905 volatile unsigned int bnkmsk :1; //BNK mask
906 volatile unsigned int reserved_3 :2;
907 volatile unsigned int bbleerrmsk :1; //Babble error mask
908 volatile unsigned int nakmsk :1; //NAK mask
909 volatile unsigned int nyetmsk :1; //NYET mask
910 volatile unsigned int reserved_4 :17;
914 volatile unsigned int dwValue ;
917 typedef union usb_daint_tag
921 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
922 volatile unsigned int reserved_2 :9; // out endppint interrupt
923 volatile unsigned int outepint_6 :1; // in endpoint interrupt
924 volatile unsigned int outepint_5 :1; // in endpoint interrupt
925 volatile unsigned int outepint_4 :1; // in endpoint interrupt
926 volatile unsigned int outepint_3 :1; // in endpoint interrupt
927 volatile unsigned int outepint_2 :1; // in endpoint interrupt
928 volatile unsigned int outepint_1 :1; // in endpoint interrupt
929 volatile unsigned int outepint_0 :1; // in endpoint interrupt
930 volatile unsigned int reserved_1 :9; // in endpoint interrupt
931 volatile unsigned int inepint_6 :1; // in endpoint interrupt
932 volatile unsigned int inepint_5 :1; // in endpoint interrupt
933 volatile unsigned int inepint_4 :1; // in endpoint interrupt
934 volatile unsigned int inepint_3 :1; // in endpoint interrupt
935 volatile unsigned int inepint_2 :1; // in endpoint interrupt
936 volatile unsigned int inepint_1 :1; // in endpoint interrupt
937 volatile unsigned int inepint_0 :1; // in endpoint interrupt
939 volatile unsigned int inepint_0 :1; // in endpoint interrupt
940 volatile unsigned int inepint_1 :1; // in endpoint interrupt
941 volatile unsigned int inepint_2 :1; // in endpoint interrupt
942 volatile unsigned int inepint_3 :1; // in endpoint interrupt
943 volatile unsigned int inepint_4 :1; // in endpoint interrupt
944 volatile unsigned int inepint_5 :1; // in endpoint interrupt
945 volatile unsigned int inepint_6 :1; // in endpoint interrupt
946 volatile unsigned int reserved_1 :9; // in endpoint interrupt
947 volatile unsigned int outepint_0 :1; // in endpoint interrupt
948 volatile unsigned int outepint_1 :1; // in endpoint interrupt
949 volatile unsigned int outepint_2 :1; // in endpoint interrupt
950 volatile unsigned int outepint_3 :1; // in endpoint interrupt
951 volatile unsigned int outepint_4 :1; // in endpoint interrupt
952 volatile unsigned int outepint_5 :1; // in endpoint interrupt
953 volatile unsigned int outepint_6 :1; // in endpoint interrupt
954 volatile unsigned int reserved_2 :9; // out endppint interrupt
958 volatile unsigned int dwValue ;
961 typedef union usb_daintmsk_tag
963 struct usb_daintmsk_map
965 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
966 volatile unsigned int outepintmsk :16; //out endpoint interrupt mak
967 volatile unsigned int inepintmsk :16; //in endpoint interrupt mask
969 volatile unsigned int inepintmsk :16; //in endpoint interrupt mask
970 volatile unsigned int outepintmsk :16; //out endpoint interrupt mak
973 volatile unsigned int dwValue ;
976 typedef union usb_dtknqr1_tag
978 struct usb_dtknqr1_map
980 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
981 volatile unsigned int eptkn :24; //endpoint token
982 volatile unsigned int wrapbit :1; //wrap bit
983 volatile unsigned int reserved :2; //
984 volatile unsigned int intknwptr :5; //in token queue write pointer
986 volatile unsigned int intknwptr :5; //in token queue write pointer
987 volatile unsigned int reserved :2; //
988 volatile unsigned int wrapbit :1; //wrap bit
989 volatile unsigned int eptkn :24; //endpoint token
992 volatile unsigned int dwValue ;
995 typedef union usb_dtknqr2_tag
997 struct usb_dtknqr2_map
999 volatile unsigned int eptoken :32; // endpoint token
1001 volatile unsigned int dwValue ;
1004 typedef union usb_dtknqr3_tag
1006 struct usb_dtknqr3_map
1008 volatile unsigned int eptoken :32; // endpoint token
1010 volatile unsigned int dwValue ;
1013 typedef union usb_dtknqr4_tag
1015 struct usb_dtknqr4_map
1017 volatile unsigned int eptoken :32; // endpoint token
1019 volatile unsigned int dwValue ;
1022 typedef union usb_dvbusdis_tag
1024 struct usb_dvbusdis_map
1026 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1027 volatile unsigned int reserved :16;
1028 volatile unsigned int dvbusdis :16; //device vbus discharge time
1030 volatile unsigned int dvbusdis :16; //device vbus discharge time
1031 volatile unsigned int reserved :16;
1034 volatile unsigned int dwValue ;
1037 typedef union usb_dvbuspulse_tag
1039 struct usb_dvbuspulse_map
1041 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1042 volatile unsigned int reserved :20;
1043 volatile unsigned int dvbuspt :12; //device vbus pulse time
1045 volatile unsigned int dvbuspt :12; //device vbus pulse time
1046 volatile unsigned int reserved :20;
1049 volatile unsigned int dwValue ;
1052 typedef union usb_dthrctl_tag
1054 struct usb_dthrctl_map
1056 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1057 volatile unsigned int reserved_3 :4;
1058 volatile unsigned int arbprken :1; //
1059 volatile unsigned int reserved_2 :1;
1060 volatile unsigned int rxthrlen :9; //receive threshold length
1061 volatile unsigned int rxthren :1; //receive threshold enable
1062 volatile unsigned int reserved_1 :5; //
1063 volatile unsigned int txthrlen :9; //transmit threshold length
1064 volatile unsigned int isothren :1; //iso in endpoint threshold enable
1065 volatile unsigned int nonisothren :1; //non iso in endpoint threshold enable
1067 volatile unsigned int nonisothren :1; //non iso in endpoint threshold enable
1068 volatile unsigned int isothren :1; //iso in endpoint threshold enable
1069 volatile unsigned int txthrlen :9; //transmit threshold length
1070 volatile unsigned int reserved_1 :5; //
1071 volatile unsigned int rxthren :1; //receive threshold enable
1072 volatile unsigned int rxthrlen :9; //receive threshold length
1073 volatile unsigned int reserved_2 :1;
1074 volatile unsigned int arbprken :1; //
1075 volatile unsigned int reserved_3 :4;
1079 volatile unsigned int dwValue ;
1083 typedef union usb_diepint_tag
1085 struct usb_diepint_map
1087 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1088 volatile unsigned int reserved_2 :17;
1089 volatile unsigned int nyet :1;
1090 volatile unsigned int nak :1;
1091 volatile unsigned int bbleerr :1;
1092 volatile unsigned int pktdrpsts :1;
1093 volatile unsigned int reserved_1 :1;
1094 volatile unsigned int bna :1;
1095 volatile unsigned int fifo_underrun :1;
1096 volatile unsigned int tfifoemp :1;
1097 volatile unsigned int inepnakef :1;
1098 volatile unsigned int intokenepmis :1;
1099 volatile unsigned int intokenfifoemp :1;
1100 volatile unsigned int timeout_condi :1;
1101 volatile unsigned int ahb_error :1;
1102 volatile unsigned int epdis :1;
1103 volatile unsigned int transfer_com :1;
1105 volatile unsigned int transfer_com :1;
1106 volatile unsigned int epdis :1;
1107 volatile unsigned int ahb_error :1;
1108 volatile unsigned int timeout_condi :1;
1109 volatile unsigned int intokenfifoemp :1;
1110 volatile unsigned int intokenepmis :1;
1111 volatile unsigned int inepnakef :1;
1112 volatile unsigned int tfifoemp :1;
1113 volatile unsigned int fifo_underrun :1;
1114 volatile unsigned int bna :1;
1115 volatile unsigned int reserved_1 :1;
1116 volatile unsigned int pktdrpsts :1;
1117 volatile unsigned int bbleerr :1;
1118 volatile unsigned int nak :1;
1119 volatile unsigned int nyet :1;
1120 volatile unsigned int reserved_2 :17;
1124 volatile unsigned int dwValue ;
1127 typedef union usb_doepint_tag
1129 struct usb_doepint_map
1131 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1132 volatile unsigned int reserved_2 :17;
1133 volatile unsigned int nyet :1;
1134 volatile unsigned int nak :1;
1135 volatile unsigned int bbleerr :1;
1136 volatile unsigned int pktdrpsts :1;
1137 volatile unsigned int reserved_1 :1;
1138 volatile unsigned int bna :1;
1139 volatile unsigned int fifo_underrun :1;
1140 volatile unsigned int tfifoemp :1;
1141 volatile unsigned int inepnakef :1;
1142 volatile unsigned int intokenepmis :1;
1143 volatile unsigned int outtokenfifoemp :1;
1144 volatile unsigned int timeout_condi :1;
1145 volatile unsigned int ahb_error :1;
1146 volatile unsigned int epdis :1;
1147 volatile unsigned int transfer_com :1;
1149 volatile unsigned int transfer_com :1;
1150 volatile unsigned int epdis :1;
1151 volatile unsigned int ahb_error :1;
1152 volatile unsigned int timeout_condi :1;
1153 volatile unsigned int outtokenfifoemp :1;
1154 volatile unsigned int intokenepmis :1;
1155 volatile unsigned int inepnakef :1;
1156 volatile unsigned int tfifoemp :1;
1157 volatile unsigned int fifo_underrun :1;
1158 volatile unsigned int bna :1;
1159 volatile unsigned int reserved_1 :1;
1160 volatile unsigned int pktdrpsts :1;
1161 volatile unsigned int bbleerr :1;
1162 volatile unsigned int nak :1;
1163 volatile unsigned int nyet :1;
1164 volatile unsigned int reserved_2 :17;
1168 volatile unsigned int dwValue ;
1172 typedef union usb_dieptsiz_tag
1174 struct usb_dieptsiz_map
1176 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1177 volatile unsigned int reserved :1;
1178 volatile unsigned int mult_count :2;
1179 volatile unsigned int packet_count :10;
1180 volatile unsigned int transfer_size :19;
1182 volatile unsigned int transfer_size :19;
1183 volatile unsigned int packet_count :10;
1184 volatile unsigned int mult_count :2;
1185 volatile unsigned int reserved :1;
1188 volatile unsigned int dwValue ;
1191 typedef union usb_doeptsiz_tag
1193 struct usb_doeptsiz_map
1195 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1196 volatile unsigned int reserved :1;
1197 volatile unsigned int mult_count :2;
1198 volatile unsigned int packet_count :10;
1199 volatile unsigned int transfer_size :19;
1201 volatile unsigned int transfer_size :19;
1202 volatile unsigned int packet_count :10;
1203 volatile unsigned int mult_count :2;
1204 volatile unsigned int reserved :1;
1207 volatile unsigned int dwValue ;
1211 typedef union usb_diepctl_tag
1213 struct usb_diepctl_map
1215 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1217 volatile unsigned int ep_enable :1;
1218 volatile unsigned int ep_disable :1;
1219 volatile unsigned int set_data1_pid :1;
1220 volatile unsigned int set_data0_pid :1;
1221 volatile unsigned int set_nak :1;
1222 volatile unsigned int clear_nak :1;
1223 volatile unsigned int tx_fifo_number :4;
1224 volatile unsigned int stall_handshak :1;
1225 volatile unsigned int snoop_mode :1;
1226 volatile unsigned int ep_type :2;
1227 volatile unsigned int nak_status :1;
1228 volatile unsigned int ep_data_pid :1;
1229 volatile unsigned int active_ep :1;
1230 volatile unsigned int next_ep :4;
1231 volatile unsigned int mps :11;
1233 volatile unsigned int mps :11;
1234 volatile unsigned int next_ep :4;
1235 volatile unsigned int active_ep :1;
1236 volatile unsigned int ep_data_pid :1;
1237 volatile unsigned int nak_status :1;
1238 volatile unsigned int ep_type :2;
1239 volatile unsigned int snoop_mode :1;
1240 volatile unsigned int stall_handshak :1;
1241 volatile unsigned int tx_fifo_number :4;
1242 volatile unsigned int clear_nak :1;
1243 volatile unsigned int set_nak :1;
1244 volatile unsigned int set_data0_pid :1;
1245 volatile unsigned int set_data1_pid :1;
1246 volatile unsigned int ep_disable :1;
1247 volatile unsigned int ep_enable :1;
1251 volatile unsigned int dwValue ;
1254 typedef union usb_doepctl_tag
1256 struct usb_doepctl_map
1258 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1259 volatile unsigned int ep_enable :1;
1260 volatile unsigned int ep_disable :1;
1261 volatile unsigned int set_data1_pid :1;
1262 volatile unsigned int set_data0_pid :1;
1263 volatile unsigned int set_nak :1;
1264 volatile unsigned int clear_nak :1;
1265 volatile unsigned int tx_fifo_number :4;
1266 volatile unsigned int stall_handshak :1;
1267 volatile unsigned int snoop_mode :1;
1268 volatile unsigned int ep_type :2;
1269 volatile unsigned int nak_status :1;
1270 volatile unsigned int ep_data_pid :1;
1271 volatile unsigned int active_ep :1;
1272 volatile unsigned int next_ep :4;
1273 volatile unsigned int mps :11;
1275 volatile unsigned int mps :11;
1276 volatile unsigned int next_ep :4;
1277 volatile unsigned int active_ep :1;
1278 volatile unsigned int ep_data_pid :1;
1279 volatile unsigned int nak_status :1;
1280 volatile unsigned int ep_type :2;
1281 volatile unsigned int snoop_mode :1;
1282 volatile unsigned int stall_handshak :1;
1283 volatile unsigned int tx_fifo_number :4;
1284 volatile unsigned int clear_nak :1;
1285 volatile unsigned int set_nak :1;
1286 volatile unsigned int set_data0_pid :1;
1287 volatile unsigned int set_data1_pid :1;
1288 volatile unsigned int ep_disable :1;
1289 volatile unsigned int ep_enable :1;
1293 volatile unsigned int dwValue ;
1296 typedef union usb_diep0tsiz_tag
1298 struct usb_diep0tsiz_map
1300 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1301 volatile unsigned int reserved_2 :11;
1302 volatile unsigned int packet_count :2;
1303 volatile unsigned int reserved_1 :12;
1304 volatile unsigned int transfer_size :7;
1306 volatile unsigned int transfer_size :7;
1307 volatile unsigned int reserved_1 :12;
1308 volatile unsigned int packet_count :2;
1309 volatile unsigned int reserved_2 :11;
1312 volatile unsigned int dwValue ;
1315 typedef union usb_doep0tsiz_tag
1317 struct usb_doep0tsiz_map
1319 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1320 volatile unsigned int reserved_3 :1;
1321 volatile unsigned int setup_packet_count :2;
1322 volatile unsigned int reserved_2 :9;
1323 volatile unsigned int packet_count :1;
1324 volatile unsigned int reserved_1 :12;
1325 volatile unsigned int transfer_size :7;
1327 volatile unsigned int transfer_size :7;
1328 volatile unsigned int reserved_1 :12;
1329 volatile unsigned int packet_count :1;
1330 volatile unsigned int reserved_2 :9;
1331 volatile unsigned int setup_packet_count :2;
1332 volatile unsigned int reserved_3 :1;
1336 volatile unsigned int dwValue ;
1341 typedef union usb_intsts_tag
1343 struct usb_intsts_map
1345 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1346 volatile unsigned int wkupint :1; //Reserved ;
1347 volatile unsigned int sessreqint :1; //Slef powered ;
1348 volatile unsigned int discoonint :1; //Device enable ;
1349 volatile unsigned int conidstschng :1;
1350 volatile unsigned int lpmint :1;
1351 volatile unsigned int ptxfemp :1;
1352 volatile unsigned int hchint :1;
1353 volatile unsigned int prtint :1;
1354 volatile unsigned int resetdet :1;
1355 volatile unsigned int fetsusp :1;
1356 volatile unsigned int incompip :1;
1357 volatile unsigned int incompisoin :1;
1358 volatile unsigned int oepint :1;
1359 volatile unsigned int iepint :1;
1360 volatile unsigned int epmis :1;
1361 volatile unsigned int reserved :1;
1362 volatile unsigned int eopf :1;
1363 volatile unsigned int isooutdrop :1;
1364 volatile unsigned int enumdone :1;
1365 volatile unsigned int usbrst :1;
1366 volatile unsigned int usbsusp :1;
1367 volatile unsigned int erlysusp :1;
1368 volatile unsigned int i2cint :1;
1369 volatile unsigned int ulpickint :1;
1370 volatile unsigned int goutnakeff :1;
1371 volatile unsigned int ginnakeff :1;
1372 volatile unsigned int nptxfemp :1;
1373 volatile unsigned int rxflvl :1;
1374 volatile unsigned int sof :1;
1375 volatile unsigned int otgint :1;
1376 volatile unsigned int modemis :1;
1377 volatile unsigned int curmod :1;
1379 volatile unsigned int curmod :1;
1380 volatile unsigned int modemis :1;
1381 volatile unsigned int otgint :1;
1382 volatile unsigned int sof :1;
1383 volatile unsigned int rxflvl :1;
1384 volatile unsigned int nptxfemp :1;
1385 volatile unsigned int ginnakeff :1;
1386 volatile unsigned int goutnakeff :1;
1387 volatile unsigned int ulpickint :1;
1388 volatile unsigned int i2cint :1;
1389 volatile unsigned int erlysusp :1;
1390 volatile unsigned int usbsusp :1;
1391 volatile unsigned int usbrst :1;
1392 volatile unsigned int enumdone :1;
1393 volatile unsigned int isooutdrop :1;
1394 volatile unsigned int eopf :1;
1395 volatile unsigned int reserved :1;
1396 volatile unsigned int epmis :1;
1397 volatile unsigned int iepint :1;
1398 volatile unsigned int oepint :1;
1399 volatile unsigned int incompisoin :1;
1400 volatile unsigned int incompip :1;
1401 volatile unsigned int fetsusp :1;
1402 volatile unsigned int resetdet :1;
1403 volatile unsigned int prtint :1;
1404 volatile unsigned int hchint :1;
1405 volatile unsigned int ptxfemp :1;
1406 volatile unsigned int lpmint :1;
1407 volatile unsigned int conidstschng :1;
1408 volatile unsigned int discoonint :1; //Device enable ;
1409 volatile unsigned int sessreqint :1; //Slef powered ;
1410 volatile unsigned int wkupint :1; //Reserved ;
1413 volatile unsigned int dwValue ;
1416 /******************** USB2.0 Protocol Prototype ****************/
1418 typedef union usb_request_1_tag
1420 struct usb_request_1_map
1422 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1423 volatile unsigned int direction :1;
1424 volatile unsigned int type :2;
1425 volatile unsigned int recipient :5;
1426 volatile unsigned int brequest :8;
1427 volatile unsigned int value_l :8;
1428 volatile unsigned int value_m :8;
1430 volatile unsigned int recipient :5;
1431 volatile unsigned int type :2;
1432 volatile unsigned int direction :1;
1433 volatile unsigned int brequest :8;
1434 volatile unsigned int value_l :8;
1435 volatile unsigned int value_m :8;
1438 volatile unsigned int dwValue ;
1441 typedef union usb_request_2_tag
1443 struct usb_request_2_map
1446 volatile unsigned int index_l :8;
1447 volatile unsigned int index_m :8;
1448 volatile unsigned int length_l :8;
1449 volatile unsigned int length_m :8;
1451 volatile unsigned int dwValue ;
1454 typedef struct _usb_endp_cfg{
1461 #define USB_EPx_NUMBER 6
1462 /**----------------------------------------------------------------------------*
1463 ** Local Function Prototype **
1464 **----------------------------------------------------------------------------*/
1466 /**----------------------------------------------------------------------------*
1467 ** Function Prototype **
1468 **----------------------------------------------------------------------------*/
1471 /**----------------------------------------------------------------------------*
1473 **----------------------------------------------------------------------------*/
1477 /**---------------------------------------------------------------------------*/