use of net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory in project usbdm-eclipse-plugins by podonoghue.
the class DeviceInfo method getDevicePeripherals.
/**
* Get peripheral information from SVD file<br>
* This is a time consuming operation.
*
* @return Peripheral information
*
* @throws UsbdmException
*/
public DevicePeripherals getDevicePeripherals() throws UsbdmException {
DevicePeripheralsFactory factory = new DevicePeripheralsFactory();
DevicePeripherals devicePeripherals = factory.getDevicePeripherals(fDeviceSubFamily);
if (devicePeripherals == null) {
throw new UsbdmException("Failed to create devicePeripherals from SVD for \'" + fDeviceSubFamily + "\'");
}
return devicePeripherals;
}
use of net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory in project usbdm-eclipse-plugins by podonoghue.
the class UsbdmDeviceSelectionPage_2 method getDevicePeripherals.
DevicePeripherals getDevicePeripherals(final Device device) {
DevicePeripheralsFactory factory = new DevicePeripheralsFactory();
DevicePeripherals devicePeripherals = factory.getDevicePeripherals(device.getName());
if (devicePeripherals == null) {
devicePeripherals = factory.getDevicePeripherals(device.getSubFamily());
}
return devicePeripherals;
}
use of net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory in project usbdm-eclipse-plugins by podonoghue.
the class TestVectorTable method testVectorTable.
static void testVectorTable(String device) throws Exception {
// Get description of all peripherals for device
DevicePeripheralsFactory factory = new DevicePeripheralsFactory();
DevicePeripherals devicePeripherals = factory.getDevicePeripherals(device);
if (devicePeripherals == null) {
// Return empty model
System.err.println("Failed");
return;
}
VectorTable vt = devicePeripherals.getVectorTable();
String cVectorTable = vt.getCVectorTableEntries();
System.err.print(cVectorTable);
}
use of net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory in project usbdm-eclipse-plugins by podonoghue.
the class TestVectorTable method testHeaderFile.
static void testHeaderFile(String device) {
DevicePeripheralsFactory factory = new DevicePeripheralsFactory();
DevicePeripherals devicePeripherals = factory.getDevicePeripherals(device);
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = null;
try {
printWriter = new PrintWriter(stringWriter);
devicePeripherals.writeHeaderFile(printWriter);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (printWriter != null) {
printWriter.close();
}
}
System.err.print(stringWriter.toString());
}
Aggregations