Example, Io_in_request( ) built-in function, Syntax – Echelon Neuron C User Manual

Page 116: Example 1, Example 2

Advertising
background image

96

Functions

Example

IO_0 input bit d0;
boolean value;
...
void f(void)
{

value = io_in(d0);

}

io_in_request( )

Built-in Function

The io_in_request( ) built-in function is used with a dualslope I/O object to start

the dualslope A/D conversion process.

Syntax

void io_in_request (

input-io-object-name

,

control-value

);

input-io-object-name

Specifies the I/O object name, which corresponds to

io-object-name

in the I/O declaration. This built-in

function is used only for dualslope and sci I/O models.

control-value

An

unsigned long value used to control the length of the

first integration period. See the descriptions of the

dualslope and sci I/O objects in the

I/O Model Reference

for more information.

Example 1

IO_4 input dualslope ds;
stimer repeating t;

when (online)
{
t = 5;

// Do a conversion every 5 sec

}

when (timer_expires(t))
{
io_in_request(ds, 40000);
}

The io_in_request( ) is used with a sci I/O object to start the serial transfer.

Example 2

#pragma specify_io_clock "10 MHz"
IO_8 sci baud(SCI_2400) iosci;
unsigned short buf[20];

when (...)
{

io_in_request(iosci, buf, 20);

}

Advertising