MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TEMPSENSOR: Temperature Sensor Module

Overview

The MCUXpresso SDK provides a peripheral driver for the Temperature Sensor Module (TEMPSENSOR) module of MCUXpresso SDK devices.

The function TEMPMON_Init() will initialize the TEMPSENSOR peripheral operation.

The function TEMPMON_Deinit() will deinitialize the TEMPSENSOR peripheral operation.

The function TEMPMON_GetDefaultConfig() will get default configuration.

The function TEMPMON_StartMeasure() will start the temperature measurement process.

The function TEMPMON_StopMeasure() will stop the temperature measurement process.

The function TEMPMON_GetCurrentTemp() will get the current temperature.

The function TEMPMON_SetTempAlarm() will set the temperature count that will generate an alarm interrupt.

Files

file  fsl_tempsensor.h
 

Data Structures

struct  tmpsns_config_t
 TMPSNS temperature structure. More...
 

Enumerations

enum  {
  kTEMPSENSOR_HighTempInterruptStatusEnable,
  kTEMPSENSOR_LowTempInterruptStatusEnable,
  kTEMPSENSOR_PanicTempInterruptStatusEnable,
  kTEMPSENSOR_FinishInterruptStatusEnable
}
 TMPSNS interrupt status type, tmpsns_interrupt_status_enable_t. More...
 
enum  tmpsns_measure_mode_t {
  kTEMPSENSOR_SingleMode = 0U,
  kTEMPSENSOR_ContinuousMode = 1U
}
 TMPSNS measure mode, tempsensor_measure_mode. More...
 
enum  tmpsns_alarm_mode_t {
  kTEMPMON_HighAlarmMode = 0U,
  kTEMPMON_PanicAlarmMode = 1U,
  kTEMPMON_LowAlarmMode = 2U
}
 TMPSNS alarm mode. More...
 

Functions

void TMPSNS_Init (TMPSNS_Type *base, const tmpsns_config_t *config)
 Initializes the TMPSNS module. More...
 
void TMPSNS_Deinit (TMPSNS_Type *base)
 Deinitializes the TMPSNS module. More...
 
void TMPSNS_GetDefaultConfig (tmpsns_config_t *config)
 Gets the default configuration structure. More...
 
void TMPSNS_StartMeasure (TMPSNS_Type *base)
 start the temperature measurement process. More...
 
void TMPSNS_StopMeasure (TMPSNS_Type *base)
 stop the measurement process. More...
 
float TMPSNS_GetCurrentTemperature (TMPSNS_Type *base)
 Get current temperature with the fused temperature calibration data. More...
 
void TMPSNS_SetTempAlarm (TMPSNS_Type *base, int32_t tempVal, tmpsns_alarm_mode_t alarmMode)
 Set the temperature count (raw sensor output) that will generate an alarm interrupt. More...
 
void TMPSNS_EnableInterrupt (TMPSNS_Type *base, uint32_t mask)
 Enable interrupt status. More...
 
void TMPSNS_DisableInterrupt (TMPSNS_Type *base, uint32_t mask)
 Disable interrupt status. More...
 

Driver version

#define FSL_TMPSNS_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 Version 2.0.1.
 

Data Structure Documentation

struct tmpsns_config_t

Data Fields

tmpsns_measure_mode_t measureMode
 The temperature measure mode. More...
 
uint16_t frequency
 The temperature measure frequency. More...
 
int32_t highAlarmTemp
 The high alarm temperature. More...
 
int32_t panicAlarmTemp
 The panic alarm temperature. More...
 
int32_t lowAlarmTemp
 The low alarm temperature. More...
 

Field Documentation

tmpsns_measure_mode_t tmpsns_config_t::measureMode
uint16_t tmpsns_config_t::frequency
int32_t tmpsns_config_t::highAlarmTemp
int32_t tmpsns_config_t::panicAlarmTemp
int32_t tmpsns_config_t::lowAlarmTemp

Enumeration Type Documentation

anonymous enum
Enumerator
kTEMPSENSOR_HighTempInterruptStatusEnable 

High temperature interrupt status enable.

kTEMPSENSOR_LowTempInterruptStatusEnable 

High temperature interrupt status enable.

kTEMPSENSOR_PanicTempInterruptStatusEnable 

High temperature interrupt status enable.

kTEMPSENSOR_FinishInterruptStatusEnable 

High temperature interrupt status enable.

Enumerator
kTEMPSENSOR_SingleMode 

Single measurement mode.

kTEMPSENSOR_ContinuousMode 

Continuous measurement mode.

Enumerator
kTEMPMON_HighAlarmMode 

The high alarm temperature interrupt mode.

kTEMPMON_PanicAlarmMode 

The panic alarm temperature interrupt mode.

kTEMPMON_LowAlarmMode 

The low alarm temperature interrupt mode.

Function Documentation

void TMPSNS_Init ( TMPSNS_Type *  base,
const tmpsns_config_t config 
)
Parameters
baseTMPSNS base pointer
configPointer to configuration structure.
void TMPSNS_Deinit ( TMPSNS_Type *  base)
Parameters
baseTMPSNS base pointer
void TMPSNS_GetDefaultConfig ( tmpsns_config_t config)

This function initializes the TMPSNS configuration structure to a default value. The default values are: tempmonConfig->frequency = 0x02U; tempmonConfig->highAlarmTemp = 44U; tempmonConfig->panicAlarmTemp = 90U; tempmonConfig->lowAlarmTemp = 39U;

Parameters
configPointer to a configuration structure.
void TMPSNS_StartMeasure ( TMPSNS_Type *  base)
Parameters
baseTMPSNS base pointer.
void TMPSNS_StopMeasure ( TMPSNS_Type *  base)
Parameters
baseTMPSNS base pointer
float TMPSNS_GetCurrentTemperature ( TMPSNS_Type *  base)
Parameters
baseTMPSNS base pointer
Returns
current temperature with degrees Celsius.
void TMPSNS_SetTempAlarm ( TMPSNS_Type *  base,
int32_t  tempVal,
tmpsns_alarm_mode_t  alarmMode 
)
Parameters
baseTMPSNS base pointer
tempValThe alarm temperature with degrees Celsius
alarmModeThe alarm mode.
void TMPSNS_EnableInterrupt ( TMPSNS_Type *  base,
uint32_t  mask 
)
Parameters
baseTMPSNS base pointer
maskThe interrupts to enable from tmpsns_interrupt_status_enable_t.
void TMPSNS_DisableInterrupt ( TMPSNS_Type *  base,
uint32_t  mask 
)
Parameters
baseTMPSNS base pointer
maskThe interrupts to disable from tmpsns_interrupt_status_enable_t.