Declaring i/o objects in neuron c – Echelon Neuron C User Manual

Page 41

Advertising
background image

Neuron C Programmer’s Guide

29

magtrack1

serial
wiegand

Serial Input/Output Model Types

i2c

neurowire
sci

spi

Parallel I/O Models

are used for high-speed bidirectional I/O. I/O models

within this group use all of the Neuron Chip or Smart Transceiver I/O

pins. The parallel I/O models include the following types:

Parallel Input/Output Model Types

muxbus
parallel

Declaring I/O Objects in Neuron C

Declaring an I/O object in a Neuron C application performs both of the following

tasks:

• Informs the compiler what type of I/O operation is performed, and on

which pin or pins. The compiler creates instructions that configure the

hardware within the Neuron core as a result of this declaration. The
firmware configures the hardware whenever the device or application is

reset.

• Associates the name of the I/O object with the hardware.

The general syntax for declaring an I/O objects in the Neuron C language is

shown below.

pin direction type [options] io-object-name;

pin

One of the Neuron C keywords that name one of the twelve I/O pins, IO_0

through IO_11 (pin IO_11 is available only on Series 3100 Power Line devices

and Series 5000 devices). The named pin defines the first pin for multi-pin
I/O objects. In general, pins can appear in a single object declaration only.

However, a pin can appear in multiple declarations of the bit, nibble, and

byte I/O object types. Also, IO_8 can appear in multiple declarations of
neurowire master specifying different select pins. In this case, it is not

required that all declarations have the same sense, that is, input or output;

see the

I/O Model Reference

.

direction

Specifies whether the pin is an input or an output. Some I/O objects are

bidirectional, and do not require the specification of direction.

type

Specifies the I/O object type.

Advertising