From: adam Date: Fri, 22 Sep 2006 03:12:18 +0000 (+0100) Subject: checkpoint X-Git-Tag: mpar_demo_release~44 X-Git-Url: http://git.megacz.com/?p=slipway.git;a=commitdiff_plain;h=c500701544bf3f44cf90713c8c7d95cf84bd001e checkpoint --- diff --git a/src/com/atmel/fpslic/FpslicRaw.java b/src/com/atmel/fpslic/FpslicBoot.java similarity index 95% rename from src/com/atmel/fpslic/FpslicRaw.java rename to src/com/atmel/fpslic/FpslicBoot.java index fe39293..0d2c523 100644 --- a/src/com/atmel/fpslic/FpslicRaw.java +++ b/src/com/atmel/fpslic/FpslicBoot.java @@ -4,13 +4,13 @@ import com.ftdi.usb.*; import java.io.*; /** - * "Raw" access to an unconfigured 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 index 0000000..2f5e451 --- /dev/null +++ b/src/com/atmel/fpslic/FpslicBootPins.java @@ -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; + +} + diff --git a/src/com/atmel/fpslic/FpslicPinsUsb.java b/src/com/atmel/fpslic/FpslicBootPinsUsb.java similarity index 89% rename from src/com/atmel/fpslic/FpslicPinsUsb.java rename to src/com/atmel/fpslic/FpslicBootPinsUsb.java index ebd25d3..32d5763 100644 --- a/src/com/atmel/fpslic/FpslicPinsUsb.java +++ b/src/com/atmel/fpslic/FpslicBootPinsUsb.java @@ -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 index 36bf651..0000000 --- a/src/com/atmel/fpslic/FpslicPins.java +++ /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; -} - diff --git a/src/edu/berkeley/slipway/FtdiBoard.java b/src/edu/berkeley/slipway/FtdiBoard.java index d1c582c..17f9cce 100644 --- a/src/edu/berkeley/slipway/FtdiBoard.java +++ b/src/edu/berkeley/slipway/FtdiBoard.java @@ -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";