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

31 Commits

Author SHA1 Message Date
Marian Buschsieweke
ceeb787a6f
drivers: no need to convert gpio_read() to bool
We just changed the API so that it returns bool anyway.
2024-10-23 13:24:10 +02:00
Virgile Robles
a2db594eb5 drivers/dht: fix null deref with saul 2024-10-20 07:53:52 +02:00
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
Wouter Symons
5055d0993e drivers/dht: correct interpreting raw values 2021-11-20 14:55:02 +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
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
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