Go to the documentation of this file.
17 #if !defined(_usb_h_) || defined(_max3421e_h_)
18 #error "Never include max3421e.h directly; include Usb.h instead"
42 #define rRCVFIFO 0x08 //1<<3
43 #define rSNDFIFO 0x10 //2<<3
44 #define rSUDFIFO 0x20 //4<<3
45 #define rRCVBC 0x30 //6<<3
46 #define rSNDBC 0x38 //7<<3
48 #define rUSBIRQ 0x68 //13<<3
50 #define bmVBUSIRQ 0x40 //b6
51 #define bmNOVBUSIRQ 0x20 //b5
52 #define bmOSCOKIRQ 0x01 //b0
54 #define rUSBIEN 0x70 //14<<3
56 #define bmVBUSIE 0x40 //b6
57 #define bmNOVBUSIE 0x20 //b5
58 #define bmOSCOKIE 0x01 //b0
60 #define rUSBCTL 0x78 //15<<3
62 #define bmCHIPRES 0x20 //b5
63 #define bmPWRDOWN 0x10 //b4
65 #define rCPUCTL 0x80 //16<<3
67 #define bmPUSLEWID1 0x80 //b7
68 #define bmPULSEWID0 0x40 //b6
69 #define bmIE 0x01 //b0
71 #define rPINCTL 0x88 //17<<3
73 #define bmFDUPSPI 0x10 //b4
74 #define bmINTLEVEL 0x08 //b3
75 #define bmPOSINT 0x04 //b2
76 #define bmGPXB 0x02 //b1
77 #define bmGPXA 0x01 //b0
79 #define GPX_OPERATE 0x00
80 #define GPX_VBDET 0x01
81 #define GPX_BUSACT 0x02
84 #define rREVISION 0x90 //18<<3
86 #define rIOPINS1 0xa0 //20<<3
98 #define rIOPINS2 0xa8 //21<<3
100 #define bmGPOUT4 0x01
101 #define bmGPOUT5 0x02
102 #define bmGPOUT6 0x04
103 #define bmGPOUT7 0x08
109 #define rGPINIRQ 0xb0 //22<<3
111 #define bmGPINIRQ0 0x01
112 #define bmGPINIRQ1 0x02
113 #define bmGPINIRQ2 0x04
114 #define bmGPINIRQ3 0x08
115 #define bmGPINIRQ4 0x10
116 #define bmGPINIRQ5 0x20
117 #define bmGPINIRQ6 0x40
118 #define bmGPINIRQ7 0x80
120 #define rGPINIEN 0xb8 //23<<3
122 #define bmGPINIEN0 0x01
123 #define bmGPINIEN1 0x02
124 #define bmGPINIEN2 0x04
125 #define bmGPINIEN3 0x08
126 #define bmGPINIEN4 0x10
127 #define bmGPINIEN5 0x20
128 #define bmGPINIEN6 0x40
129 #define bmGPINIEN7 0x80
131 #define rGPINPOL 0xc0 //24<<3
133 #define bmGPINPOL0 0x01
134 #define bmGPINPOL1 0x02
135 #define bmGPINPOL2 0x04
136 #define bmGPINPOL3 0x08
137 #define bmGPINPOL4 0x10
138 #define bmGPINPOL5 0x20
139 #define bmGPINPOL6 0x40
140 #define bmGPINPOL7 0x80
142 #define rHIRQ 0xc8 //25<<3
144 #define bmBUSEVENTIRQ 0x01 // indicates BUS Reset Done or BUS Resume
145 #define bmRWUIRQ 0x02
146 #define bmRCVDAVIRQ 0x04
147 #define bmSNDBAVIRQ 0x08
148 #define bmSUSDNIRQ 0x10
149 #define bmCONDETIRQ 0x20
150 #define bmFRAMEIRQ 0x40
151 #define bmHXFRDNIRQ 0x80
153 #define rHIEN 0xd0 //26<<3
156 #define bmBUSEVENTIE 0x01
158 #define bmRCVDAVIE 0x04
159 #define bmSNDBAVIE 0x08
160 #define bmSUSDNIE 0x10
161 #define bmCONDETIE 0x20
162 #define bmFRAMEIE 0x40
163 #define bmHXFRDNIE 0x80
165 #define rMODE 0xd8 //27<<3
169 #define bmLOWSPEED 0x02
170 #define bmHUBPRE 0x04
171 #define bmSOFKAENAB 0x08
172 #define bmSEPIRQ 0x10
173 #define bmDELAYISO 0x20
174 #define bmDMPULLDN 0x40
175 #define bmDPPULLDN 0x80
177 #define rPERADDR 0xe0 //28<<3
179 #define rHCTL 0xe8 //29<<3
181 #define bmBUSRST 0x01
182 #define bmFRMRST 0x02
183 #define bmSAMPLEBUS 0x04
184 #define bmSIGRSM 0x08
185 #define bmRCVTOG0 0x10
186 #define bmRCVTOG1 0x20
187 #define bmSNDTOG0 0x40
188 #define bmSNDTOG1 0x80
190 #define rHXFR 0xf0 //30<<3
193 #define tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1
194 #define tokIN 0x00 // HS=0, ISO=0, OUTNIN=0, SETUP=0
195 #define tokOUT 0x20 // HS=0, ISO=0, OUTNIN=1, SETUP=0
196 #define tokINHS 0x80 // HS=1, ISO=0, OUTNIN=0, SETUP=0
197 #define tokOUTHS 0xA0 // HS=1, ISO=0, OUTNIN=1, SETUP=0
198 #define tokISOIN 0x40 // HS=0, ISO=1, OUTNIN=0, SETUP=0
199 #define tokISOOUT 0x60 // HS=0, ISO=1, OUTNIN=1, SETUP=0
201 #define rHRSL 0xf8 //31<<3
204 #define bmRCVTOGRD 0x10
205 #define bmSNDTOGRD 0x20
206 #define bmKSTATUS 0x40
207 #define bmJSTATUS 0x80
208 #define bmSE0 0x00 //SE0 - disconnect state
209 #define bmSE1 0xc0 //SE1 - illegal state
212 #define hrSUCCESS 0x00
214 #define hrBADREQ 0x02
218 #define hrTOGERR 0x06
219 #define hrWRONGPID 0x07
221 #define hrPIDERR 0x09
222 #define hrPKTERR 0x0A
223 #define hrCRCERR 0x0B
226 #define hrTIMEOUT 0x0E
227 #define hrBABBLE 0x0F
229 #define MODE_FS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmSOFKAENAB)
230 #define MODE_LS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmLOWSPEED|bmSOFKAENAB)
233 #endif //_max3421e_h_