- RegisterDictioniary updated
- TestClasses added - Some unnecessary imports removed git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@58 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -3,7 +3,7 @@ package ch.ntb.mcdp.dict;
|
||||
public class Register {
|
||||
|
||||
// Register Types
|
||||
public static String[] types = null;
|
||||
protected static String[] types = null;
|
||||
|
||||
public Register(String name, int type, int value, int size,
|
||||
String description) {
|
||||
@@ -29,4 +29,8 @@ public class Register {
|
||||
return new String(name + "\t" + types[type] + "\t0x"
|
||||
+ Integer.toHexString(value) + "\t" + size + "\t" + description);
|
||||
}
|
||||
|
||||
public String[] getTypes(){
|
||||
return types;
|
||||
}
|
||||
}
|
||||
|
||||
32
mcdp/src/ch/ntb/mcdp/dict/test/Test332Dict.java
Normal file
32
mcdp/src/ch/ntb/mcdp/dict/test/Test332Dict.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package ch.ntb.mcdp.dict.test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import ch.ntb.mcdp.mc68332.MC68332RegisterDict;
|
||||
|
||||
public class Test332Dict {
|
||||
|
||||
private static final String PATH_TO_REGISTER_FILE = "resources/targets/mc68332/registerDictionary.xml";
|
||||
|
||||
public static void main(String[] args) {
|
||||
MC68332RegisterDict regdict = new MC68332RegisterDict();
|
||||
|
||||
try {
|
||||
regdict.addRegistersFromFile(PATH_TO_REGISTER_FILE);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ParserConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SAXException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
regdict.printRegisters();
|
||||
}
|
||||
}
|
||||
29
mcdp/src/ch/ntb/mcdp/dict/test/Test555Dict.java
Normal file
29
mcdp/src/ch/ntb/mcdp/dict/test/Test555Dict.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package ch.ntb.mcdp.dict.test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import ch.ntb.mcdp.mpc555.MPC555RegisterDict;
|
||||
|
||||
public class Test555Dict {
|
||||
|
||||
private static final String PATH_TO_REGISTER_FILE = "resources/targets/mpc555/registerDictionary.xml";
|
||||
|
||||
public static void main(String[] args) {
|
||||
MPC555RegisterDict regdict = new MPC555RegisterDict();
|
||||
|
||||
try {
|
||||
regdict.addRegistersFromFile(PATH_TO_REGISTER_FILE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ParserConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SAXException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
regdict.printRegisters();
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class MC68332RegisterDict extends RegisterDict {
|
||||
|
||||
private static final String PATH_TO_REGISTER_FILE = "resources/targets/mc68332/registerDictionary.xml";
|
||||
|
||||
MC68332RegisterDict() {
|
||||
public MC68332RegisterDict() {
|
||||
super(REGISTER_CLASS);
|
||||
|
||||
// TODO: remove
|
||||
|
||||
@@ -5,8 +5,10 @@ import ch.ntb.mcdp.dict.Register;
|
||||
public class MPC555Register extends Register {
|
||||
|
||||
// Register Types
|
||||
static final String[] types = new String[] { "GPR", "FPR", "SPR", "MSR",
|
||||
"CR", "FPSCR", "CtrlReg" };
|
||||
static {
|
||||
types = new String[] { "GPR", "FPR", "SPR", "MSR", "CR", "FPSCR",
|
||||
"CtrlReg" };
|
||||
}
|
||||
|
||||
static final int GPR = 0;
|
||||
|
||||
@@ -22,7 +24,7 @@ public class MPC555Register extends Register {
|
||||
|
||||
static final int CtrlReg = 6;
|
||||
|
||||
protected MPC555Register(String name, int type, int value, int size,
|
||||
public MPC555Register(String name, int type, int value, int size,
|
||||
String description) {
|
||||
super(name, type, value, size, description);
|
||||
}
|
||||
|
||||
@@ -1,35 +1,12 @@
|
||||
package ch.ntb.mcdp.mpc555;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import ch.ntb.mcdp.dict.RegisterDict;
|
||||
|
||||
public class MPC555RegisterDict extends RegisterDict {
|
||||
|
||||
private static final String REGISTER_CLASS = "ch.ntb.mcdp.mpc555.MPC555RegisterDict";
|
||||
private static final String REGISTER_CLASS = "ch.ntb.mcdp.mpc555.MPC555Register";
|
||||
|
||||
private static final String PATH_TO_REGISTER_FILE = "resources/targets/mpc555/registerDictionary.xml";
|
||||
|
||||
MPC555RegisterDict() {
|
||||
public MPC555RegisterDict() {
|
||||
super(REGISTER_CLASS);
|
||||
|
||||
// TODO: remove
|
||||
try {
|
||||
addRegistersFromFile(PATH_TO_REGISTER_FILE);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ParserConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SAXException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
printRegisters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package ch.ntb.mcdp.uart;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import ch.ntb.mcdp.usb.DataPacket;
|
||||
|
||||
public class Uart0 extends Uart {
|
||||
|
||||
Uart0(LinkedList<Uart> list) {
|
||||
|
||||
Reference in New Issue
Block a user