| FRDM-KW40Z Demo Software Reference Manual Rev 0.0 NXP Semiconductors |

Files | Macros | Enumerations | Functions
Temperature Sensor

## Overview

Temperature sensor module implements functions to obtain the internal chip temperature of the SoC by reading the temperature sensor ADC channel.

## Files
file | temperature_sensor.h

## Macros
#define | TEMPERATURE_SENSOR_ADC_INSTANCE
#define | TEMPERATURE_SENSOR_V_BANDGAP_mV
#define | TEMPERATURE_SENSOR_ADC_RESOLUTION
#define | TEMPERATURE_SENSOR_VTEMP25_mV
#define | TEMPERATURE_SENSOR_SLOPE_uV

## Enumerations
enum | temperature_sensor_status_t { kTemperatureSensorOk, kTemperatureInitError, kTemperatureSensorConversionStartError }

## Functions
temperature_sensor_status_t | temperature_sensor_init (void)
int16_t | temperature_sensor_get_chip_temperature (void)

## Macro Definition Documentation

#define TEMPERATURE_SENSOR_ADC_INSTANCE

ADC module instance connected to the internal temperature sensor.

#define TEMPERATURE_SENSOR_V_BANDGAP_mV

Bandgap ADC channel voltage (in mV)

#define TEMPERATURE_SENSOR_ADC_RESOLUTION

Expanded resolution value 2^Resolution.

#define TEMPERATURE_SENSOR_VTEMP25_mV

Temperature sensor voltage @25C defined by the datasheet.

#define TEMPERATURE_SENSOR_SLOPE_uV

Temperature sensor slope (in uV) defined by the datasheet.

## Enumeration Type Documentation

enum temperature_sensor_status_t

Temperature sensor status.

Enumerator
kTemperatureSensorOk | No error.
kTemperatureInitError | Initialization error.
kTemperatureSensorConversionStartError | Error starting the channel conversion.

## Function Documentation

temperature_sensor_status_t temperature_sensor_init | ( | void |  | ) |

Initializes the temperature sensor

Parameters

  [in] | None |

Returns
  temperature_sensor_status_t Error status

int16_t temperature_sensor_get_chip_temperature | ( | void |  | ) |

Returns the current chip temperature with a 0.01 °C resolution.

Parameters

  [in] | None |

Returns
  Temperature measurement with a 0.01 °C resolution or 0xFFFF if an error occurred