xref: /netbsd-src/share/man/man4/bmx280thp.4 (revision 50bb9ed19fb685948d30ad3c7186b250d750fe26)
1.\" $NetBSD: bmx280thp.4,v 1.5 2022/12/03 01:04:42 brad Exp $
2.\"
3.\" Copyright (c) 2022 Brad Spencer <brad@anduin.eldar.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd November 19, 2022
18.Dt BMX280THP 4
19.Os
20.Sh NAME
21.Nm bmx280thp
22.Nd Driver for Bosch BMP280/BME280 sensor chip via I2C bus
23.Sh SYNOPSIS
24.Cd "bmx280thp* at iic? addr 0x76"
25.Cd "bmx280thp* at iic? addr 0x77"
26
27.Cd "bmx280thp* at spi? slave 0"
28.Cd "bmx280thp* at spi? slave 1"
29.Sh DESCRIPTION
30The
31.Nm
32driver provides measurements from the BMP280 and BME280 temperature,
33humidity and barometric pressure sensors via the
34.Xr envsys 4
35framework.
36The
37.Nm
38.Ar addr
39argument selects the address at the
40.Xr iic 4
41bus and the
42.Nm
43.Ar slave
44argument selects which chip select will be used on the
45.Xr spi 4
46bus.
47The precision of the measurement which is related to the over
48sampling performed on the measurement can be changed through
49.Xr sysctl 8
50nodes.
51.Sh SYSCTL VARIABLES
52The following
53.Xr sysctl 3
54variables are provided:
55.Bl -tag -width indent
56.It Li hw.bmx280thp0.osrs_t
57.It Li hw.bmx280thp0.osrs_p
58.It Li hw.bmx280thp0.osrs_h
59These control oversampling of temperature, pressure and humidity.
60The valid values are 1, 2, 4, 8, and 16 times oversample.
61Humidity is only available if the chip is a BME280.
62.It Li hw.bmx280thp0.irr_samples
63IRR is a filter that can be used to reduce the noise in the
64measurement.
65The value values are 1 (or off), 2, 5, 11 and 22 samples
66to reach >= 75% of the step response.
67.It Li hw.bmx280thp0.waitfactor.t
68.It Li hw.bmx280thp0.waitfactor.p
69.It Li hw.bmx280thp0.waitfactor.h
70These control the wait multiplication factor for a measurement cycle.
71This factor is different for temperature, pressure and humidity and
72is based upon the values of osrs_t, osrs_p and osrs_h.
73If the chip does not return the correct measurements for a given
74over sampling then the wait factors can be adjusted to allow more
75time for the measurement to complete successfully.
76.It Li hw.bmx280thp0.debug
77.It Li hw.bmx280thp0.dump_calibration
78If the driver is compiled with
79.Dv BMX280_DEBUG ,
80these nodes will appear and can be used to set the debugging level and
81provide the calibration constants, upon refresh, that are stored in the
82chip.
83Since the constants are fixed, this is a boolean node and will
84reset back to false once one dump has been performed.
85.It Li hw.bmx280thp0.readattempts
86A status register tells the driver if the chip is busy with a measurement.
87This status register must be polled and readattempts is the number of times
88that this poll will be performed.
89The default is 25 which should be more than enough for most purposes.
90.El
91.Sh SEE ALSO
92.Xr envsys 4 ,
93.Xr iic 4 ,
94.Xr spi 4 ,
95.Xr envstat 8 ,
96.Xr sysctl 8
97.Sh HISTORY
98The
99.Nm
100driver first appeared in
101.Nx 10.0 .
102.Sh AUTHORS
103.An -nosplit
104The
105.Nm
106driver was written by
107.An Brad Spencer Aq Mt brad@anduin.eldar.org .
108.Sh BUGS
109The driver does not support the continuous read mode that the BMP280
110and BME280 has.
111