1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

40 Commits

Author SHA1 Message Date
Marian Buschsieweke
510c6fd84e
drivers/dht: fix compilation with LLVM 2023-07-18 12:24:08 +02:00
Hugues Larrive
a582da1f31 drivers/dht: busy wait reimplementation
- many backports from @maribu's IRQ based implementation (#18591)
- use of ztimer and errno.h
- separation of dht_read() steps into functions for better readability
- reintroduction of DHT11/DHT22 differentiation
- sensor presence checking in dht_init()
- default input mode changed to open drain
- AVR support without platform-specific handling by avoiding
  ztimer_spin() and using the overflow of an 8-bit variable as a
  pre-timeout to minimize time-consuming ztimer_now() calls
- add a new DHT11_2022 type for 0.01 °C resolution devices
- data caching removed
2023-06-20 12:07:48 +02:00
Marian Buschsieweke
16f859dafd
drivers/saul: use const qualifier for data to write
This makes life easier when calling e.g. `saul_reg_write()` with data
stored in flash.

As now the signatures for reading and writing differ (in that `const`
qualifier only), `saul_notsup()` is split into `saul_write_notsup()`
and `saul_read_notsup()`. However, one is implemented as a symbol alias
of the other, so that ROM consumption remains unchanged.
2022-05-23 08:35:27 +02:00
MrKevinWeiss
2dd5e76d29
drivers/dht: Update kconfig model 2022-03-04 14:15:36 +01:00
b4267fbd5e
drivers: make use of new driver_with_saul.mk where applicable 2022-01-06 12:07:07 +01:00
Wouter Symons
5055d0993e drivers/dht: correct interpreting raw values 2021-11-20 14:55:02 +01:00
Leandro Lanzieri
789a197cee
drivers/dht: add module to Kconfig 2020-12-02 10:13:10 +01:00
Benjamin Valentin
e2cf95b0a9 drivers/dht: convert to xtimer_msleep() 2020-11-05 11:32:41 +01:00
Bas Stottelaar
92b1dfc703 drivers/*: realign ENABLE_DEBUG 2020-10-23 01:26:09 +02:00
304bce3724
drivers: configure per driver dependency resolution 2020-07-20 14:32:16 +02:00
490126cfa0
drivers: move USEMODULE_INCLUDES in each driver directories 2020-07-15 20:36:27 +02:00
Marian Buschsieweke
8cbf636781
drivers/dht: Fixed magic numbers & missing doc
- Replaced magic number by preprocessor macros and documented them
- Added comment to explain why DHT21 is not part of the switch() expression
2019-07-29 10:39:50 +02:00
Marian Buschsieweke
579a67be03
drivers/dht: Move hold logic from SAUL to driver
The DHT11/DHT21/DHT22 cannot be sampled more than once a second. Previously,
a global cache was added to the SAUL adaption of the dht driver to answer with
stored values for one second after the last read. This however had two
disadvantages:

- The global cache was shared for all DHTXX devices connected. As a result
  incorrect values were delivered when reading out multiple sensors over SAUL
  with less than 1 second delay in between
- A user of the low level API will had to implement the same caching strategy,
  resulting in code duplication

By moving the hold logic to the driver, both limitations can be overcome.
2019-07-29 10:39:50 +02:00
Marian Buschsieweke
d2d83c3bd0
drivers/dht: Fixed assert on uninitialized data
Instead of asserting that parameters are valid, dht_init() contained an assert
on uninitialized data. This commit fixes that assert
2019-07-19 16:14:29 +02:00
Marian Buschsieweke
c75bacceba
drivers/dht: Added error handling
Previously the DHT11/DHT21/DHT22 driver ended up in an infinite loop locking up
RIOT when a communication error occurred. This commit adds a simple timeout to
the communication in order to prevent these lock ups.
2019-07-19 15:57:49 +02:00
Kees Bakker
355c52ac46 drivers/dht: do normal assignment instead of memcpy 2019-01-10 19:43:43 +01:00
Kees Bakker
0cb92e1e51 drivers: replace memset by simple assignments
A memset was used to clear two of the SAUL values in phydat_t::val
The change is to replace that by the following
    res->val[1] = 0;
    res->val[2] = 0;
which makes the code more obvious.
2019-01-07 21:59:25 +01:00
fffd6a2e07 drivers/dht: use new driver params scheme 2018-03-08 12:52:52 +01:00
94c753c07a drivers: doxygen cleanup 2017-09-01 15:12:20 +02:00
f1a93bf36e drivers/dht: some cleanup 2017-06-28 16:57:29 +02:00
smlng
946256d26f saul: use const for device parameter 2017-06-26 20:25:37 +02:00
317716419c drivers: use const device descriptor 2017-06-21 17:05:45 +02:00
smlng
a7b049f98a drivers: coding style, use {} for empty while loops 2017-06-11 20:08:10 +02:00
Hauke Petersen
3afc3eb10b drivers/dht: updated auto-init + some enhancements
- unified auto-init to use same style as other SAUl devices
- make use of named return values
- added some asserts
2017-02-07 09:59:23 +01:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +01:00
Joakim Nohlgård
7c48c891a0 xtimer: Update xtimer usage to match API changes 2016-11-29 20:44:31 +01:00
Matthias Kolja Miehl
3733bb7c14 drivers/dht: fix variableScope 2016-09-05 02:15:51 +02:00
Michel Rottleuthner
822007fa67 drivers/dht: fix fake parsing error with DHT22 2016-07-05 15:10:49 +02:00
Hauke Petersen
b68b14b49b Merge pull request #4666 from haukepetersen/opt_driver_dhtsaul
drivers/dht: added support for SAUL
2016-03-22 11:06:16 +01:00
Hauke Petersen
08ce2a5090 drivers/dht: adapted to GPIO changes 2016-03-17 14:55:31 +01:00
Hauke Petersen
e51d634aeb drivers: adapted gpio_init(_x)() calls 2016-03-17 14:55:30 +01:00
Hauke Petersen
7c86467ef0 drivers/dht: added SAUL support 2016-03-17 10:39:42 +01:00
Hauke Petersen
6fca96c668 drivers/dht: simplified interface 2016-02-20 18:19:20 +01:00
Hauke Petersen
044cb3c2f9 drivers/dht: optimized driver code
- simplyfied pulse parsing code
- inlined one-time called functions
- some style fixes
2016-02-20 18:19:20 +01:00
Hauke Petersen
f5f793c3f2 drivers/dht: made pullup configurable 2016-02-20 18:19:20 +01:00
Hauke Petersen
c46bc68ac5 drivers/dht: optimized DHT driver
- added default dht_params.h file
- added dht_auto_init(void) function
- changed init function to init(dev, params)
- s/gpio/pin/ in device descriptor
- moved FEATURE_REQUIRED to drivers/Makefile.dep
2016-02-20 18:19:20 +01:00
Ludwig Knüpfer
eda6328e21 documentation: update my name (Ortmann -> Knüpfer) 2015-09-27 18:58:30 +02:00
ada06e9d22 drivers: dht: adapt to xtimer 2015-09-16 10:58:51 +02:00
Hauke Petersen
2cc2d9f740 drivers: adjusted drivers to changed GPIO interface 2015-06-12 19:10:29 +02:00
Ludwig Ortmann
4a05f47bcf drivers/dht: initial import
Unified driver for DHT11 and DHT22.
2015-05-29 06:24:18 +02:00