Example, Timers_off( ) function, Syntax – Echelon Neuron C User Manual

Page 163: Touch_bit( ) built-in function

Advertising
background image

Neuron C Reference Guide

143

Example

long k;

void f(void)
{

k = 0x1234L;

k = swap_bytes(k);

// k now contains 0x3412L

}

timers_off( )

Function

The timers_off( ) function turns off all software timers. This function could be

called, for example, before an application goes offline.

Syntax

#include <control.h>
void timers_off (void);

Example

when (...)
{
timers_off();
go_offline();
}

touch_bit( )

Built-in Function

The touch_bit( ) function writes and reads a single bit of data on a 1-Wire

®

bus.

It can be used for either reading or writing. For reading, the

write-data

argument should be one (0x01), and the return value contains the bit as read

from the bus. For writing, the bit value in the

write-data

argument is placed on

the 1-Wire bus, and the return value normally contains that same bit value, and
can be ignored. This function provides access to the same internal function that

touch_byte( ) calls.

Syntax

unsigned touch_bit(

io-object-name

, unsigned

write-data

);

Example

void f(void)
{

unsigned dataIn, dataOut;

...

dataOut = 42;

dataIn = touch_bit(ioObj, dataOut);

}

Advertising