The NetBSD Project

CVS log for src/sys/dev/i2c/sht3x.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / i2c

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Jan 23 19:14:46 2025 UTC (3 months ago) by brad
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +44 -23 lines


The SHT3x temperature and humidity sensor has a set of commands that
can do the measurement by using I2C clock stretching in single shot
mode.  Add a sysctl to allow the driver to use those commands.  This
is more efficient than doing the usual polling method of getting the
measurements back from the chip, but only works if the I2C master
supports clock stretching.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Jan 8 08:33:34 2025 UTC (3 months, 2 weeks ago) by andvar
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
s/peridoic/periodic/ in sysctl description and one more typo fix in comment.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu Nov 7 20:06:21 2024 UTC (5 months, 3 weeks ago) by brad
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +6 -2 lines


The SHT3X_READ_SERIAL_NUMBER command on the SHT3x sensors is
undocumented, but used in a lot of other drivers.  When I wrote the
driver it didn't seem like it needed any sort of delay, and that was
true if the I2C bus is short.  However, when the I2C bus is extended
out to a great length using active terminators, or some such, you
won't get any data back from the SHT3X_READ_SERIAL_NUMBER command as
you will try to read from the bus before the data is there.  The SHT3X
device works this way..  you can't start reading back data too soon
after issuing a command to the device.  So, add a delay like the other
commands.  The amount of delay was estimated based upon field
observation.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Apr 27 23:11:25 2022 UTC (3 years ago) by brad
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -466 lines


After testing with a couple of more samples of the SHT3x sensor chip
it was found that the datasheet does not appear to provide enough
information to make use of the alarm and interrupt function work.  So
actually remove the dead code that was an attempt at making that all
work.  Adjust the man page to mention that this.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Mar 31 19:30:16 2022 UTC (3 years, 1 month ago) by pgoyette
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +12 -10 lines
For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence.  This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

	devsw_attach()
	config_init_component() or config_cf*_attach()
	...
	config_fini_component() or config_cf*_detach()
	devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
	1. compile without build break
	2. no related test failures from atf
	3. modload/modunload work as well as
	   before.

No functional device testing done, since I don't have any
of these devices.  Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken;  see kern/56772.  This commit does not break
any additional modules (as far as I know).

Revision 1.5: download - view: text, markup, annotated - select for diffs
Wed Mar 30 00:06:50 2022 UTC (3 years, 1 month ago) by pgoyette
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
These modules need to depend on iic, not just on i2cexec.  (They will
still recursively get i2cexec since the iic depends on it.)

Partial fix for kern/56772

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Nov 14 18:36:13 2021 UTC (3 years, 5 months ago) by brad
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +18 -12 lines


Fix some regressions that were introduced.

One must make sure that you release the i2c bus if you acquire.

One must not try to release the i2c bus if you failed to acquire it.

One can't leave too early from the single-shot refresh without
checking the status register as there may have been a reset
and releasing the i2c bus.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Nov 13 13:36:42 2021 UTC (3 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +466 -3 lines
Brad wants the __did_not_work code back :-)

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Nov 12 22:16:27 2021 UTC (3 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +347 -782 lines
simplify the code and remove unused (it is in CVS anyway). Try to merge
duplicate code. Follow KNF. Brad, please test!

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Nov 6 13:34:40 2021 UTC (3 years, 5 months ago) by brad
Branches: MAIN


Driver for the Sensirion SHT30/SHT31/SHT35 temperature and humidity
sensor such as:

https://www.adafruit.com/product/2857

This is a higher priced sensor with a lot of features, including the
ability to do sub-second periodic updates.  The driver supports
everything about the sensor except for the alert pin.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>