1 |
/*---------------------------------------------------------------------------- |
---|
2 |
* U S B - K e r n e l |
---|
3 |
*---------------------------------------------------------------------------- |
---|
4 |
* Name: USBREG.H |
---|
5 |
* Purpose: USB Hardware Layer Definitions for Philips LPC214x/LPC318x/23xx/24xx |
---|
6 |
* Version: V1.10 |
---|
7 |
*---------------------------------------------------------------------------- |
---|
8 |
* This file is part of the uVision/ARM development tools. |
---|
9 |
* This software may only be used under the terms of a valid, current, |
---|
10 |
* end user licence from KEIL for a compatible version of KEIL software |
---|
11 |
* development tools. Nothing else gives you the right to use it. |
---|
12 |
* |
---|
13 |
* Copyright (c) 2005-2007 Keil Software. |
---|
14 |
*---------------------------------------------------------------------------*/ |
---|
15 |
|
---|
16 |
#ifndef __USBREG_H |
---|
17 |
#define __USBREG_H |
---|
18 |
|
---|
19 |
/* Device Interrupt Bit Definitions */ |
---|
20 |
#define FRAME_INT 0x00000001 |
---|
21 |
#define EP_FAST_INT 0x00000002 |
---|
22 |
#define EP_SLOW_INT 0x00000004 |
---|
23 |
#define DEV_STAT_INT 0x00000008 |
---|
24 |
#define CCEMTY_INT 0x00000010 |
---|
25 |
#define CDFULL_INT 0x00000020 |
---|
26 |
#define RxENDPKT_INT 0x00000040 |
---|
27 |
#define TxENDPKT_INT 0x00000080 |
---|
28 |
#define EP_RLZED_INT 0x00000100 |
---|
29 |
#define ERR_INT 0x00000200 |
---|
30 |
|
---|
31 |
/* Rx & Tx Packet Length Definitions */ |
---|
32 |
#define PKT_LNGTH_MASK 0x000003FF |
---|
33 |
#define PKT_DV 0x00000400 |
---|
34 |
#define PKT_RDY 0x00000800 |
---|
35 |
|
---|
36 |
/* USB Control Definitions */ |
---|
37 |
#define CTRL_RD_EN 0x00000001 |
---|
38 |
#define CTRL_WR_EN 0x00000002 |
---|
39 |
|
---|
40 |
/* Command Codes */ |
---|
41 |
#define CMD_SET_ADDR 0x00D00500 |
---|
42 |
#define CMD_CFG_DEV 0x00D80500 |
---|
43 |
#define CMD_SET_MODE 0x00F30500 |
---|
44 |
#define CMD_RD_FRAME 0x00F50500 |
---|
45 |
#define DAT_RD_FRAME 0x00F50200 |
---|
46 |
#define CMD_RD_TEST 0x00FD0500 |
---|
47 |
#define DAT_RD_TEST 0x00FD0200 |
---|
48 |
#define CMD_SET_DEV_STAT 0x00FE0500 |
---|
49 |
#define CMD_GET_DEV_STAT 0x00FE0500 |
---|
50 |
#define DAT_GET_DEV_STAT 0x00FE0200 |
---|
51 |
#define CMD_GET_ERR_CODE 0x00FF0500 |
---|
52 |
#define DAT_GET_ERR_CODE 0x00FF0200 |
---|
53 |
#define CMD_RD_ERR_STAT 0x00FB0500 |
---|
54 |
#define DAT_RD_ERR_STAT 0x00FB0200 |
---|
55 |
#define DAT_WR_BYTE(x) (0x00000100 | ((x) << 16)) |
---|
56 |
#define CMD_SEL_EP(x) (0x00000500 | ((x) << 16)) |
---|
57 |
#define DAT_SEL_EP(x) (0x00000200 | ((x) << 16)) |
---|
58 |
#define CMD_SEL_EP_CLRI(x) (0x00400500 | ((x) << 16)) |
---|
59 |
#define DAT_SEL_EP_CLRI(x) (0x00400200 | ((x) << 16)) |
---|
60 |
#define CMD_SET_EP_STAT(x) (0x00400500 | ((x) << 16)) |
---|
61 |
#define CMD_CLR_BUF 0x00F20500 |
---|
62 |
#define DAT_CLR_BUF 0x00F20200 |
---|
63 |
#define CMD_VALID_BUF 0x00FA0500 |
---|
64 |
|
---|
65 |
/* Device Address Register Definitions */ |
---|
66 |
#define DEV_ADDR_MASK 0x7F |
---|
67 |
#define DEV_EN 0x80 |
---|
68 |
|
---|
69 |
/* Device Configure Register Definitions */ |
---|
70 |
#define CONF_DVICE 0x01 |
---|
71 |
|
---|
72 |
/* Device Mode Register Definitions */ |
---|
73 |
#define AP_CLK 0x01 |
---|
74 |
#define INAK_CI 0x02 |
---|
75 |
#define INAK_CO 0x04 |
---|
76 |
#define INAK_II 0x08 |
---|
77 |
#define INAK_IO 0x10 |
---|
78 |
#define INAK_BI 0x20 |
---|
79 |
#define INAK_BO 0x40 |
---|
80 |
|
---|
81 |
/* Device Status Register Definitions */ |
---|
82 |
#define DEV_CON 0x01 |
---|
83 |
#define DEV_CON_CH 0x02 |
---|
84 |
#define DEV_SUS 0x04 |
---|
85 |
#define DEV_SUS_CH 0x08 |
---|
86 |
#define DEV_RST 0x10 |
---|
87 |
|
---|
88 |
/* Error Code Register Definitions */ |
---|
89 |
#define ERR_EC_MASK 0x0F |
---|
90 |
#define ERR_EA 0x10 |
---|
91 |
|
---|
92 |
/* Error Status Register Definitions */ |
---|
93 |
#define ERR_PID 0x01 |
---|
94 |
#define ERR_UEPKT 0x02 |
---|
95 |
#define ERR_DCRC 0x04 |
---|
96 |
#define ERR_TIMOUT 0x08 |
---|
97 |
#define ERR_EOP 0x10 |
---|
98 |
#define ERR_B_OVRN 0x20 |
---|
99 |
#define ERR_BTSTF 0x40 |
---|
100 |
#define ERR_TGL 0x80 |
---|
101 |
|
---|
102 |
/* Endpoint Select Register Definitions */ |
---|
103 |
#define EP_SEL_F 0x01 |
---|
104 |
#define EP_SEL_ST 0x02 |
---|
105 |
#define EP_SEL_STP 0x04 |
---|
106 |
#define EP_SEL_PO 0x08 |
---|
107 |
#define EP_SEL_EPN 0x10 |
---|
108 |
#define EP_SEL_B_1_FULL 0x20 |
---|
109 |
#define EP_SEL_B_2_FULL 0x40 |
---|
110 |
|
---|
111 |
/* Endpoint Status Register Definitions */ |
---|
112 |
#define EP_STAT_ST 0x01 |
---|
113 |
#define EP_STAT_DA 0x20 |
---|
114 |
#define EP_STAT_RF_MO 0x40 |
---|
115 |
#define EP_STAT_CND_ST 0x80 |
---|
116 |
|
---|
117 |
/* Clear Buffer Register Definitions */ |
---|
118 |
#define CLR_BUF_PO 0x01 |
---|
119 |
|
---|
120 |
|
---|
121 |
/* DMA Interrupt Bit Definitions */ |
---|
122 |
#define EOT_INT 0x01 |
---|
123 |
#define NDD_REQ_INT 0x02 |
---|
124 |
#define SYS_ERR_INT 0x04 |
---|
125 |
|
---|
126 |
|
---|
127 |
#endif /* __USBREG_H */ |
---|