- Timestamp:
- Mar 15, 2011, 5:41:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FirmwareFX2/usbjtag.c
r136 r137 101 101 // Enable Autopointer 102 102 103 EXTACC = 1; 104 APTR1FZ = 1; 105 APTR2FZ = 1; 103 EXTACC = 1; // Enable 104 APTR1FZ = 1; // Don't freeze 105 APTR2FZ = 1; // Don't freeze 106 106 107 107 // define endpoint configuration 108 108 109 REVCTL = 0x03; SYNCDELAY; 110 111 EP1OUTCFG = 0xA0; SYNCDELAY; 112 EP1INCFG = 0xA0; SYNCDELAY; 113 114 EP2CFG = 0xA2; SYNCDELAY; 115 EP6CFG = 0xE3; SYNCDELAY; 116 EP8CFG = 0xA0; SYNCDELAY; 117 118 EP4CFG = 0x20; SYNCDELAY; 109 REVCTL = 0x03; SYNCDELAY; // Allow FW access to FIFO buffer 110 111 EP1OUTCFG = 0xA0; SYNCDELAY; // Endpoint 1 Type Bulk 112 EP1INCFG = 0xA0; SYNCDELAY; // Endpoint 1 Type Bulk 113 114 EP2CFG = 0xA2; SYNCDELAY; // Endpoint 2 ON, OUT, BULK, 512, Buffer 2x 115 EP6CFG = 0xE3; SYNCDELAY; // Endpoint 6 ON, IN, BULK, 512, Buffer 3x 116 EP8CFG = 0xA0; SYNCDELAY; // Endpoint 8 ON, OUT, BULK, 512, Buffer 2x 117 118 EP4CFG = 0x20; SYNCDELAY; // Endpoint 4 OFF, OUT, BULK, 512, Buffer 2x 119 119 120 FIFORESET = 0x80; SYNCDELAY; 121 FIFORESET = 0x82; SYNCDELAY; 122 FIFORESET = 0x84; SYNCDELAY; 123 FIFORESET = 0x86; SYNCDELAY; 124 FIFORESET = 0x88; SYNCDELAY; 125 FIFORESET = 0x00; SYNCDELAY; 126 127 OUTPKTEND = 0x82; SYNCDELAY; 120 FIFORESET = 0x80; SYNCDELAY; // From now on, NAK all 121 FIFORESET = 0x82; SYNCDELAY; // Reset Endpoint 2 FIFO 122 FIFORESET = 0x84; SYNCDELAY; // Reset Endpoint 4 FIFO 123 FIFORESET = 0x86; SYNCDELAY; // Reset Endpoint 6 FIFO 124 FIFORESET = 0x88; SYNCDELAY; // Reset Endpoint 8 FIFO 125 FIFORESET = 0x00; SYNCDELAY; // Restore normal behaviour 126 127 OUTPKTEND = 0x82; SYNCDELAY; // Arm Endpoint 2 buffers to "prime the pump" 128 128 OUTPKTEND = 0x82; SYNCDELAY; 129 OUTPKTEND = 0x88; SYNCDELAY; 129 OUTPKTEND = 0x88; SYNCDELAY; // Arm Endpoint 8 buffers to "prime the pump" 130 130 OUTPKTEND = 0x88; SYNCDELAY; 131 131 132 REVCTL = 0x00; SYNCDELAY; 132 REVCTL = 0x00; SYNCDELAY; // Reset FW access to FIFO buffer, enable auto-arming when AUTOOUT is switched to 1 133 133 134 134 EP2FIFOCFG = 0x00; SYNCDELAY; … … 137 137 EP8FIFOCFG = bmAUTOOUT; SYNCDELAY; 138 138 139 EP8AUTOINLENH = 0x02; SYNCDELAY; 139 EP8AUTOINLENH = 0x02; SYNCDELAY; // Auto-commit 512-byte packets 140 140 EP8AUTOINLENL = 0x00; SYNCDELAY; 141 141 142 PINFLAGSAB = 0xEB; SYNCDELAY; 143 IOD |= (1 << 4); SYNCDELAY; 142 PINFLAGSAB = 0xEB; SYNCDELAY; // 1111_1010 => FLAGA = EMPTY flag for EP6; FLAGB = FULL flag for EP8 143 IOD |= (1 << 4); SYNCDELAY; // LED turned off by default 144 144 } 145 145
Note:
See TracChangeset
for help on using the changeset viewer.