Neuron c variables, Neuron c variable types, Neuron c storage classes – Echelon Mini EVK User Manual
Page 43

Neuron C provides many built-in I/O objects. These I/O objects are
standardized I/O device drivers for the Neuron Chip or Smart Transceiver I/O
hardware. Each I/O object fits into the event-driven programming model. A
function-call interface is provided to interact with each I/O object. I/O models
may be used with the Neuron Chip or Smart Transceiver’s IOn pins, and
include simple models such as bit I/O and complex timer/counter models,
models for serial I/O, and many other models for commonly used I/O tasks.
Neuron C Variables
The following sections briefly discuss various aspects of Neuron C-specific
variable declarations. Data types affect what sort of data a variable
represents. Storage classes affect where the variable is stored, whether it can
be modified (and if so, how often), and whether there are any device interface
aspects to modifying the data.
Neuron C Variable Types
Neuron C supports the following C variable types. The keywords shown in
square brackets below are optional. If omitted, they will be assumed by the
Neuron C language, per the rules of the ANSI C standard:
• [signed] long [int] 16-bit quantity
• unsigned long [int] 16-bit quantity
• signed char
8-bit quantity
• [unsigned] char
8-bit quantity
• [signed] [short][int] 8-bit quantity
• unsigned [short][int] 8-bit quantity
• enum
8-bit quantity (int type)
Neuron C provides some predefined enum types. One example is shown
below:
typedef enum {FALSE, TRUE} boolean;
Neuron C also provides predefined objects that, in many ways, provide the
look and feel of an ANSI C language variable. These objects include Neuron
C timer and I/O objects. See Chapter 2 of the Neuron C Programmer’s Guide for
more details on I/O objects, and see the Timers chapter in the Neuron C
Reference Guide for more details on timer objects.
The extended arithmetic library also defines float_type and s32_type for IEEE
754 and signed 32-bit integer data respectively. These types are discussed in
great detail in the Functions chapter of the Neuron C Reference Guide.
Neuron C Storage Classes
If no class is specified for a declaration at file scope, the data or function is
global. File scope is that part of a Neuron C program that is not contained
within a function or a when task. Global data (including all data declared
with the static keyword) is present throughout the entire execution of the
program, starting from the point where the symbol was declared.
Mini EVK User’s Guide
37