Temperature Sensor Driver

Temperature sensors are devices that convert temperature variations into electrical signals, which are widely applied in industries including consumer electronics, healthcare, automotive, and environmental monitoring.

The temperature sensor driver for this scenario is relatively straightforward, as its primary function is to read the current CPU temperature. The RTOS includes a temperature sensor driver and a corresponding test program that is located at rtthread/bsp/starfive/libraries/driver/drv_tempsensor.c.

Figure 1. Temperature Sensor Test Case

Test description: Every time the test program is called, it reads the CPU's current temperature. You can press your finger on the CPU and run the program to see the temperature change.