Syntax, Usage, Example – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual
Page 163
I/O Model Reference
153
Syntax
pin
[input] totalcount [mux | ded] [invert]
io-object-name
;
pin
An I/O pin. Totalcount input can specify pins IO_4 through IO_7.
mux | ded
Specifies whether the I/O object is assigned to the multiplexed or dedicated
timer/counter. This keyword is used only when pin IO_4 is used as the input
pin.
The mux keyword assigns the I/O object to the multiplexed timer/counter.
The ded keyword assigns the I/O object to the dedicated timer/counter. The
multiplexed timer/counter is always used for pins IO_5 through IO_7.
invert
Causes positive edges to be counted. By default, totalcount input counts the
number of negative input edges.
io-object-name
A user-specified name for the I/O object, in the ANSI C format for variable
identifiers.
Usage
unsigned long
input-value
;
input-value
= io_in(
io-object-name
);
Example
IO_4 input totalcount ded ioEventCount;
unsigned long events = 0;
mtimer repeating tick = 100;
when (timer_expires(tick)) {
events += io_in(ioEventCount);
// this sums up all events since initialization-time
}