beautypg.com

Syntax, Usage, Example – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual

Page 171

background image

I/O Model Reference

161

Syntax

pin

[output] frequency [invert] [clock (

const-expr

)]

io-object-name

[=

initial-

output-level

];

pin

Specifies either pin IO_0 (using the multiplexed timer/counter) or IO_1 (using
the dedicated timer/counter).

invert

This keyword inverts the output for an output value of 0. The default output
for 0 is low.

clock (

const-expr

)

Specifies a clock in the range 0 to 7, where 0 represents the fastest clock and

7 represents the slowest clock. The default value is clock 0.
You can change resolution for the timer base clock frequency by calling the
io_set_clock( ) function with a clock value in the range 0..7 (using one of the

TCCLK_* macros defined in ). This function overrides the

resolution value specified for clock() within the I/O object declaration.

For an application running on a Series 5000 device, you can specify an

increased resolution for the timer base clock frequency by calling the

io_set_clock() function with a clock value in the range 0..15 (using one of the
TCCLK_* macros defined in ). This function overrides the

resolution value specified for clock() within the I/O object declaration.
See Appendix A,

Timer/Counter Periods and Resolution

, on page 187, for a

description of the timer resolution and maximum range for each specification

of the clock() value or each value of the TCCLK_* macros. See the

Neuron C

Reference Guide

for information about the io_set_clock() function.

io-object-name

A user-specified name for the I/O object, in the ANSI C format for variable
identifiers.

initial-output-level

A constant expression, in ANSI C format for initializers, used to set the state
of the output pin of the I/O object at initialization. The initial state is limited

to 0 or 1. The default is 0.

Usage

unsigned long

output-value

;

io_out(

io-object-name

,

output-value

);

Example

IO_1 output frequency clock(3) ioAlarm;
...