Search in sources :

Example 1 with IrqVariable

use of net.sourceforge.usbdm.deviceEditor.information.IrqVariable in project usbdm-eclipse-plugins by podonoghue.

the class UartValidate method validate.

/**
 * Class to validate UART settings
 * @throws Exception
 */
@Override
public void validate(Variable variable) throws Exception {
    super.validate(variable);
    // Variables
    // =================================
    BooleanVariable uartClassVar = getBooleanVariable("uartClass");
    LongVariable receiveBufferSizeVar = getLongVariable("receiveBufferSize");
    LongVariable transmitBufferSizeVar = getLongVariable("transmitBufferSize");
    IrqVariable txrxHandlerVar = getIrqVariable("irqHandlers");
    // Enable/disable parameters that depend on mode
    boolean uartClass = uartClassVar.getValueAsBoolean();
    if (variable == uartClassVar) {
        // System.err.println("uartClassVar = "+uartClassVar.getValueAsBoolean());
        // Changed buffering
        receiveBufferSizeVar.enable(uartClass);
        transmitBufferSizeVar.enable(uartClass);
        txrxHandlerVar.setLocked(uartClass);
        if (uartClass) {
            txrxHandlerVar.setValue(IrqVariable.CLASS_VALUE);
        }
    }
    // Warn if Rx and Tx signals not mapped
    validateMappedPins(new int[] { 0, 1 }, getPeripheral().getSignalTables().get(0).table);
}
Also used : LongVariable(net.sourceforge.usbdm.deviceEditor.information.LongVariable) BooleanVariable(net.sourceforge.usbdm.deviceEditor.information.BooleanVariable) IrqVariable(net.sourceforge.usbdm.deviceEditor.information.IrqVariable)

Example 2 with IrqVariable

use of net.sourceforge.usbdm.deviceEditor.information.IrqVariable in project usbdm-eclipse-plugins by podonoghue.

the class ParseMenuXML method parseIrqOption.

/**
 * Parse &lt;irqOption&gt; element<br>
 * Expects:
 * <ul>
 * <li> name         Name of option
 * <li> description  Description of option
 * <li> tooltip      Tooltip to display
 * <li> pattern      Pattern to match against vector table entry. <br>
 * This is a regex.  In addition the following substitutions are done before matching:
 *    <ul>
 *    <li> %i replaced with peripheral instance e.g. FTM1 => 1, PTA => A
 *    <li> %b replaced with peripheral base name e.g. FTM1 => = FTM
 *    <li> %c replaced with peripheral C++ base class name e.g. FTM1 => = Ftm
 *    <li> _IRQHandler is appended
 *    </ul>
 * <li> classHandler Name of class method to handle interrupt <br>
 * This is a regex substitution pattern.  In addition the following substitutions are done before matching:
 *    <ul>
 *    <li> %i replaced with peripheral instance e.g. FTM1 => 1, PTA => A
 *    <li> %b replaced with peripheral base name e.g. FTM1 => = FTM
 *    <li> %c replaced with peripheral C++ base class name e.g. FTM1 => = Ftm
 *    </ul>
 * Regex substitution patterns may also be used.
 *    <ul>
 *    <li> $n reference to regex group in pattern
 *    </ul>
 * </ul>
 *
 * @param  irqElement
 *
 * @throws Exception
 */
private void parseIrqOption(BaseModel parent, Element irqElement) throws Exception {
    IrqVariable variable = (IrqVariable) parseCommonAttributes(parent, irqElement, IrqVariable.class).getVariable();
    variable.setPattern(irqElement.getAttribute("pattern"));
    variable.setClassHandler(irqElement.getAttribute("classHandler"));
    fPeripheral.addIrqVariable(variable);
}
Also used : IrqVariable(net.sourceforge.usbdm.deviceEditor.information.IrqVariable)

Example 3 with IrqVariable

use of net.sourceforge.usbdm.deviceEditor.information.IrqVariable in project usbdm-eclipse-plugins by podonoghue.

the class LpuartValidate method validate.

/**
 * Class to validate LPUART settings
 * @throws Exception
 */
@Override
public void validate(Variable variable) throws Exception {
    super.validate(variable);
    // Variables
    // =================================
    BooleanVariable uartClassVar = getBooleanVariable("lpuartClass");
    LongVariable receiveBufferSizeVar = getLongVariable("receiveBufferSize");
    LongVariable transmitBufferSizeVar = getLongVariable("transmitBufferSize");
    IrqVariable txrxHandlerVar = getIrqVariable("irqHandlers");
    // Enable/disable parameters that depend on mode
    boolean uartClass = uartClassVar.getValueAsBoolean();
    if (variable == uartClassVar) {
        // System.err.println("uartClassVar = "+uartClassVar.getValueAsBoolean());
        // Changed buffering
        receiveBufferSizeVar.enable(uartClass);
        transmitBufferSizeVar.enable(uartClass);
        txrxHandlerVar.setLocked(uartClass);
        if (uartClass) {
            txrxHandlerVar.setValue(IrqVariable.CLASS_VALUE);
        }
    }
    validateMappedPins(new int[] { 0, 1 }, getPeripheral().getSignalTables().get(0).table);
}
Also used : LongVariable(net.sourceforge.usbdm.deviceEditor.information.LongVariable) BooleanVariable(net.sourceforge.usbdm.deviceEditor.information.BooleanVariable) IrqVariable(net.sourceforge.usbdm.deviceEditor.information.IrqVariable)

Aggregations

IrqVariable (net.sourceforge.usbdm.deviceEditor.information.IrqVariable)3 BooleanVariable (net.sourceforge.usbdm.deviceEditor.information.BooleanVariable)2 LongVariable (net.sourceforge.usbdm.deviceEditor.information.LongVariable)2