checkpoint
authoradam <adam@megacz.com>
Fri, 22 Sep 2006 03:12:18 +0000 (04:12 +0100)
committeradam <adam@megacz.com>
Fri, 22 Sep 2006 03:12:18 +0000 (04:12 +0100)
src/com/atmel/fpslic/FpslicBoot.java [moved from src/com/atmel/fpslic/FpslicRaw.java with 95% similarity]
src/com/atmel/fpslic/FpslicBootPins.java [new file with mode: 0644]
src/com/atmel/fpslic/FpslicBootPinsUsb.java [moved from src/com/atmel/fpslic/FpslicPinsUsb.java with 89% similarity]
src/com/atmel/fpslic/FpslicPins.java [deleted file]
src/edu/berkeley/slipway/FtdiBoard.java

similarity index 95%
rename from src/com/atmel/fpslic/FpslicRaw.java
rename to src/com/atmel/fpslic/FpslicBoot.java
index fe39293..0d2c523 100644 (file)
@@ -4,13 +4,13 @@ import com.ftdi.usb.*;
 import java.io.*;
 
 /**
- * "Raw" access to an <i>unconfigured</i> FPSLIC -- used to load the initial bitstream.
+ * Bitstream level access to the bootstrap interface (protocol wrapper around FpslicPins)
  */
-public class FpslicRaw {
+public class FpslicBoot {
 
-    private FpslicPins pins;
+    private FpslicBootPins pins;
 
-    public FpslicRaw(FpslicPins pins) throws IOException {
+    public FpslicBoot(FpslicBootPins pins) throws IOException {
         this.pins = pins;
         reset();
     }
diff --git a/src/com/atmel/fpslic/FpslicBootPins.java b/src/com/atmel/fpslic/FpslicBootPins.java
new file mode 100644 (file)
index 0000000..2f5e451
--- /dev/null
@@ -0,0 +1,25 @@
+package com.atmel.fpslic;
+import com.ftdi.usb.*;
+import java.io.*;
+
+/**
+ * Pin-level access to the bootstrap interface of the FPSLIC
+ */
+public interface FpslicBootPins {
+
+    public void    avrrstPin(boolean on)      throws IOException;
+    public void    cclkPin(boolean on)        throws IOException;
+    public void    configDataPin(boolean on)  throws IOException;
+    public void    resetPin(boolean on)       throws IOException;
+    public boolean initPin()                  throws IOException;
+    public void    releaseConPin()            throws IOException;
+    public void    conPin(boolean on)         throws IOException;
+
+    public void    flush()                    throws IOException;
+    public void    close()                    throws IOException;
+
+    public InputStream  getUartInputStream()  throws IOException;
+    public OutputStream getUartOutputStream() throws IOException;
+
+}
+
similarity index 89%
rename from src/com/atmel/fpslic/FpslicPinsUsb.java
rename to src/com/atmel/fpslic/FpslicBootPinsUsb.java
index ebd25d3..32d5763 100644 (file)
@@ -2,14 +2,16 @@ package com.atmel.fpslic;
 import com.ftdi.usb.*;
 import java.io.*;
 
+// TODO: more state checking (ie must have reset high before uart-mode, etc)
+
 /**
- * Exposes the raw pin-level configuration interface to the FPSLIC
+ * Pin-level access to the bootstrap port of an FPSLIC via an FTDI USB-UART
  */
-public class FpslicPinsUsb implements FpslicPins {
+public class FpslicBootPinsUsb implements FpslicBootPins {
 
     private FtdiUart ftdiuart;
 
-    public FpslicPinsUsb(FtdiUart ftdiuart) {
+    public FpslicBootPinsUsb(FtdiUart ftdiuart) {
         this.ftdiuart = ftdiuart;
     }
 
diff --git a/src/com/atmel/fpslic/FpslicPins.java b/src/com/atmel/fpslic/FpslicPins.java
deleted file mode 100644 (file)
index 36bf651..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.atmel.fpslic;
-import com.ftdi.usb.*;
-import java.io.*;
-
-/**
- * Exposes the raw pin-level configuration interface to the FPSLIC
- */
-public interface FpslicPins {
-    public void    avrrstPin(boolean on)     throws IOException;
-    public void    cclkPin(boolean on)       throws IOException;
-    public void    configDataPin(boolean on) throws IOException;
-    public void    resetPin(boolean on)      throws IOException;
-    public boolean initPin()                 throws IOException;
-    public void    releaseConPin()           throws IOException;
-    public void    conPin(boolean on)        throws IOException;
-
-    public void    flush()                   throws IOException;
-    public void    close()                   throws IOException;
-
-    public InputStream  getUartInputStream() throws IOException;
-    public OutputStream getUartOutputStream() throws IOException;
-}
-
index d1c582c..17f9cce 100644 (file)
@@ -14,7 +14,7 @@ public class FtdiBoard extends Board {
         System.load(new File("build/"+System.mapLibraryName("FtdiUartNative")).getAbsolutePath());
     }
 
-    private final FpslicRaw chip;
+    private final FpslicBoot chip;
     private final InputStream in;
     private final OutputStream out;
 
@@ -22,7 +22,7 @@ public class FtdiBoard extends Board {
     public OutputStream getOutputStream() { return out; }
 
     public FtdiBoard() throws Exception {
-        chip = new FpslicRaw(new FpslicPinsUsb(new FtdiUart(0x6666, 0x3133, 1500 * 1000)));
+        chip = new FpslicBoot(new FpslicBootPinsUsb(new FtdiUart(0x6666, 0x3133, 1500 * 1000)));
         String bstFile = this.getClass().getName();
         bstFile = bstFile.substring(0, bstFile.lastIndexOf('.'));
         bstFile = bstFile.replace('.', '/')+"/slipway_drone.bst";