Using GPIO as an example I would like to be notified then an input pin change. To do this in C I use an interrupt function so I need a similar event reception in PScript. The most logical is that the framework check for events in between statements, and if one found execute an event function.
event <event-name>
… end |
Example 1:
event GPIOA[1].PIN_CHANGE
…. end |
This should be called if GPIOA, pin 1 change.
Example 2:
event ADC1[4].Threshold_High(1014)
… end |
This should be called if In4 of ADC1 goes higher than value 1014.
The second feature here is that I would like a capability simulate events from SW as well.
raise GPIOA[1].PIN_CHANGE |
I need to return with a list of supported events. We can debate wherever to use On, On Event or Event, but I think “Event” will do just fine. But, the syntax and details here will be subject for changes.