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