]> hackdaworld.org Git - my-code/fpga.git/commitdiff
more init stuff
authorhackbard <hackbard>
Sat, 24 Feb 2007 19:08:57 +0000 (19:08 +0000)
committerhackbard <hackbard>
Sat, 24 Feb 2007 19:08:57 +0000 (19:08 +0000)
fx2/fx2.c

index 800dd52248051c4c8a6ef72913362159c85df7f1..aa8d4cbdcaee79318c4df015192418fdee587de0 100644 (file)
--- a/fx2/fx2.c
+++ b/fx2/fx2.c
@@ -31,7 +31,51 @@ void power_on() {
        IOD|=(1<<7);
 }
 
-void main() {
+void slave_fifo_init() {
+
+       /* set bit 0 and 1 - fifo slave config */       
+       IFCONFIG|=0x03;
+
+       /* async mode */
+       IFCONFIG|=0x04;
+
+       /* 8 bit fifo to all endpoints */
+       EP2FIFOCFG&=^(1<<0);
+       EP4FIFOCFG&=^(1<<0);
+       EP6FIFOCFG&=^(1<<0);
+       EP8FIFOCFG&=^(1<<0);
+
+       /* default indexed flag configuration:
+        *
+        * flag a: programmable level
+        * flag b: full
+        * flag c: empty
+        *
+        * todo: -> fixed configuration
+        */
+
+
+}
+
+void fx2_init() {
 
+       /* swicth on power */
        power_on();
+
+       /* slave fifo init */
+       slave_fifo_init();
+
 }
+
+void main() {
+
+       /* initialize the fx2 */
+       fx2_init();
+
+       /* do the job ... */
+       while(1) {
+       
+       }
+
+}
+