Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

Temperature Sensor Example#

Overview#

This sample demonstrates the HAL flow for the K230 on-chip temperature sensor.

Source file:

src/rtsmart/examples/peripheral/tsensor/test_tsensor.c

Sample Capabilities#

  • set single-shot or continuous mode

  • set and read the trim value in the range 0..15

  • periodically read the current temperature in degrees Celsius

  • exit with Ctrl+C

Key APIs#

  • drv_tsensor_set_mode() / drv_tsensor_get_mode()

  • drv_tsensor_set_trim() / drv_tsensor_get_trim()

  • drv_tsensor_read_temperature()

Build and Run#

Build#

cd src/rtsmart/examples/peripheral/tsensor
make

Run#

./test_tsensor

Output Description#

The sample prints the current mode, trim setting, and temperature readings so you can verify the tsensor path.

Differences from Older Descriptions#

This page follows the current HAL sample implementation and parameter behavior in the SDK source.

Comments list
Comments
Log in