beautypg.com

Declaring i/o objects in neuron c – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual

Page 26

background image

16

Introduction

Driving a Seven Segment Display with the Neuron Chip

engineering

bulletin (part no. 005-0014-01)

Neuron Chip Quadrature Input Function Interface

engineering bulletin

(part no. 005-0003-01)

Parallel I/O Interface to the Neuron Chip

engineering bulletin (part no.

005-0021-01)

EIA-232C Serial Interfacing with the Neuron Chip

engineering bulletin

(part no. 005-0008-01)

Declaring I/O Objects in Neuron C

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

tasks:

• Informs the compiler what type of I/O operation will be 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 an I/O model.
• Associates the I/O object with one or more I/O pins, and defines

additional properties of the I/O object.

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

shown below.

pin direction model [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 (the IO11 pin 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 models. 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 direction, that is,

input or output; see

Overlaying I/O Objects

on page 17.

direction

Specifies whether the object is an input or an output. Some I/O models are

bidirectional, and do not require the specification of direction.

model

Specifies the I/O model for this I/O object.

options

Optional I/O parameters, dependent on the chosen

model

for the I/O object.

The description of each model includes the model’s available options. Except

where noted, these options can be listed in any order. All options have
default values that are used when you do not include the option in the object

declaration.