Search in sources :

Example 1 with DevicePeripheralsFactory

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;
}
Also used : DevicePeripherals(net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals) UsbdmException(net.sourceforge.usbdm.jni.UsbdmException) DevicePeripheralsFactory(net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)

Example 2 with DevicePeripheralsFactory

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;
}
Also used : DevicePeripherals(net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals) DevicePeripheralsFactory(net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)

Example 3 with DevicePeripheralsFactory

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);
}
Also used : DevicePeripherals(net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals) VectorTable(net.sourceforge.usbdm.peripheralDatabase.VectorTable) DevicePeripheralsFactory(net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)

Example 4 with DevicePeripheralsFactory

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());
}
Also used : StringWriter(java.io.StringWriter) DevicePeripherals(net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals) DevicePeripheralsFactory(net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory) PrintWriter(java.io.PrintWriter)

Aggregations

DevicePeripherals (net.sourceforge.usbdm.peripheralDatabase.DevicePeripherals)4 DevicePeripheralsFactory (net.sourceforge.usbdm.peripheralDatabase.DevicePeripheralsFactory)4 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 UsbdmException (net.sourceforge.usbdm.jni.UsbdmException)1 VectorTable (net.sourceforge.usbdm.peripheralDatabase.VectorTable)1