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();
}
--- /dev/null
+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;
+
+}
+
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;
}
+++ /dev/null
-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;
-}
-
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;
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";