projects
/
my-code
/
fpga.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df3c439
)
cafete backups
author
hackbard
<hackbard>
Mon, 26 Feb 2007 14:17:00 +0000
(14:17 +0000)
committer
hackbard
<hackbard>
Mon, 26 Feb 2007 14:17:00 +0000
(14:17 +0000)
fx2/fx2.c
patch
|
blob
|
history
diff --git
a/fx2/fx2.c
b/fx2/fx2.c
index
6b2fe21
..
fcb3dd4
100644
(file)
--- a/
fx2/fx2.c
+++ b/
fx2/fx2.c
@@
-30,13
+30,18
@@
xdata at 0xe600 volatile u8 CPUCS;
xdata at 0xe601 volatile u8 IFCONFIG;
/* endpoint configuration */
xdata at 0xe601 volatile u8 IFCONFIG;
/* endpoint configuration */
+xdata at 0xe604 volatile u8 FIFORESET;
xdata at 0xe60b volatile u8 REVCTL;
xdata at 0xe612 volatile u8 EP2CFG;
xdata at 0xe60b volatile u8 REVCTL;
xdata at 0xe612 volatile u8 EP2CFG;
+xdata at 0xe613 volatile u8 EP4CFG;
xdata at 0xe614 volatile u8 EP6CFG;
xdata at 0xe614 volatile u8 EP6CFG;
+xdata at 0xe615 volatile u8 EP8CFG;
xdata at 0xe618 volatile u8 EP2FIFOCFG;
xdata at 0xe619 volatile u8 EP4FIFOCFG;
xdata at 0xe61a volatile u8 EP6FIFOCFG;
xdata at 0xe61b volatile u8 EP8FIFOCFG;
xdata at 0xe618 volatile u8 EP2FIFOCFG;
xdata at 0xe619 volatile u8 EP4FIFOCFG;
xdata at 0xe61a volatile u8 EP6FIFOCFG;
xdata at 0xe61b volatile u8 EP8FIFOCFG;
+xdata at 0xe624 volatile u8 EP6AUTOINLENH;
+xdata at 0xe625 volatile u8 EP6AUTOINLENL;
/* special funtion registers */
sfr at 0xb5 OED;
/* special funtion registers */
sfr at 0xb5 OED;
@@
-98,19
+103,16
@@
void slave_fifo_init() {
/* endpoint configuration:
*
/* endpoint configuration:
*
- * (assuming 'high bandwidth in' [fpga -> host]
- * and 'low bandwidth out' [host->fpga] applications)
- *
- * ep2: bulk in 3x1024
- * ep6: bulk out 2x512
+ * ep2: bulk in 4x512
+ * ep6: bulk out 4x512
*
*
- * 0x
eb = 1 1 1 0 1 0 1 1 = bulk in 3x1024
- * 0x
a2 = 1 0 1 0 0 0 1 0 = bulk out 2
x512
+ * 0x
a0 = 1 0 1 0 0 0 0 0 = bulk out 4x512
+ * 0x
e0 = 1 1 1 0 0 0 0 0 = bulk in 4
x512
* 0x01 = 0 0 0 0 0 0 0 1 = invalid (bit,type,buf)
*/
* 0x01 = 0 0 0 0 0 0 0 1 = invalid (bit,type,buf)
*/
- EP2CFG=0x
eb
;
+ EP2CFG=0x
a0
;
EP4CFG=0x01;
EP4CFG=0x01;
- EP6CFG=0x
a2
;
+ EP6CFG=0x
e0
;
EP8CFG=0x01;
/* reset the fifo */
EP8CFG=0x01;
/* reset the fifo */
@@
-119,11
+121,11
@@
void slave_fifo_init() {
FIFORESET=0x06; /* reset ep6 */
FIFORESET=0x00; /* restore normal operation */
FIFORESET=0x06; /* reset ep6 */
FIFORESET=0x00; /* restore normal operation */
- /* auto in/out, no cpu interaction! auto in len =
1024
*/
- EP2FIFOCFG|=(1<<
3
);
- EP
2AUTOINLENH=(1<<2
);
- EP
2AUTOINLENL=0
;
- EP6
FIFOCFG|=(1<<4)
;
+ /* auto in/out, no cpu interaction! auto in len =
512
*/
+ EP2FIFOCFG|=(1<<
4
);
+ EP
6FIFOCFG|=(1<<3
);
+ EP
6AUTOINLENH=(1<<1)
;
+ EP6
AUTOINLENL=0
;
/* maybe OUTPKTEND necessary (with skip=1) */
}
/* maybe OUTPKTEND necessary (with skip=1) */
}