|
@@ -20,6 +20,13 @@ public class DuPALProto {
|
|
|
return CMD_START+CMD_READ+CMD_END;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * The command will toggle the following pins on the DuPAL, from LSB to MSB
|
|
|
+ * 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 (these are connected directly to the PAL)
|
|
|
+ * 18, 17, 16, 15, 14, 13, 19, 12 (these are connected to the pin through a 10k resistor, acting as pulls)
|
|
|
+ * @param address the combination of output to compose on the DuPAL
|
|
|
+ * @return The generated command
|
|
|
+ */
|
|
|
public static String buildWRITECommand(int address) {
|
|
|
return ""+CMD_START+CMD_WRITE+" "+String.format("%08X", address & 0x3FFFF)+CMD_END;
|
|
|
}
|
|
@@ -32,6 +39,12 @@ public class DuPALProto {
|
|
|
return ""+CMD_START+CMD_RESET+CMD_END;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * This method returns the status of the PINs of the device inserted in the DuPAL, in this order, from LSB to MSB:
|
|
|
+ * 18, 17, 16, 15, 14, 13, 19, 12
|
|
|
+ * @param response String containing the response received by the DuPAL
|
|
|
+ * @return Returns an integer containing the state of the PAL pins
|
|
|
+ */
|
|
|
public static int handleREADResponse(String response) {
|
|
|
String[] readRes = parseResponse(response);
|
|
|
|