use of net.sourceforge.usbdm.deviceEditor.information.Pin in project usbdm-eclipse-plugins by podonoghue.
the class ModelFactory method report.
void report() {
for (String key : fDeviceInfo.getPins().keySet()) {
Pin pin = fDeviceInfo.getPins().get(key);
System.err.println(String.format("Pin:%-15s => %-15s %s", pin.getName(), pin.getMuxValue() + ",", pin.getMappableSignals().get(pin.getMuxValue())));
}
for (String key : fDeviceInfo.getSignals().keySet()) {
Signal signal = fDeviceInfo.getSignals().get(key);
System.err.println(String.format("Signal: %-15s => %-15s", signal.getName(), signal.getMappedPin()));
}
}
use of net.sourceforge.usbdm.deviceEditor.information.Pin in project usbdm-eclipse-plugins by podonoghue.
the class TestParseXML method report.
static void report(DeviceInfo deviceInfo) {
for (String key : deviceInfo.getDeviceVariants().keySet()) {
DeviceVariantInformation deviceInformation = deviceInfo.findVariant(key);
System.err.println("deviceInformation = " + deviceInformation);
}
for (String packageName : deviceInfo.getDevicePackages().keySet()) {
DevicePackage devicePackage = deviceInfo.findDevicePackage(packageName);
System.err.println("Package = " + devicePackage);
for (String pinName : devicePackage.getPins().keySet()) {
String location = devicePackage.getLocation(pinName);
System.err.print(pinName + " => " + location + ", ");
}
System.err.println();
}
for (String pinName : deviceInfo.getPins().keySet()) {
Pin pin = deviceInfo.findPin(pinName);
System.err.print("Pin = " + pin.getName() + ", ");
}
;
System.err.println();
for (String peripheralName : deviceInfo.getPeripheralNames()) {
System.err.print("Peripheral = " + peripheralName + ", ");
}
;
System.err.println();
for (String signals : deviceInfo.getSignals().keySet()) {
System.err.print("Signal = " + signals + ", ");
}
;
System.err.println();
}
use of net.sourceforge.usbdm.deviceEditor.information.Pin in project usbdm-eclipse-plugins by podonoghue.
the class WriteFamilyCpp method writePinMappingFunction.
private void writePinMappingFunction(DocumentUtilities writer) throws Exception {
PcrInitialiser pcrInitialiser = new PcrInitialiser();
for (String pinName : fDeviceInfo.getPins().keySet()) {
Pin pin = fDeviceInfo.getPins().get(pinName);
pcrInitialiser.addPin(pin);
}
writer.write("/**\n" + " * Used to configure pin-mapping before 1st use of peripherals\n" + " */\n" + "void " + DO_PIN_MAPPING_FUNCTION + "() {\n");
writer.write(pcrInitialiser.getInitPortClocksStatement(""));
writer.write(pcrInitialiser.getPcrInitStatements(""));
writer.write("}\n");
}
use of net.sourceforge.usbdm.deviceEditor.information.Pin in project usbdm-eclipse-plugins by podonoghue.
the class ParseFamilyXML method parsePin.
/**
* Parse <pin>
*
* @param pinElement
* @throws Exception
*/
private void parsePin(Element pinElement) throws Exception {
Pin pin = fDeviceInfo.createPin(pinElement.getAttribute("name"));
for (Node node = pinElement.getFirstChild(); node != null; node = node.getNextSibling()) {
if (node.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
Element element = (Element) node;
if (element.getTagName() == "mux") {
// factory.createMapping(factory.findSignal(element.getAttribute("signal")), pin, MuxSelection.valueOf(element.getAttribute("sel")));
Signal signal = fDeviceInfo.findOrCreateSignal(element.getAttribute("signal"));
MuxSelection muxSelection = MuxSelection.valueOf(element.getAttribute("sel"));
fDeviceInfo.createMapping(signal, pin, muxSelection);
if (signal.getName().startsWith("GPIO")) {
pin.setPort(signal);
}
} else if (element.getTagName() == "reset") {
MuxSelection muxSelection = MuxSelection.valueOf(element.getAttribute("sel"));
pin.setResetValue(muxSelection);
} else {
throw new Exception("Unexpected field in PIN, value = \'" + element.getTagName() + "\'");
}
}
}
use of net.sourceforge.usbdm.deviceEditor.information.Pin in project usbdm-eclipse-plugins by podonoghue.
the class ParseFamilyXML method parsePackage.
/**
* Parse <package>
*
* @param packageElement
* @throws Exception
*/
private void parsePackage(Element packageElement) throws Exception {
String packageName = packageElement.getAttribute("name");
for (Node node = packageElement.getFirstChild(); node != null; node = node.getNextSibling()) {
if (node.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
Element element = (Element) node;
if (element.getTagName() == "placement") {
Pin pin = fDeviceInfo.findPin(element.getAttribute("pin"));
String location = element.getAttribute("location");
DevicePackage devicePackage = fDeviceInfo.findDevicePackage(packageName);
devicePackage.addPin(pin, location);
} else {
throw new Exception("Unexpected field in PACKAGE, value = \'" + element.getTagName() + "\'");
}
}
}
Aggregations