Driver for the EFM32 internal temperature sensor. More...
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.
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. | |
| 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.
| 0 | successful initialization |
| -EIO | Initialization error (Series 0/1 only) |
| 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.
| -10000 | Invalid reading (missing factory calibration data) |