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..15periodically 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.
