beautypg.com

Touch input/output, Usage, Nibble input example – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual

Page 53: Nibble output example

background image

I/O Model Reference

43

through IO_4. The lowest numbered I/O pin is defined as the least

significant bit of the nibble data.

io-object-name

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

identifiers.

initial-output-level

A constant expression, in ANSI C format for initializers, used to set the state
of the output pin of the I/O object at initialization. The initial state can be

from 0 to 15. The default is 0.

Usage

unsigned int

input-value

;

unsigned int

output-value

;

input-value

= io_in(

io-object-name

);

io_out(

io-object-name

,

output-value

);

Nibble Input Example

IO_0 input nibble ioColumnRead;
unsigned column;

when (reset) {
io_change_init(ioColumnRead);
}

when (io_changes(ioColumnRead)) {
column = input_value;
}

Nibble Output Example

IO_4 output nibble ioRowWrite;

when (...) {
io_out(ioRowWrite, 0b1000U);
}

Touch Input/Output

The touch I/O model is used to interface to any peripheral device that implements

the 1-Wire

®

protocol developed by Dallas Semiconductor Corporation (now Maxim

Integrated Products). This protocol provides communications with Touch
Memory devices, iButton™ devices, and other similar devices. This protocol uses

a one-wire, open-drain, bidirectional connection.
The touch I/O model operates only within the timing specifications set forth by
Dallas Semiconductor Corporation for the 1-Wire protocol. This interface

supports bi-directional data transfers across a signal and ground wire pair. An

external pull-up is required, and the interface is connected directly to the