Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/components/drivers/special/sensors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ tool for monitoring sensor activity at runtime.
sensors/nau7802.rst
sensors/qmi8658.rst
sensors/sht4x.rst
sensors/tc74.rst
sensors/tmp112.rst
sensors/lsm6dso32.rst
sensors/lsm6ds3trc.rst
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ Implemented Drivers
- :doc:`nau7802`
- :doc:`qmi8658`
- :doc:`sht4x`
- :doc:`tc74`
- :doc:`tmp112`
- :doc:`lsm6dso32`
- :doc:`lsm6ds3trc`
Expand Down
46 changes: 46 additions & 0 deletions Documentation/components/drivers/special/sensors/tc74.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
====
TC74
====

The TC74 is a Microchip serial digital thermal sensor, specified from
-40°C to +125°C, with an eight-bit reading of 1°C a count. Factory-programmed
I2C addresses range from 0x48 through 0x4f (suffixes A0 through A7), allowing
up to eight parts on the same bus.

This driver uses the :doc:`uorb
</components/drivers/special/sensors/sensors_uorb>` interface, so the reading
appears as a topic the common sensor tools can read.

Application Programming Interface
=================================

The header file for the TC74 driver interface can be included using:

.. code-block:: c

#include <nuttx/sensors/tc74.h>

Registering the driver creates one topic, ``sensor_temp<n>``, where ``n`` is
the ``devno`` passed in:

.. code-block:: c

int tc74_register(int devno, FAR struct i2c_master_s *i2c, uint8_t addr);

For example, a part with address 0x4d (TC74A5) on I2C bus 0, published as
``sensor_temp0``:

.. code-block:: c

FAR struct i2c_master_s *i2c = board_i2cbus_initialize(0);

tc74_register(0, i2c, TC74_ADDR_A5);

Reading
=======

The driver polls on the low priority work queue at whatever interval a
consumer asks for. When activated (for example when an application subscribes
to the sensor topic), the driver wakes the part up from standby mode. When
deactivated (when all subscribers close the topic), it places the part back
into low-power standby mode to save energy.
4 changes: 4 additions & 0 deletions drivers/sensors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ if(CONFIG_SENSORS)
endif()
endif()

if(CONFIG_SENSORS_TC74)
list(APPEND SRCS tc74.c)
endif()

# QMI8658 6-axis IMU

if(CONFIG_SENSORS_QMI8658)
Expand Down
18 changes: 18 additions & 0 deletions drivers/sensors/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,24 @@ config SENSORS_TMP112_UORB

endif #SENSORS_TMP112

config SENSORS_TC74
bool "Microchip TC74 Temperature Sensor support"
default n
select I2C
---help---
Enable driver support for the Microchip TC74 digital temperature sensor.

if SENSORS_TC74

config TC74_I2C_FREQUENCY
int "TC74 I2C frequency"
default 100000
range 1 100000
---help---
I2C clock frequency for the TC74 sensor. Default is 100 kHz.

endif # SENSORS_TC74

config SENSORS_QMI8658
bool "QST QMI8658 6-Axis IMU Sensor support"
default n
Expand Down
4 changes: 4 additions & 0 deletions drivers/sensors/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ else
endif
endif

ifeq ($(CONFIG_SENSORS_TC74),y)
CSRCS += tc74.c
endif

endif # CONFIG_I2C

# These drivers depend on SPI support
Expand Down
Loading
Loading