xref: /freebsd/share/man/man4/lm75.4 (revision cbb3ec25236ba72f91cbdf23f8b78b9d1af0cedf)
1.\"
2.\" Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24.\"
25.Dd December 26, 2017
26.Dt LM75 4
27.Os
28.Sh NAME
29.Nm lm75
30.Nd lm75 i2c digital temperature sensor driver
31.Sh SYNOPSIS
32.Cd "device iic"
33.Cd "device iicbus"
34.Cd "device lm75"
35.Sh DESCRIPTION
36The
37.Nm
38driver provides access to sensor data and configuration over the
39.Xr iicbus 4 .
40.Pp
41It provides an easy and simple way to check the functionality of an i2c bus
42as it provides read and write access to the
43.Nm
44configuration register.
45.Pp
46The access to
47.Nm
48data is made via the
49.Xr sysctl 8
50interface:
51.Bd -literal
52dev.lm75.0.%desc: LM75 temperature sensor
53dev.lm75.0.%driver: lm75
54dev.lm75.0.%location: addr=0x49
55dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75
56dev.lm75.0.%parent: iicbus3
57dev.lm75.0.temperature: 27.1C
58dev.lm75.0.thyst: 75.0C
59dev.lm75.0.tos: 80.0C
60dev.lm75.0.faults: 1
61dev.lm75.0.mode: comparator
62dev.lm75.0.polarity: active-low
63dev.lm75.0.shutdown: 0
64.Ed
65.Bl -tag -width ".Va dev.lm75.%d.temperature"
66.It Va dev.lm75.%d.temperature
67Is the read-only value of the current temperature read by the sensor.
68.It Va dev.lm75.%d.thyst
69Sets the hysteresis temperature.
70Once the temperature gets over the overtemperature shutdown value (tos)
71it needs to drop below the hysteresis temperature to disable the output
72(interrupt) pin again.
73.It Va dev.lm75.%d.tos
74Sets the overtemperature shutdown value.
75Once the temperature gets over this value the output pin will be enabled.
76The way the output (interrupt) pin works, depends on the mode configuration.
77.It Va dev.lm75.%d.faults
78Is the number of faults that must occur consecutively to activate the
79interrupt (output) pin.
80It can be set to 1, 2, 4, and 6.
81.It Va dev.lm75.%d.mode
82Sets the operation mode for the sensor interrupt pin.
83It can be set to 'comparator' (default) or 'interrupt'.
84.It Va dev.lm75.%d.polarity
85Sets the polarity of the sensor interrupt pin.
86It can be set to 'active-low' (default) or 'active-high'.
87Please note that the output pin is an open-drain output and it needs a
88proper pull-up resistor to work.
89.It Va dev.lm75.%d.shutdown
90When set to '1' it shuts down the sensor.
91The temperature conversion stops but the sensor remains with its i2c bus
92active, i.e., it can be woken up by setting this option to '0' again.
93.El
94.Pp
95Please check the
96.Nm
97datasheet for more details.
98.Pp
99When used together with
100.Xr snmp_lm75 3
101it allows the monitoring of
102.Nm
103temperature data over SNMP.
104.Pp
105The
106.Nm
107driver supports both the low and the high resolution models.
108.Pp
109The low resolution model (lm75) provides a 9 bit output with the LSB
110representing 0.5C.
111.Pp
112The high resolution model (lm75a) provides an 11 bit output with the LSB
113representing 0.125C.
114.Pp
115The driver tries to auto-detect the
116.Nm
117model, but the detection of some
118.Nm
119clones may not work reliably.
120.Pp
121On a
122.Xr device.hints 5
123based system, such as
124.Li MIPS ,
125these values are configurable for
126.Nm :
127.Bl -tag -width ".Va hint.lm75.%d.addr"
128.It Va hint.lm75.%d.at
129Is the
130.Xr iicbus 4
131you are attaching to.
132.It Va hint.lm75.%d.addr
133Is the
134.Nm
135i2c address on the
136.Xr iicbus 4 .
137.El
138.Pp
139On a
140.Xr FDT 4
141based system, such as
142.Li ARM ,
143the DTS part for a
144.Nm
145device usually looks like:
146.Bd -literal
147i2c {
148	/* Properties describing the controller appear here. */
149	...
150	lm750@49 {
151		compatible = "national,lm75";
152		reg = <0x49>;
153	};
154};
155.Ed
156.Pp
157Where:
158.Bl -tag -width ".Va compatible"
159.It Va compatible
160Should always be set to "national,lm75".
161.It Va reg
162Indicates which 7-bit i2c address the
163.Nm
164is wired at.
165.Nm
166temperature sensors can be wired to 8 different addresses, allowing up to 8
167sensors on the same
168.Xr iicbus 4 .
169.El
170.Sh SEE ALSO
171.Xr snmp_lm75 3 ,
172.Xr fdt 4 ,
173.Xr iic 4 ,
174.Xr iicbus 4 ,
175.Xr sysctl 8
176.Sh HISTORY
177The
178.Nm
179driver first appeared in
180.Fx 11.0 .
181.Sh AUTHORS
182.An -nosplit
183The
184.Nm
185driver and this manual page were written by
186.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org .
187