Syntax, Example, Touch_reset_spu( ) built-in function – Echelon Neuron C User Manual
Page 168
148
Functions
The touch_reset( ) function does not return until the end of the presence pulse
has been detected.
Syntax
int touch_reset (
io-object-name
);
Example
void f(void)
{
touch_reset(ioObj);
}
touch_reset_spu( )
Built-in Function
This function applies to 1-Wire bus devices that require the bus to be actively
held high during certain device operations. These devices require more current
than a typical external pull-up resistor can provide for device operations. An
example of such a device is the Maxim Integrated Products DS18S20 High-
Precision 1-Wire Digital Thermometer. For other 1-Wire devices, use the
standard touch_reset( ) function.
The touch_reset_spu( ) function asserts the reset pulse and returns a one (1)
value if a presence pulse was detected, or a zero (0) if no presence pulse was
detected, or a minus-one (-1) value if the 1-Wire bus appears to be stuck low. The
operation of this function is controlled by several timing constants. The first is
the reset pulse period, which is 500 μs. Next, the Neuron Chip or Smart
Transceiver releases the 1-Wire bus and waits for the 1-Wire bus to return to the
high state. This period is limited to 275 μs, after which the touch_reset_spu( )
function returns a (-1) value with the assumption that the 1-Wire bus is stuck
low. There also is a minimum value for this period: for a Series 3100 device, it
must be >4.8 μs @10 MHz, or >9.6 μs @5 MHz; for a Series 5000 device, it must
be >0.3 μs @ 80 MHz, or >4.8 μs @5 MHz.
The touch_reset_spu( ) function does not return until the end of the presence
pulse has been detected. This function ensures that the bus is not in the actively
driven high state prior to asserting the reset pulse.
You can use this function to reset the state of the bus so that you can use the
standard touch_first( ) and touch_next( ) functions.
Syntax
extern int touch_reset_spu(unsigned
pinmask
);
pinmask
Specifies a single-bit representation for which I/O pins
IO0..IO7 to drive high when idle. Valid values are 0x01
(for IO0) to 0x08 (for IO7).
Example
#define 1WIREPIN 0x02;
void f(void)