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.
uint16_t tmpsns_config_t::frequency |
int32_t tmpsns_config_t::highAlarmTemp |
int32_t tmpsns_config_t::panicAlarmTemp |
int32_t tmpsns_config_t::lowAlarmTemp |
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.
|
- Parameters
-
base | TMPSNS base pointer |
config | Pointer to configuration structure. |
void TMPSNS_Deinit |
( |
TMPSNS_Type * |
base | ) |
|
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
-
config | Pointer to a configuration structure. |
void TMPSNS_StartMeasure |
( |
TMPSNS_Type * |
base | ) |
|
void TMPSNS_StopMeasure |
( |
TMPSNS_Type * |
base | ) |
|
float TMPSNS_GetCurrentTemperature |
( |
TMPSNS_Type * |
base | ) |
|
- Parameters
-
- Returns
- current temperature with degrees Celsius.
void TMPSNS_SetTempAlarm |
( |
TMPSNS_Type * |
base, |
|
|
int32_t |
tempVal, |
|
|
tmpsns_alarm_mode_t |
alarmMode |
|
) |
| |
- Parameters
-
base | TMPSNS base pointer |
tempVal | The alarm temperature with degrees Celsius |
alarmMode | The alarm mode. |
void TMPSNS_EnableInterrupt |
( |
TMPSNS_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
- Parameters
-
base | TMPSNS base pointer |
mask | The interrupts to enable from tmpsns_interrupt_status_enable_t. |
void TMPSNS_DisableInterrupt |
( |
TMPSNS_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
- Parameters
-
base | TMPSNS base pointer |
mask | The interrupts to disable from tmpsns_interrupt_status_enable_t. |