drivers: sensor: dht20: implement new driver
The DHT20 sensor is a temperature and humidity sensor that uses I2C to communicate with a microcontroller. The DHT20 sensor is Aosong. use standard crc update description to add reference to AHT20 and AM2301B clean code, use defines and bit manipulation add dht20 to i2c test suite for build tests update bit manipulation use more defines instead of raw numbers add bindings to allow aht20 or am2301b to be used in devicetree in all 3 cases, the same dht20.c driver is compiled Signed-off-by: Nathan Olff <nathan@kickmaker.net>
This commit is contained in:
parent
6049bbf4e0
commit
13deb0365c
9 changed files with 452 additions and 0 deletions
14
dts/bindings/sensor/aosong,aht20.yaml
Normal file
14
dts/bindings/sensor/aosong,aht20.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2024 Nathan Olff
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Aosong AHT20 (Digital-output Humidity and Temperature Sensor)
|
||||
|
||||
The Asosong AHT20 sensor provides temperature and humidity
|
||||
measurements through an I2C bus.
|
||||
|
||||
compatible: "aosong,aht20"
|
||||
|
||||
include: [sensor-device.yaml, i2c-device.yaml]
|
14
dts/bindings/sensor/aosong,am2301b.yaml
Normal file
14
dts/bindings/sensor/aosong,am2301b.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2024 Nathan Olff
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Aosong AM2301B (Digital-output Humidity and Temperature Sensor)
|
||||
|
||||
The Asosong AM2301B sensor provides temperature and humidity
|
||||
measurements through an I2C bus.
|
||||
|
||||
compatible: "aosong,am2301b"
|
||||
|
||||
include: [sensor-device.yaml, i2c-device.yaml]
|
14
dts/bindings/sensor/aosong,dht20.yaml
Normal file
14
dts/bindings/sensor/aosong,dht20.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (c) 2024 Nathan Olff
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Aosong DHT20 (Digital-output Humidity and Temperature Sensor)
|
||||
|
||||
The Asosong DHT20 sensor provides temperature and humidity
|
||||
measurements through an I2C bus.
|
||||
|
||||
compatible: "aosong,dht20"
|
||||
|
||||
include: [sensor-device.yaml, i2c-device.yaml]
|
Loading…
Add table
Add a link
Reference in a new issue