beautypg.com

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

Page 95: Example

background image

I/O Model Reference

85

Programming Considerations

The data item unit is a single bit, and the

maxbits

and

count

values indicate the

number of bits that can be read, or have been read, respectively. In case of a

timeout, the

count

will be less than

maxbits

.

Syntax

IO_8 [input] magcard_bitstream [timeout (

pin-nbr

)] [clockedge (+|-)]

[invert]

io-object-name

;


IO_8

Specifies pin IO_8. The magcard bitstream input requires both pins IO_8

and IO_9. Pin IO_8 is the negative-going clock, IO_9 is the serial data input.

timeout(

pin-nbr

)

Optionally specifies the timeout signal pin, in the range of IO_0 to IO_7. The

Neuron Chip or Smart Transceiver checks the logic level at this pin whenever
it is waiting for either rising or falling edges of the clock. If a high logic level

is sensed on the timeout pin, the transfer is terminated.

clockedge (+|-)

Specifies the polarity of the clock input signal. The default is clockedge (-).

invert

Specifies that the data input signal is inverted. The default is no inversion.

io-object-name

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

identifiers.

Usage

unsigned long

count

,

maxbits

;

unsigned short

input-buffer

[

buffer-size

];

count

= io_in(

io-object-name

,

input-buffer

,

maxbits

);

Example

IO_8 magcard_bitstream timeout(IO_7) ioMagcard;
const unsigned long maxbits = 64*8;
unsigned long count;
unsigned short input_buffer[64];

when (...) {
count = io_in(ioMagcard, input_buffer, maxbits);
}