|
TMP42x HAL Based Library 1.0.2
This library is a software library that works with the TMP42x remote and local temperature sensor with N-Factor and series-R correction. This library provides a convenient and efficient way to access the I2C interfaces of the chip, allowing developers to easily integrate this power meter into their systems.
|
The TMP421, TMP422, and TMP423 are remote temperature sensor monitors with a built-in local temperature sensor. The remote temperature sensor diode-connected transistors are typically low-cost, NPN- or PNP-type transistors or diodes that are an integral part of microcontrollers, microprocessors, or FPGAs. (Click for more info)
This library is a software library that works with the TMP42x remote and local temperature sensor. This library provides a convenient and efficient way to access the I2C interfaces of the chip, allowing developers to easily integrate this sensor into their systems.
The library is designed to be easy to use and provides a simple, intuitive API for accessing the I2C interfaces of the TMP42x. It includes a range of functions for performing common I2C operations, such as sending and receiving data, querying the status of the chip, reading the measured parameters, and configuring the TMP42x settings.
With this library, developers can quickly and easily integrate the TMP42x into their systems, enabling them to take full advantage of the chip's capabilities.
The full documents are available here
Footprint and schematic symbols are available in my Altium library.
Is it helpfull?
TMP42x.c and TMP42x.h file to your project directory and add them to your IDE if necessary.TMP42x_getRemoteTemp function to read the meassured data: Here is the whole code:
If you want to use UART or virtual USB COM port on youe microcontroller, it is recommended to use this print function:
By applying the above trick, you can simply use this one to see the variables on the serial terminal:
You can read the integer part of the temperature value by calling TMP42x_getRemoteTemp_Int and TMP42x_getLocalTemp_Int
Each function is described on the doc page.
Instead of continous conversion (run mode), you can read start a single conversion when the device is in shutdown mode by calling the TMP42x_oneShotStart function (see more)
You can send a reset command to TMP42x chip by calling TMP42x_softwareReset function. (see more)
If you want to get the manufacturer or device ID, you can use these functions:
For example: