- BDI332 renamed to MC68332

- BDI555 renamed to MPC555

git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@44 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
schlaepfer
2005-11-10 07:46:02 +00:00
parent 3243153a0e
commit e4247ece42
5 changed files with 55 additions and 56 deletions

View File

@@ -7,7 +7,7 @@ import ch.ntb.mcdp.usb.USBDevice;
import ch.ntb.usb.USB;
import ch.ntb.usb.USBException;
public class BDI332 {
public class MC68332 {
// BDI subtypes
/**

View File

@@ -7,7 +7,7 @@ import ch.ntb.mcdp.usb.USBDevice;
import ch.ntb.usb.USB;
import ch.ntb.usb.USBException;
public class BDI555 {
public class MPC555 {
// BDI subtypes
/**

View File

@@ -1,7 +1,7 @@
package ch.ntb.mcdp.bdi.test;
import ch.ntb.mcdp.bdi.BDI332;
import ch.ntb.mcdp.bdi.BDIException;
import ch.ntb.mcdp.bdi.MC68332;
import ch.ntb.mcdp.mc68332.IMCBTargetBoard;
import ch.ntb.mcdp.usb.DataPacket;
import ch.ntb.mcdp.usb.DispatchException;
@@ -14,7 +14,7 @@ public class BDI332test {
// test bdi transaction
DataPacket result = null;
try {
result = BDI332.transfer(0x0C00);
result = MC68332.transfer(0x0C00);
} catch (USBException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -32,7 +32,7 @@ public class BDI332test {
private static void reset_target() {
try {
BDI332.reset_target();
MC68332.reset_target();
} catch (USBException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -48,7 +48,7 @@ public class BDI332test {
private static void freeze() {
try {
System.out
.println("isFreezeAsserted: " + BDI332.isFreezeAsserted());
.println("isFreezeAsserted: " + MC68332.isFreezeAsserted());
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -64,7 +64,7 @@ public class BDI332test {
private static void break_() {
try {
BDI332.break_();
MC68332.break_();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -79,7 +79,7 @@ public class BDI332test {
private static void go() {
try {
BDI332.go();
MC68332.go();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -95,9 +95,9 @@ public class BDI332test {
private static void writeMem() {
final int BASE_ADDR = 0x105624;
try {
BDI332.writeMem(BASE_ADDR, 0x123456, 4);
BDI332.writeMem(BASE_ADDR + 4, 0x123457, 4);
BDI332.writeMem(BASE_ADDR + 8, 0x123458, 4);
MC68332.writeMem(BASE_ADDR, 0x123456, 4);
MC68332.writeMem(BASE_ADDR + 4, 0x123457, 4);
MC68332.writeMem(BASE_ADDR + 8, 0x123458, 4);
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -114,12 +114,12 @@ public class BDI332test {
final int BASE_ADDR = 0x105624;
try {
StringBuffer sb = new StringBuffer("0x"
+ Integer.toHexString(BDI332.readMem(BASE_ADDR, 4)) + "\n");
+ Integer.toHexString(MC68332.readMem(BASE_ADDR, 4)) + "\n");
sb.append("0x"
+ Integer.toHexString(BDI332.readMem(BASE_ADDR + 4, 4))
+ Integer.toHexString(MC68332.readMem(BASE_ADDR + 4, 4))
+ "\n");
sb.append("0x"
+ Integer.toHexString(BDI332.readMem(BASE_ADDR + 8, 4))
+ Integer.toHexString(MC68332.readMem(BASE_ADDR + 8, 4))
+ "\n");
System.out.println(sb.toString());
} catch (USBException e) {
@@ -220,8 +220,8 @@ public class BDI332test {
System.out.println("dump()");
try {
System.out.println("Data: 0x"
+ Integer.toHexString(BDI332.readMem(BASE_ADDR, 4)) + " ");
result = BDI332.dumpMem(BDI332.MAX_NOF_LONGS_FILL);
+ Integer.toHexString(MC68332.readMem(BASE_ADDR, 4)) + " ");
result = MC68332.dumpMem(MC68332.MAX_NOF_LONGS_FILL);
for (int i = 0; i < result.length; i++) {
System.out.print("0x" + Integer.toHexString(result[i]) + " ");
}
@@ -241,7 +241,7 @@ public class BDI332test {
public static void button9() {
try {
BDI332.nop();
MC68332.nop();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -260,12 +260,12 @@ public class BDI332test {
System.out.println("fill");
try {
BDI332.writeMem(BASE_ADDR, 0, 4);
int[] data = new int[BDI332.MAX_NOF_LONGS_FILL];
MC68332.writeMem(BASE_ADDR, 0, 4);
int[] data = new int[MC68332.MAX_NOF_LONGS_FILL];
for (int i = 0; i < data.length; i++) {
data[i] = i;
}
BDI332.fillMem(data, data.length);
MC68332.fillMem(data, data.length);
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -306,23 +306,23 @@ public class BDI332test {
try {
System.out.println("initialize data");
BDI332.writeMem(BASE_ADDR, FIRST_VAL, 4);
int[] data = new int[BDI332.MAX_NOF_LONGS_FILL];
MC68332.writeMem(BASE_ADDR, FIRST_VAL, 4);
int[] data = new int[MC68332.MAX_NOF_LONGS_FILL];
for (int i = 0; i < data.length; i++) {
data[i] = 5;
}
BDI332.fillMem(data, data.length);
MC68332.fillMem(data, data.length);
System.out.println("write data");
BDI332.writeMem(BASE_ADDR, FIRST_VAL, 4);
MC68332.writeMem(BASE_ADDR, FIRST_VAL, 4);
data = new int[10];
for (int i = 0; i < data.length; i++) {
data[i] = i;
}
BDI332.fillMem(data, data.length);
MC68332.fillMem(data, data.length);
System.out.println("Fill done");
System.out.println("read back data");
int firstResult = BDI332.readMem(BASE_ADDR, 4);
int firstResult = MC68332.readMem(BASE_ADDR, 4);
if (firstResult != FIRST_VAL) {
System.out.println("Error at 0: 0x"
+ Integer.toHexString(firstResult) + " instead of 0x"
@@ -333,7 +333,7 @@ public class BDI332test {
+ Integer.toHexString(firstResult) + " == 0x"
+ Integer.toHexString(FIRST_VAL));
}
int[] result = BDI332.dumpMem(BDI332.MAX_NOF_LONGS_FILL);
int[] result = MC68332.dumpMem(MC68332.MAX_NOF_LONGS_FILL);
for (int i = 0; i < result.length; i++) {
if (DEBUG_ON) {
System.out.println("Compare " + i + ": 0x"
@@ -362,15 +362,15 @@ public class BDI332test {
System.out.println("write data");
try {
BDI332.writeMem(BASE_ADDR, FIRST_VAL, 4);
int[] data = new int[BDI332.MAX_NOF_LONGS_FILL];
MC68332.writeMem(BASE_ADDR, FIRST_VAL, 4);
int[] data = new int[MC68332.MAX_NOF_LONGS_FILL];
for (int i = 0; i < data.length; i++) {
data[i] = i;
}
BDI332.fillMem(data, data.length);
MC68332.fillMem(data, data.length);
System.out.println("Fill done");
System.out.println("read back data");
int firstResult = BDI332.readMem(BASE_ADDR, 4);
int firstResult = MC68332.readMem(BASE_ADDR, 4);
if (firstResult != FIRST_VAL) {
System.out.println("Error at 0: 0x"
+ Integer.toHexString(firstResult) + " instead of 0x"
@@ -381,7 +381,7 @@ public class BDI332test {
+ Integer.toHexString(firstResult) + " == 0x"
+ Integer.toHexString(FIRST_VAL));
}
int[] result = BDI332.dumpMem(BDI332.MAX_NOF_LONGS_FILL);
int[] result = MC68332.dumpMem(MC68332.MAX_NOF_LONGS_FILL);
for (int i = 0; i < result.length; i++) {
if (data[i] != result[i]) {
System.out.println("Error at " + i + ": 0x"

View File

@@ -1,8 +1,7 @@
package ch.ntb.mcdp.bdi.test;
import ch.ntb.mcdp.bdi.BDI555;
import ch.ntb.mcdp.bdi.BDIException;
import ch.ntb.mcdp.usb.DataPacket;
import ch.ntb.mcdp.bdi.MPC555;
import ch.ntb.mcdp.usb.DispatchException;
import ch.ntb.usb.USBException;
@@ -31,13 +30,13 @@ public class BDI555test {
private static void reset_target() {
try {
BDI555.reset_target();
MPC555.reset_target();
// assign pin to Freeze output
BDI555.writeMem(0x02FC000, 0x40000, 4);
MPC555.writeMem(0x02FC000, 0x40000, 4);
// enable bus monitor, disable watchdog timer
BDI555.writeMem(0x02FC004, 0x0FFFFFF83, 4);
MPC555.writeMem(0x02FC004, 0x0FFFFFF83, 4);
// SCCR, switch off EECLK for download
BDI555.writeMem(0x02FC280, 0x08121C100, 4);
MPC555.writeMem(0x02FC280, 0x08121C100, 4);
} catch (USBException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -53,7 +52,7 @@ public class BDI555test {
private static void freeze() {
try {
System.out
.println("isFreezeAsserted: " + BDI555.isFreezeAsserted());
.println("isFreezeAsserted: " + MPC555.isFreezeAsserted());
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -69,7 +68,7 @@ public class BDI555test {
private static void break_() {
try {
BDI555.break_();
MPC555.break_();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -84,7 +83,7 @@ public class BDI555test {
private static void go() {
try {
BDI555.go();
MPC555.go();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -100,7 +99,7 @@ public class BDI555test {
private static void writeMem() {
final int BASE_ADDR = 0x800000;
try {
BDI555.writeMem(BASE_ADDR, 0x123456, 4);
MPC555.writeMem(BASE_ADDR, 0x123456, 4);
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -119,7 +118,7 @@ public class BDI555test {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < 10; i++) {
sb.append("0x"
+ Integer.toHexString(BDI555.readMem(BASE_ADDR + i*4, 4))
+ Integer.toHexString(MPC555.readMem(BASE_ADDR + i*4, 4))
+ "\n");
}
System.out.println(sb.toString());
@@ -142,9 +141,9 @@ public class BDI555test {
testData[i] = i;
}
try {
BDI555.startFastDownload(BASE_ADDR);
BDI555.fastDownload(testData, BDI555.MAX_NOF_WORDS_FAST_DOWNLOAD);
BDI555.stopFastDownload();
MPC555.startFastDownload(BASE_ADDR);
MPC555.fastDownload(testData, MPC555.MAX_NOF_WORDS_FAST_DOWNLOAD);
MPC555.stopFastDownload();
} catch (USBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -161,10 +160,10 @@ public class BDI555test {
final int BASE_ADDR = 0x800000;
try {
StringBuffer sb = new StringBuffer(0 + "\tData: 0x"
+ Integer.toHexString(BDI555.readMem(BASE_ADDR, 4)) + "\n");
+ Integer.toHexString(MPC555.readMem(BASE_ADDR, 4)) + "\n");
for (int i = 1; i < 120; i++) {
sb.append(i + "\tData: 0x"
+ Integer.toHexString(BDI555.readMemSeq(4)) + "\n");
+ Integer.toHexString(MPC555.readMemSeq(4)) + "\n");
}
System.out.println(sb.toString());
} catch (USBException e) {

View File

@@ -1,7 +1,7 @@
package ch.ntb.mcdp.mc68332;
import ch.ntb.mcdp.bdi.BDI332;
import ch.ntb.mcdp.bdi.BDIException;
import ch.ntb.mcdp.bdi.MC68332;
import ch.ntb.mcdp.usb.DispatchException;
import ch.ntb.usb.USBException;
@@ -16,15 +16,15 @@ public class IMCBTargetBoard {
switch (r.type) {
case Register.CtrReg:
System.out.println("writeMem");
BDI332.writeMem(r.addr, value, r.size);
MC68332.writeMem(r.addr, value, r.size);
break;
case Register.SysReg:
System.out.println("writeSysReg");
BDI332.writeSysReg(r.addr, value);
MC68332.writeSysReg(r.addr, value);
break;
case Register.UserReg:
System.out.println("writeUserReg");
BDI332.writeUserReg(r.addr, value);
MC68332.writeUserReg(r.addr, value);
break;
}
System.out.println("0x" + Integer.toHexString(readRegister(name)));
@@ -37,13 +37,13 @@ public class IMCBTargetBoard {
switch (r.type) {
case Register.CtrReg:
System.out.println("\treadMem");
return BDI332.readMem(r.addr, r.size);
return MC68332.readMem(r.addr, r.size);
case Register.SysReg:
System.out.println("\treadSysReg");
return BDI332.readSysReg(r.addr);
return MC68332.readSysReg(r.addr);
case Register.UserReg:
System.out.println("\treadUserReg");
return BDI332.readUserReg(r.addr);
return MC68332.readUserReg(r.addr);
}
return -1;
}
@@ -51,7 +51,7 @@ public class IMCBTargetBoard {
public static void init() throws USBException, DispatchException,
BDIException {
BDI332.reset_target();
MC68332.reset_target();
// RegisterDict.printRegisters();