Skip to content
Snippets Groups Projects
Commit 51ed8e0e authored by Johannes Eder's avatar Johannes Eder
Browse files

GPIO PIN annotation

parent 6c084a96
No related branches found
No related tags found
No related merge requests found
......@@ -376,6 +376,21 @@
</target>
</transformationProvider>
</extension>
<extension
point="org.fortiss.tooling.base.annotation">
<annotation
binding="org.fortiss.af3.platform.annotation.valueprovider.GPIOPinNumberValueProvider">
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.GPI">
</modelElementClass>
</annotation>
<annotation
binding="org.fortiss.af3.platform.annotation.valueprovider.GPIOPinNumberValueProvider">
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.GPO">
</modelElementClass>
</annotation>
</extension>
......
......@@ -20,8 +20,10 @@ package org.fortiss.af3.platform.raspberry.generator.executable;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.platform.generic.generator.executable.GenericReceiverExecutable;
import org.fortiss.af3.platform.model.annotation.GPIOPin;
import org.fortiss.af3.platform.model.generic.GenericReceiver;
import org.fortiss.af3.platform.raspberry.model.GPI;
import org.fortiss.tooling.base.utils.AnnotationUtils;
/**
* Executable for {@link GPI}.
......@@ -41,6 +43,13 @@ public class GPIExecutable extends GenericReceiverExecutable {
/** {@inheritDoc} */
@Override
public IExpressionTerm getInitialization() {
// ---------------------------------------
// Example: How to extract PIN information
GPIOPin annotation = AnnotationUtils.getAnnotation(modelElement, GPIOPin.class);
int pinNumber = annotation.getPinNumber();
// ---------------------------------------
return super.getInitialization();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment