<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HiPi::Device::OneWire</title></head>
<BODY TOPMARGIN=4 BGCOLOR=#FFFFFF TEXT=#000000 VLINK=#0000CC LINK=#0000CC ALINK=#0000CC>
<FONT FACE="Arial, Lucida, Helvetica" >
<TABLE WIDTH="100%" ALIGN=CENTER CELLPADDING=1 CELLSPACING=0>
<TR>
<TD WIDTH="100%" ALIGN=CENTER>
<A HREF="contents.htm"><img align=center src="home.png" BORDER=0 ALT="Contents"></A>
<A HREF="mod_device.htm"><img align=center src="up.png" BORDER=0 ALT="Up"></A>
<A HREF="mod_device_spi.htm"><img align=center src="back.png" BORDER=0 ALT="Previous"></A>
<A HREF="mod_device_serialport.htm"><img align=center src="forward.png" BORDER=0 ALT="Next"></A>
</TD>
</TR>
<TR>
<TD COLSPAN=2 HEIGHT=2 BGCOLOR="#C0C0C0">
</TD>
</TR>
</TABLE>
<H2>HiPi::Device::OneWire</H2><p>This module currently provides a front end to the w1 Kernel device driver. Currently only a simple read function is implemented. Enough to support reading the output of temperature devices.</p>
<p>See : <A HREF="topic_w1dev.htm">W1 Device Driver</A></p>
<p>The connected devices on your One Wire bus can be seen in the <A HREF="control_app_w1dev.htm">HiPi Control GUI</A> if you are using the kernel driver.</p>
<p>The following interface module uses HiPi::Device::OneWire as a backend and may contain code that helps with your own usage.</p>
<p><A HREF="mod_interface_ds18x20.htm">HiPi::Interface::DS18X20</A><br />
<h2>Class Methods</h2>
<h5>HiPi::Device::OneWire->load_modules( $forceunload );</h5>
<pre> Loads the kernel device driver modules for w1 support
wire
w1_gpio
w1_therm
When $forceunload is true, unloads the kernel modules
first if they are loaded (effectively forces a reload)
spidev is loaded with the current bufsiz
Of course, the user the script is running as must have
root permissions to load and unload kernel modules.</pre>
<h5>HiPi::Device::OneWire->unload_modules();</h5>
<pre> Unloads the kernel device driver modules for SPI
wire
w1_gpio
w1_therm
Of course, the user the script is running as must have
root permissions to load and unload kernel modules.</pre>
<h5>HiPi::Device::OneWire->list_slaves();</h5>
<pre> Returns an array of hash references providing details
of the connected 1 wire devices.
the four hash keys are
id e.g. 28-00000400bed1
family e.g. 28
name e.g. 18B20
description e.g. programmable resolution digital thermometer
my @devices = HiPi::Device::OneWire->list_slaves();
for my $w1 ( @devices ) {
for ( qw( id family name description ) ) {
print qq($_ = $w1->{$_}n);
}
}</pre>
<h5>HiPi::Device::OneWire->id_exists( $id );</h5>
<pre> Returns true or false according to whether the specified
$id is connected to the kernel device.</pre>
<h5>HiPi::Device::OneWire->read_data( $id );</h5>
<pre> Returns the content of the file
/sys/bus/w1/devices/$id/w1_slave
It is up to the caller to parse the content
</pre></FONT>
<br>
<p>
<br>
<hr>
<br>
<center>
<A HREF="contents.htm"><img align=center src="home.png" BORDER=0 ALT="Contents"></A>
<A HREF="mod_device.htm"><img align=center src="up.png" BORDER=0 ALT="Up"></A>
<A HREF="mod_device_spi.htm"><img align=center src="back.png" BORDER=0 ALT="Previous"></A>
<A HREF="mod_device_serialport.htm"><img align=center src="forward.png" BORDER=0 ALT="Next"></A>
</center>
<HR>
<br>
<center><FONT FACE="Arial, Lucida, Helvetica" size="2" color="#000080">HiPi Modules Copyright © 2013 Mark Dootson</font></center>
</BODY></HTML>