The MCUXpresso SDK provides a peripheral driver for the Temperature Sensor Module (TEMPSENSOR) module of MCUXpresso SDK devices.
TEMPSENSOR Operations
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.
|
enum | {
kTEMPSENSOR_HighTempInterruptStatusEnable,
kTEMPSENSOR_LowTempInterruptStatusEnable,
kTEMPSENSOR_PanicTempInterruptStatusEnable,
kTEMPSENSOR_FinishInterruptStatusEnable = TMPSNS_CTRL1_FINISH_IE_MASK
} |
| TMPSNS interrupt status enable type, tmpsns_interrupt_status_enable_t. More...
|
|
enum | {
kTEMPSENSOR_HighTempInterruptStatus = TMPSNS_STATUS0_HIGH_TEMP_MASK,
kTEMPSENSOR_LowTempInterruptStatus = TMPSNS_STATUS0_LOW_TEMP_MASK,
kTEMPSENSOR_PanicTempInterruptStatus = TMPSNS_STATUS0_PANIC_TEMP_MASK
} |
| TMPSNS interrupt status type, tmpsns_interrupt_status_t. More...
|
|
enum | tmpsns_measure_mode_t {
kTEMPSENSOR_SingleMode = 0U,
kTEMPSENSOR_ContinuousMode = 1U
} |
| TMPSNS measure mode, tempsensor_measure_mode. More...
|
|
enum | _tmpsns_alarm_mode {
kTEMPMON_HighAlarmMode = 0U,
kTEMPMON_PanicAlarmMode = 1U,
kTEMPMON_LowAlarmMode = 2U
} |
| TMPSNS alarm mode. More...
|
|
uint16_t _tmpsns_config::frequency |
int32_t _tmpsns_config::highAlarmTemp |
int32_t _tmpsns_config::panicAlarmTemp |
int32_t _tmpsns_config::lowAlarmTemp |
Enumerator |
---|
kTEMPSENSOR_HighTempInterruptStatusEnable |
High temperature interrupt status enable.
|
kTEMPSENSOR_LowTempInterruptStatusEnable |
Low temperature interrupt status enable.
|
kTEMPSENSOR_PanicTempInterruptStatusEnable |
Panic temperature interrupt status enable.
|
kTEMPSENSOR_FinishInterruptStatusEnable |
Finish interrupt enable.
|
Enumerator |
---|
kTEMPSENSOR_HighTempInterruptStatus |
High temperature interrupt status.
|
kTEMPSENSOR_LowTempInterruptStatus |
Low temperature interrupt status.
|
kTEMPSENSOR_PanicTempInterruptStatus |
Panic temperature interrupt status.
|
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. |
static uint32_t TMPSNS_GetInterruptFlags |
( |
TMPSNS_Type * |
base | ) |
|
|
inlinestatic |
static void TMPSNS_ClearInterruptFlags |
( |
TMPSNS_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | TMPSNS base pointer |
mask | The interrupts to disable from tmpsns_interrupt_status_t. |