Procházet zdrojové kódy

Begin preparing the analyzer

Baglio Tabifata před 4 roky
rodič
revize
39741bfb0b

+ 2 - 2
src/net/hkzlab/devices/PAL16R4Specs.java

@@ -1,6 +1,6 @@
 package net.hkzlab.devices;
 
-public class PAL16R4Specs implements PALSpecsInterface {
+public class PAL16R4Specs implements PALSpecs {
 
     @Override
     public int getNumINPins() {
@@ -49,6 +49,6 @@ public class PAL16R4Specs implements PALSpecsInterface {
 
     @Override
     public int getROUT_WRITEMask() {
-        return 0x00007800;
+        return getROUT_READMask() << 10;
     }
 }

+ 2 - 2
src/net/hkzlab/devices/PAL16R6Specs.java

@@ -1,6 +1,6 @@
 package net.hkzlab.devices;
 
-public class PAL16R6Specs implements PALSpecsInterface {
+public class PAL16R6Specs implements PALSpecs {
 
     @Override
     public int getNumINPins() {
@@ -49,6 +49,6 @@ public class PAL16R6Specs implements PALSpecsInterface {
 
     @Override
     public int getROUT_WRITEMask() {
-        return 0x0000FC00;
+        return getROUT_READMask() << 10;
     }
 }

+ 1 - 1
src/net/hkzlab/devices/PALSpecsInterface.java → src/net/hkzlab/devices/PALSpecs.java

@@ -1,6 +1,6 @@
 package net.hkzlab.devices;
 
-public interface PALSpecsInterface {
+public interface PALSpecs {
     public int getNumINPins();
     public int getNumIOPins();
     public int getNumROUTPins();

+ 28 - 0
src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

@@ -0,0 +1,28 @@
+package net.hkzlab.dupal.boardio;
+
+import net.hkzlab.devices.PALSpecs;
+
+public class DuPALAnalyzer {
+    private final DuPALManager dpm;
+    private final PALSpecs pspecs;
+    private int IOasOUT_Mask = -1;
+
+    public DuPALAnalyzer(final DuPALManager dpm, final PALSpecs pspecs, final int IOasOUT_Mask) {
+        this.dpm = dpm;
+        this.pspecs = pspecs;
+        this.IOasOUT_Mask = IOasOUT_Mask;
+    } 
+    
+    public DuPALAnalyzer(final DuPALManager dpm, final PALSpecs pspecs) {
+        this(dpm, pspecs, -1);
+    }
+
+    public void startAnalisys() {
+        if(IOasOUT_Mask < 0) { // We need to detect the status of the IOs...
+            // TODO: Try to guess whether IOs are Inputs or Outputs
+        }
+
+        // TODO: Actually perform the analisys
+
+    }
+}