![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the thermal management unit (TMU) module of MCUXpresso SDK devices.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/tmu
Data Structures | |
struct | tmu_thresold_config_t |
configuration for TMU thresold. More... | |
struct | tmu_interrupt_status_t |
TMU interrupt status. More... | |
struct | tmu_config_t |
Configuration for TMU module. More... | |
Macros | |
#define | FSL_TMU_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
TMU driver version. More... | |
Enumerations | |
enum | _tmu_interrupt_enable { kTMU_ImmediateTemperatureInterruptEnable, kTMU_AverageTemperatureInterruptEnable, kTMU_AverageTemperatureCriticalInterruptEnable } |
TMU interrupt enable. More... | |
enum | _tmu_interrupt_status_flags { kTMU_ImmediateTemperatureStatusFlags = TMU_TIDR_ITTE_MASK, kTMU_AverageTemperatureStatusFlags = TMU_TIDR_ATTE_MASK, kTMU_AverageTemperatureCriticalStatusFlags } |
TMU interrupt status flags. More... | |
enum | _tmu_status_flags { kTMU_IntervalExceededStatusFlags = TMU_TSR_MIE_MASK, kTMU_OutOfLowRangeStatusFlags = TMU_TSR_ORL_MASK, kTMU_OutOfHighRangeStatusFlags } |
TMU status flags. More... | |
enum | tmu_average_low_pass_filter_t { kTMU_AverageLowPassFilter1_0 = 0U, kTMU_AverageLowPassFilter0_5 = 1U, kTMU_AverageLowPassFilter0_25 = 2U, kTMU_AverageLowPassFilter0_125 = 3U } |
Average low pass filter setting. More... | |
Functions | |
void | TMU_Init (TMU_Type *base, const tmu_config_t *config) |
Enable the access to TMU registers and Initialize TMU module. More... | |
void | TMU_Deinit (TMU_Type *base) |
De-initialize TMU module and Disable the access to DCDC registers. More... | |
void | TMU_GetDefaultConfig (tmu_config_t *config) |
Gets the default configuration for TMU. More... | |
static void | TMU_Enable (TMU_Type *base, bool enable) |
Enable/Disable the TMU module. More... | |
static void | TMU_EnableInterrupts (TMU_Type *base, uint32_t mask) |
Enable the TMU interrupts. More... | |
static void | TMU_DisableInterrupts (TMU_Type *base, uint32_t mask) |
Disable the TMU interrupts. More... | |
void | TMU_GetInterruptStatusFlags (TMU_Type *base, tmu_interrupt_status_t *status) |
Get interrupt status flags. More... | |
void | TMU_ClearInterruptStatusFlags (TMU_Type *base, uint32_t mask) |
Clear interrupt status flags and corresponding interrupt critical site capture register. More... | |
static uint32_t | TMU_GetStatusFlags (TMU_Type *base) |
Get TMU status flags. More... | |
status_t | TMU_GetHighestTemperature (TMU_Type *base, uint32_t *temperature) |
Get the highest temperature reached for any enabled monitored site within the temperature sensor range. More... | |
status_t | TMU_GetLowestTemperature (TMU_Type *base, uint32_t *temperature) |
Get the lowest temperature reached for any enabled monitored site within the temperature sensor range. More... | |
status_t | TMU_GetImmediateTemperature (TMU_Type *base, uint32_t siteIndex, uint32_t *temperature) |
Get the last immediate temperature at site n. More... | |
status_t | TMU_GetAverageTemperature (TMU_Type *base, uint32_t siteIndex, uint32_t *temperature) |
Get the last average temperature at site n. More... | |
void | TMU_SetHighTemperatureThresold (TMU_Type *base, const tmu_thresold_config_t *config) |
Configure the high temperature thresold value and enable/disable relevant thresold. More... | |
struct tmu_thresold_config_t |
Data Fields | |
bool | immediateThresoldEnable |
Enable high temperature immediate threshold. More... | |
bool | AverageThresoldEnable |
Enable high temperature average threshold. More... | |
bool | AverageCriticalThresoldEnable |
Enable high temperature average critical threshold. More... | |
uint8_t | immediateThresoldValue |
Range:0U-125U. More... | |
uint8_t | averageThresoldValue |
Range:0U-125U. More... | |
uint8_t | averageCriticalThresoldValue |
Range:0U-125U. More... | |
bool tmu_thresold_config_t::immediateThresoldEnable |
bool tmu_thresold_config_t::AverageThresoldEnable |
bool tmu_thresold_config_t::AverageCriticalThresoldEnable |
uint8_t tmu_thresold_config_t::immediateThresoldValue |
Valid when corresponding thresold is enabled. High temperature immediate threshold value. Determines the current upper temperature threshold, for anyenabled monitored site.
uint8_t tmu_thresold_config_t::averageThresoldValue |
Valid when corresponding thresold is enabled. High temperature average threshold value. Determines the average upper temperature threshold, for any enabled monitored site.
uint8_t tmu_thresold_config_t::averageCriticalThresoldValue |
Valid when corresponding thresold is enabled. High temperature average critical threshold value. Determines the average upper critical temperature threshold, for any enabled monitored site.
struct tmu_interrupt_status_t |
Data Fields | |
uint32_t | interruptDetectMask |
The mask of interrupt status flags. More... | |
uint16_t | immediateInterruptsSiteMask |
The mask of the temperature sensor site associated with a detected ITTE event. More... | |
uint16_t | AverageInterruptsSiteMask |
The mask of the temperature sensor site associated with a detected ATTE event. More... | |
uint16_t | AverageCriticalInterruptsSiteMask |
The mask of the temperature sensor site associated with a detected ATCTE event. More... | |
uint32_t tmu_interrupt_status_t::interruptDetectMask |
Refer to "_tmu_interrupt_status_flags" enumeration.
uint16_t tmu_interrupt_status_t::immediateInterruptsSiteMask |
Please refer to "_tmu_monitor_site" enumeration.
uint16_t tmu_interrupt_status_t::AverageInterruptsSiteMask |
Please refer to "_tmu_monitor_site" enumeration.
uint16_t tmu_interrupt_status_t::AverageCriticalInterruptsSiteMask |
Please refer to "_tmu_monitor_site" enumeration.
struct tmu_config_t |
Data Fields | |
uint8_t | monitorInterval |
Temperature monitoring interval in seconds. More... | |
uint16_t | monitorSiteSelection |
By setting the select bit for a temperature sensor site, it is enabled and included in all monitoring functions. More... | |
tmu_average_low_pass_filter_t | averageLPF |
The average temperature is calculated as: ALPF x Current_Temp + (1 - ALPF) x Average_Temp. More... | |
uint8_t tmu_config_t::monitorInterval |
Please refer to specific table in RM.
uint16_t tmu_config_t::monitorSiteSelection |
If no site is selected, site 0 is monitored by default. Refer to "_tmu_monitor_site" enumeration. Please look up relevant table in reference manual.
tmu_average_low_pass_filter_t tmu_config_t::averageLPF |
For proper operation, this field should only change when monitoring is disabled.
#define FSL_TMU_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) |
Version 2.0.3.
enum _tmu_status_flags |
void TMU_Init | ( | TMU_Type * | base, |
const tmu_config_t * | config | ||
) |
base | TMU peripheral base address. |
config | Pointer to configuration structure. Refer to "tmu_config_t" structure. |
void TMU_Deinit | ( | TMU_Type * | base | ) |
base | TMU peripheral base address. |
void TMU_GetDefaultConfig | ( | tmu_config_t * | config | ) |
This function initializes the user configuration structure to default value. The default value are:
Example:
config | Pointer to TMU configuration structure. |
|
inlinestatic |
base | TMU peripheral base address. |
enable | Switcher to enable/disable TMU. |
|
inlinestatic |
base | TMU peripheral base address. |
mask | The interrupt mask. Refer to "_tmu_interrupt_enable" enumeration. |
|
inlinestatic |
base | TMU peripheral base address. |
mask | The interrupt mask. Refer to "_tmu_interrupt_enable" enumeration. |
void TMU_GetInterruptStatusFlags | ( | TMU_Type * | base, |
tmu_interrupt_status_t * | status | ||
) |
base | TMU peripheral base address. |
status | The pointer to interrupt status structure. Record the current interrupt status. Please refer to "tmu_interrupt_status_t" structure. |
void TMU_ClearInterruptStatusFlags | ( | TMU_Type * | base, |
uint32_t | mask | ||
) |
base | TMU peripheral base address. |
mask | The mask of interrupt status flags. Refer to "_tmu_interrupt_status_flags" enumeration. |
|
inlinestatic |
base | TMU peripheral base address. |
status_t TMU_GetHighestTemperature | ( | TMU_Type * | base, |
uint32_t * | temperature | ||
) |
base | TMU peripheral base address. |
temperature | Highest temperature recorded in degrees Celsius by any enabled monitored site. |
kStatus_Success | Temperature reading is valid. |
kStatus_Fail | Temperature reading is not valid due to no measured temperature within the sensor range of 0-125 °C for an enabled monitored site. |
status_t TMU_GetLowestTemperature | ( | TMU_Type * | base, |
uint32_t * | temperature | ||
) |
base | TMU peripheral base address. |
temperature | Lowest temperature recorded in degrees Celsius by any enabled monitored site. |
kStatus_Success | Temperature reading is valid. |
kStatus_Fail | Temperature reading is not valid due to no measured temperature within the sensor range of 0-125 °C for an enabled monitored site. |
status_t TMU_GetImmediateTemperature | ( | TMU_Type * | base, |
uint32_t | siteIndex, | ||
uint32_t * | temperature | ||
) |
The site must be part of the list of enabled monitored sites as defined by monitorSiteSelection in "tmu_config_t" structure.
base | TMU peripheral base address. |
siteIndex | The index of the site user want to read. 0U: site0 ~ 15U: site15. |
temperature | Last immediate temperature reading at site n . |
kStatus_Success | Temperature reading is valid. |
kStatus_Fail | Temperature reading is not valid because temperature out of sensor range or first measurement still pending. |
status_t TMU_GetAverageTemperature | ( | TMU_Type * | base, |
uint32_t | siteIndex, | ||
uint32_t * | temperature | ||
) |
The site must be part of the list of enabled monitored sites as defined by monitorSiteSelection in "tmu_config_t" structure.
base | TMU peripheral base address. |
siteIndex | The index of the site user want to read. 0U: site0 ~ 15U: site15. |
temperature | Last average temperature reading at site n . |
kStatus_Success | Temperature reading is valid. |
kStatus_Fail | Temperature reading is not valid because temperature out of sensor range or first measurement still pending. |
void TMU_SetHighTemperatureThresold | ( | TMU_Type * | base, |
const tmu_thresold_config_t * | config | ||
) |
base | TMU peripheral base address. |
config | Pointer to configuration structure. Refer to "tmu_thresold_config_t" structure. |