Skip to content

Commit 621fd7d

Browse files
committed
drivers/sensors: Add SHTC3 uORB sensor driver
This adds uORB driver support for the Sensirion SHTC3 I2C sensor, exposing ambient temperature and relative humidity nodes. Signed-off-by: Shriyans S Sahoo <shriyans.s.sahoo@gmail.com>
1 parent 24b245a commit 621fd7d

8 files changed

Lines changed: 451 additions & 0 deletions

File tree

Documentation/components/drivers/special/sensors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ tool for monitoring sensor activity at runtime.
3636
sensors/nau7802.rst
3737
sensors/qmi8658.rst
3838
sensors/sht4x.rst
39+
sensors/shtc3.rst
3940
sensors/lsm6dso32.rst
4041
sensors/lis2mdl.rst
4142
sensors/l86xxx.rst

Documentation/components/drivers/special/sensors/sensors_uorb.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,5 +555,6 @@ Implemented Drivers
555555
- :doc:`nau7802`
556556
- :doc:`qmi8658`
557557
- :doc:`sht4x`
558+
- :doc:`shtc3`
558559
- :doc:`lsm6dso32`
559560
- wtgahrs2
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=============================
2+
Sensirion SHTC3 Sensor Driver
3+
=============================
4+
5+
This driver provides support for the Sensirion SHTC3 temperature and humidity sensor
6+
using the uORB sensor framework.
7+
8+
It provides two uORB topics:
9+
- ``SENSOR_TYPE_AMBIENT_TEMPERATURE``
10+
- ``SENSOR_TYPE_RELATIVE_HUMIDITY``
11+
12+
Configuration
13+
-------------
14+
15+
To enable the driver, select ``CONFIG_SENSORS_SHTC3=y`` in your board configuration.
16+
You can configure the I2C frequency via ``CONFIG_SHTC3_I2C_FREQUENCY`` (default is 400kHz).

drivers/sensors/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,5 +494,10 @@ if(CONFIG_SENSORS)
494494
list(APPEND SRCS cxd5602pwbimu.c)
495495
endif()
496496

497+
# SENSIRON SHTC3
498+
if(CONFIG_SENSORS_SHTC3)
499+
list(APPEND SRCS shtc3_uorb.c)
500+
endif()
501+
497502
target_sources(drivers PRIVATE ${SRCS})
498503
endif()

drivers/sensors/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,24 @@ config SHT3X_DEBUG
19041904

19051905
endif # SENSORS_SHT3X
19061906

1907+
config SENSORS_SHTC3
1908+
bool "Sensirion SHTC3 Sensor"
1909+
depends on I2C
1910+
---help---
1911+
Enable driver support for the Sensirion SHTC3
1912+
temperature and humidity sensor.
1913+
1914+
if SENSORS_SHTC3
1915+
1916+
config SHTC3_I2C_FREQUENCY
1917+
int "SHTC3 I2C Frequency"
1918+
default 400000
1919+
1920+
endif # SENSORS_SHTC3
1921+
1922+
1923+
1924+
19071925
config SENSORS_SHT4X
19081926
bool "Sensirion SHT4x temperature and humidity sensor"
19091927
default n

drivers/sensors/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ ifeq ($(CONFIG_SENSORS_CXD5602PWBIMU),y)
492492
CSRCS += cxd5602pwbimu.c
493493
endif
494494

495+
ifeq ($(CONFIG_SENSORS_SHTC3),y)
496+
CSRCS += shtc3_uorb.c
497+
endif
498+
495499
# Include sensor driver build support
496500

497501
DEPPATH += --dep-path sensors

0 commit comments

Comments
 (0)