Loading...
Searching...
No Matches

Driver for the EFM32 internal temperature sensor. More...

Detailed Description

Driver for the EFM32 internal temperature sensor.

All EFM32 chips have an internal temperature sensor. This EFM32-specific driver provides an interface for reading this value, compensated using factory-calibrated values.

On Series 0 and Series 1 devices, the sensor is read through an ADC input channel. The board must define CORETEMP_ADC to point to the ADC line that connects to the right ADC input channel.

On Series 2 devices, the sensor is read directly through the EMU peripheral.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Note
The sensor measures the die temperature, which is higher than the ambient temperature when the device is awake and dissipates power.

Files

file  coretemp.h
 Interface definition of the EFM32 internal temperature sensor driver.
 

Functions

int coretemp_init (void)
 Initialize the sensor.
 
int16_t coretemp_read (void)
 Read the current temperature from the sensor.
 

Function Documentation

◆ coretemp_init()

int coretemp_init ( void )

Initialize the sensor.

On Series 0 and Series 1 devices, this driver assumes that CORETEMP_ADC is defined and points to the ADC input channel that is connected to the internal temperature sensor. Series 2 devices require no configuration.

Return values
0successful initialization
-EIOInitialization error (Series 0/1 only)

◆ coretemp_read()

int16_t coretemp_read ( void )

Read the current temperature from the sensor.

The temperature readings are compensated using the factory-calibration values. On Series 0 and Series 1 devices, the sensor value is read via the ADC. On Series 2 devices, the sensor value is read from the EMU peripheral.

Return values
-10000Invalid reading (missing factory calibration data)
Returns
current temperature in centi-degrees Celsius (times 100)