Manual

Neuron C Reference Guide 89
io_change_init( ) Built-in Function
The io_change_init( ) built-in function initializes the I/O object for the io_changes
event. If this function is not used, the I/O object’s initial reference value defaults
to 0.
Syntax
void io_change_init (
input-io-object-name
[,
init-value
]);
input-io-object-name
Specifies the I/O object name, which corresponds to
io-object-name
in the I/O declaration.
init-value
Sets the initial reference value used by the io_changes
event. If this parameter is omitted, the object’s current
value is used as the initial reference value. This
parameter can be short or long as needed.
Example
IO_4 input ontime signal;
when (reset)
{
// Set comparison value for 'signal'
// to its current value
io_change_init(signal);
}
...
when (io_changes(signal) by 10)
{
...
}
io_edgelog_preload( ) Built-in Function
The io_edgelog_preload( ) built-in function is optionally used with the edgelog I/O
model. The
value
parameter defines the maximum value, in units of the clock
period, for each period measurement, and can be any value from 1 to 65535. If
the period exceeds the maximum value, the io_in( ) call is terminated.
The default maximum value is 65535, which provides the maximum timeout
condition. By setting a smaller maximum value with this function, a Neuron C
program can
shorten
the length of the timeout condition. This function need only
be called once, but can be called multiple times to change the maximum value.
The function can be called from a when(reset) task to automatically reduce the
maximum count after every start-up.
If a preload value is specified, it must be added to the value returned by io_in( ).
The resulting addition could cause an overflow, but this is normal.
Syntax
void io_edgelog_preload (unsigned long
value
);