MCUXpresso SDK API Reference Manual: TMU: Thermal Management Unit Driver

| MCUXpresso SDK API Reference Manual Rev 2.11.1 NXP Semiconductors

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Enumerations | Functions
TMU: Thermal Management Unit Driver

## Overview

The MCUXpresso SDK provides a peripheral driver for the thermal management unit (TMU) module of MCUXpresso SDK devices.

# Typical use case

## Monitor and report Configuration

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/tmu

## Data Structures
struct | tmu_threshold_config_t
| configuration for TMU threshold. More...
struct | tmu_config_t
| Configuration for TMU module. More...

## Macros
#define | FSL_TMU_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
| TMU driver version. More...

## Enumerations
enum | { kTMU_ImmediateTemperature0InterruptEnable, kTMU_AverageTemperature0InterruptEnable, kTMU_AverageTemperature0CriticalInterruptEnable, kTMU_ImmediateTemperature1Interrupt1Enable, kTMU_AverageTemperature1Interrupt1Enable, kTMU_AverageTemperature1CriticalInterrupt1Enable }
| TMU interrupt enable, _tmu_interrupt_enable. More...
enum | { kTMU_ImmediateTemperature0InterruptStausFlags, kTMU_AverageTemperature0InterruptStausFlags, kTMU_AverageTemperature0CriticalInterruptStausFlags, kTMU_ImmediateTemperature1Interrupt1StausFlags, kTMU_AverageTemperature1Interrupt1StausFlags, kTMU_AverageTemperature1CriticalInterrupt1StausFlags }
| TMU interrupt enable, _tmu_interrupt_status_flags. More...
enum | tmu_probe_select_t { kTMU_ProbeSelectMainProbe = 1U << 0U, kTMU_ProbeSelectRemoteProbe = 1U << 1U, kTMU_ProbeSelectBothProbes = ( 1U << 0U) | (1U << 1U) }
| Probe selection. 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_Enable (TMU_Type *base, bool enable)
| Enable/disable TMU module. More...
void | TMU_GetDefaultConfig (tmu_config_t *config)
| Gets the default configuration for TMU. 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...
static uint32_t | TMU_GetInterruptStatusFlags (TMU_Type *base)
| Get interrupt status flags. More...
static void | TMU_ClearInterruptStatusFlags (TMU_Type *base, uint32_t mask)
| Clear interrupt status flags. More...
status_t | TMU_GetImmediateTemperature (TMU_Type *base, tmu_probe_select_t probe, int8_t *temperature)
| Get the last immediate temperature at site. More...
status_t | TMU_GetAverageTemperature (TMU_Type *base, tmu_probe_select_t probe, int8_t *temperature)
| Get the last average temperature at site. More...
void | TMU_UpdateHighTemperatureThreshold (TMU_Type *base, tmu_probe_select_t probe, const tmu_threshold_config_t *thresholdConfig)
| Update the high temperature threshold value. More...

## Data Structure Documentation

struct tmu_threshold_config_t

### Data Fields
bool | immediateThresholdEnable
| Enable high temperature immediate threshold. More...
bool | AverageThresholdEnable
| Enable high temperature average threshold. More...
bool | AverageCriticalThresholdEnable
| Enable high temperature average critical threshold. More...
uint8_t | immediateThresholdValueOfMainProbe
| Range:-40~125. More...
uint8_t | averageThresholdValueOfMainProbe
| Range:-40~125. More...
uint8_t | averageCriticalThresholdValueOfMainProbe
| Range:-40~125. More...
uint8_t | immediateThresholdValueOfRemoteProbe
| Range:-40~125. More...
uint8_t | averageThresholdValueOfRemoteProbe
| Range:-40~125. More...
uint8_t | averageCriticalThresholdValueOfRemoteProbe
| Range:-40~125. More...

#### Field Documentation

bool tmu_threshold_config_t::immediateThresholdEnable

bool tmu_threshold_config_t::AverageThresholdEnable

bool tmu_threshold_config_t::AverageCriticalThresholdEnable

uint8_t tmu_threshold_config_t::immediateThresholdValueOfMainProbe

Valid when corresponding threshold is enabled. High temperature immediate threshold value of main probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

uint8_t tmu_threshold_config_t::averageThresholdValueOfMainProbe

Valid when corresponding threshold is enabled. High temperature average threshold value of main probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

uint8_t tmu_threshold_config_t::averageCriticalThresholdValueOfMainProbe

Valid when corresponding threshold is enabled. High temperature average critical threshold value of main probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

uint8_t tmu_threshold_config_t::immediateThresholdValueOfRemoteProbe

Valid when corresponding threshold is enabled. High temperature immediate threshold value of remote probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

uint8_t tmu_threshold_config_t::averageThresholdValueOfRemoteProbe

Valid when corresponding threshold is enabled. High temperature average threshold value of remote probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

uint8_t tmu_threshold_config_t::averageCriticalThresholdValueOfRemoteProbe

Valid when corresponding threshold is enabled. High temperature average critical threshold value of remote probe. Besides, bit-8 is sign bit: 1 means nagetive and 0 means positive.

struct tmu_config_t

### Data Fields
tmu_probe_select_t | probeSelect
| The temperature monitor probe select. More...
tmu_average_low_pass_filter_t | averageLPF
| The average temperature is calculated as: ALPF x Current_Temp + (1 - ALPF) x Average_Temp. More...
tmu_threshold_config_t | thresholdConfig
| The high temperature threshold configuration. More...

#### Field Documentation

tmu_probe_select_t tmu_config_t::probeSelect

tmu_average_low_pass_filter_t tmu_config_t::averageLPF

For proper operation, this field should only change when monitoring is disabled.

tmu_threshold_config_t tmu_config_t::thresholdConfig

## Macro Definition Documentation

#define FSL_TMU_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))

Version 2.0.0.

## Enumeration Type Documentation

anonymous enum

Enumerator
kTMU_ImmediateTemperature0InterruptEnable | Immediate temperature threshold exceeded interrupt enable of probe0.
kTMU_AverageTemperature0InterruptEnable | Average temperature threshold exceeded interrupt enable of probe0.
kTMU_AverageTemperature0CriticalInterruptEnable | Average temperature critical threshold exceeded interrupt enable of probe0.
kTMU_ImmediateTemperature1Interrupt1Enable | Immediate temperature threshold exceeded interrupt enable of probe1.
kTMU_AverageTemperature1Interrupt1Enable | Average temperature threshold exceeded interrupt enable of probe1.
kTMU_AverageTemperature1CriticalInterrupt1Enable | Average temperature critical threshold exceeded interrupt enable of probe1.

anonymous enum

Enumerator
kTMU_ImmediateTemperature0InterruptStausFlags | Immediate temperature threshold exceeded interrupt status of probe0.
kTMU_AverageTemperature0InterruptStausFlags | Average temperature threshold exceeded interrupt status of probe0.
kTMU_AverageTemperature0CriticalInterruptStausFlags | Average temperature critical threshold exceeded interrupt status of probe0.
kTMU_ImmediateTemperature1Interrupt1StausFlags | Immediate temperature threshold exceeded interrupt status of probe1.
kTMU_AverageTemperature1Interrupt1StausFlags | Average temperature threshold exceeded interrupt status of probe1.
kTMU_AverageTemperature1CriticalInterrupt1StausFlags | Average temperature critical threshold exceeded interrupt status of probe1.

enum tmu_probe_select_t

Enumerator
kTMU_ProbeSelectMainProbe | Select the main probe only.
kTMU_ProbeSelectRemoteProbe | Select the remote probe(near A53) only.
kTMU_ProbeSelectBothProbes | Select both 2 probes.

enum tmu_average_low_pass_filter_t

Enumerator
kTMU_AverageLowPassFilter1_0 | Average low pass filter = 1.
kTMU_AverageLowPassFilter0_5 | Average low pass filter = 0.5.
kTMU_AverageLowPassFilter0_25 | Average low pass filter = 0.25.
kTMU_AverageLowPassFilter0_125 | Average low pass filter = 0.125.

## Function Documentation

void TMU_Init | ( | TMU_Type * | base,
|  | const tmu_config_t * | config
| ) |  |

Parameters

  base | TMU peripheral base address.
  config | Pointer to configuration structure. Refer to "tmu_config_t" structure.

void TMU_Deinit | ( | TMU_Type * | base | ) |

Parameters

  base | TMU peripheral base address.

void TMU_Enable | ( | TMU_Type * | base,
|  | bool | enable
| ) |  |

Parameters

  base | TMU peripheral base address.
  enable | enable or disable TMU.

void TMU_GetDefaultConfig | ( | tmu_config_t * | config | ) |

This function initializes the user configuration structure to default value. The default value are:

Example:

config.averageLPF = kTMU_AverageLowPassFilter0_5;
config.probeSelect = kTMU_ProbeSelectMainProbe;
config.thresholdConfig.immediateThresholdEnable = false;
config.thresholdConfig.immediateThresholdValue = DEMO_TMU_IMMEDIATE_THRESOLD;
config.thresholdConfig.AverageThresholdEnable = true;
config.thresholdConfig.averageThresholdValue = DEMO_TMU_AVERAGE_THRESOLD;
config.thresholdConfig.AverageCriticalThresholdEnable = false;
config.thresholdConfig.averageCriticalThresholdValue = DEMO_TMU_AVERAGE_CRITICAL_THRESOLD;

Parameters

  config | Pointer to TMU configuration structure.

static void TMU_EnableInterrupts | ( | TMU_Type * | base,
|  | uint32_t | mask
| ) |  |
| inlinestatic

Parameters

  base | TMU peripheral base address.
  mask | The interrupt mask. Refer to "_tmu_interrupt_enable" enumeration.

static void TMU_DisableInterrupts | ( | TMU_Type * | base,
|  | uint32_t | mask
| ) |  |
| inlinestatic

Parameters

  base | TMU peripheral base address.
  mask | The interrupt mask. Refer to "_tmu_interrupt_enable" enumeration.

static uint32_t TMU_GetInterruptStatusFlags | ( | TMU_Type * | base | ) |
| inlinestatic

Parameters

  base | TMU peripheral base address.

Return values

  The | current interrupt status.

static void TMU_ClearInterruptStatusFlags | ( | TMU_Type * | base,
|  | uint32_t | mask
| ) |  |
| inlinestatic

Parameters

  base | TMU peripheral base address.
  mask | The mask of interrupt status flags. Refer to "_tmu_interrupt_status_flags" enumeration.

status_t TMU_GetImmediateTemperature | ( | TMU_Type * | base,
|  | tmu_probe_select_t | probe,
|  | int8_t * | temperature
| ) |  |

Parameters

  base | TMU peripheral base address.
  probe | probe selection, if select both 2 probes, return main probe temeperature by default. Refer to "tmu_probe_select_t" structure.
  temperature | Last immediate temperature reading at site when V=1. besides, Bit-8 is sign bit: 1 means nagetive and 0 means positive.

Return values

  get | immediate temperature status.

status_t TMU_GetAverageTemperature | ( | TMU_Type * | base,
|  | tmu_probe_select_t | probe,
|  | int8_t * | temperature
| ) |  |

Parameters

  base | TMU peripheral base address.
  probe | probe selection, if select both 2 probes, return main probe temeperature by default. Refer to "tmu_probe_select_t" structure.
  temperature | Last average temperature reading at site; besides, Bit-8 is sign bit: 1 means nagetive and 0 means positive.

Return values

  get | average temperature status.

void TMU_UpdateHighTemperatureThreshold | ( | TMU_Type * | base,
|  | tmu_probe_select_t | probe,
|  | const tmu_threshold_config_t * | thresholdConfig
| ) |  |

Parameters

  base | TMU peripheral base address.
  probe | probe selection, if select both 2 probes, set main probe path by default. Refer to "tmu_probe_select_t" structure.
  thresholdConfig | threshold configuration. Refer to "tmu_threshold_config_t" structure.