beautypg.com

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

Page 101

background image

I/O Model Reference

91

io_in( ) function. The data is stored without the parity bit, and the data includes

the start and end sentinel characters. This buffer should be 78 bytes long.

For magtrack1 input, the io_in( ) function requires a pointer to a data buffer, into

which the series of 6-bit characters are stored. The io_in( ) function returns a

signed int that contains the actual number of bytes stored.

The parity of each character is checked. The LRC character, which appears just

after the end sentinel, is also checked. If either of these tests fail, if more than 79
characters are being clocked in, or if the process aborts due to an input pin event

(see below), the io_in( ) function returns the value (-1) as an error indication. The

LRC character is not stored.

The magtrack1 object optionally uses one of I/O pins IO_0 through IO_7 as a

timeout or abort pin. Use of this feature is suggested because the io_in( )

function updates the watchdog timer during clock wait states, and could result in
a lockup if the card were to stop moving in the middle of the transfer process. If

a high level is detected on the I/O timeout pin, the io_in( ) function aborts. This

input can be a one-shot timer counter output, an RC circuit, or a ~Data_valid
signal from the card reader.

Syntax

IO_8 [input] magtrack1 [timeout (

pin-nbr

)] [clockedge (+|-)]

[invert]

io-object-name

;


IO_8

Specifies pin IO_8. Magtrack1 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 int

count

;

unsigned int

input

-

buffer

[

buffer

-

size

];

count

= io_in(

io

-

object

-

name

,

input

-

buffer

);