VTM
The Voltage and Thermal Management (VTM) controls the temperature monitors in the die. The VTM provides interrupt and event generation for overtemperature through the Error Signaling Module (ESM). It supports 3 different alerts:
an early alert so that firmware/software can start doing high-temperature thermal management,
a follow-up interrupt for reporting to firmware/software that the temperature has dropped to a safe level,
and a late interrupt whose high level can be used to trigger a hardware-voltage domain reset
SDL supports configuration of the VTM voltage domain and temperature warning. The 3 different alerts are also supported via the SDL ESM Handler, like all other ESM events. The SDL API can also be used to configure the VTM Maximum temperature threshold.
The VTM module provides the following functionality for the application
Ability to initialize VTM
Ability to check the status of the temperature sensor based on alert temperature
Ability to clear and contorl the VTM event inerrupts
SysConfig Features
None
Features NOT Supported
None
Important Usage Guidelines
None
Example Usage
The following shows an example of SDL VTM API usage by the application to set up the VTM for monitoring for events. Events can be monitored by enabling the events in the associated ESM instance.
Configure the VTM Thresholds and enable events
SDL_VTM_configTs cfgTs;
SDL_VTM_intrCtrl ctrl;
SDL_VTM_configVd cfgVd;
/* Initialize the config structure */
memset(&cfgTs, 0x0, sizeof(SDL_VTM_configTs));
/* Set the control bit for the Temperature sensor config to "SET_THR", indicating we want to set the thresholds */
cfgTs.configTsCtrl = SDL_VTM_VD_CONFIG_CTRL_SET_THR;
/* Set the Temperature sensor config */
cfgTs.thr_val.thrValidMap = SDL_VTM_GT_TH1_VALID | \
SDL_VTM_GT_TH2_VALID | \
SDL_VTM_LT_TH0_VALID;
cfgTs.thr_val.gtTh2En = TRUE;
cfgTs.thr_val.gtTh2 = gt_thr2_adc_code;
cfgTs.thr_val.gtTh1En = TRUE;
cfgTs.thr_val.gtTh1 = gt_thr1_adc_code;
cfgTs.thr_val.ltTh0En = TRUE;
cfgTs.thr_val.ltTh0 = lt_thr0_adc_code;
SDL_VTM_initTs(SDL_VTM_INSTANCE_TS_0 , &cfgTs);
/* Select all 3 interrupts to enable using "INTR_EN_SET" control bits */
ctrl = SDL_VTM_VD_GT_THR2_INTR_EN_SET | \
SDL_VTM_VD_GT_THR1_INTR_EN_SET | \
SDL_VTM_VD_LT_THR0_INTR_EN_CLR;
/* enable the threshold interrupts */
SDL_VTM_intrCntrl(SDL_VTM_INSTANCE_VD_DOMAIN_1, ctrl);
/* Initialize the config structure */
memset(&cfgVd, 0x0, sizeof(SDL_VTM_configVd));
cfgVd.configVdCtrl = SDL_VTM_VD_CONFIG_CTRL_EVT_SEL;
cfgVd.vd_temp_evts = SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_0;
/* enable the tracking of temperature events on this VD */
SDL_VTM_initVd(SDL_VTM_INSTANCE_VD_DOMAIN_1, &cfgVd);
Convert from Temperature to ADC Code
int32_t temp_val = 64000; // temperature in milli degrees Celsius
SDL_VTM_adc_code adc_code;
SDL_VTM_tsConvTempToAdc(temp_val, SDL_VTM_INSTANCE_TS_0, &adc_code);
Convert from ADC Code to Temperature
SDL_VTM_adc_code adc_code = 404;
int32_t temp_val; // temperature in milli degrees Celsius
SDL_VTM_tsConvAdcToTemp(adc_code, SDL_VTM_INSTANCE_TS_0, &temp_val);
Get Current Temperature Value
SDL_VTM_iStat_read_ctrl readCtrl;
SDL_VTM_adc_code adc_code;
/* Get current temperature value */
readCtrl = SDL_VTM_TS_READ_DATA_OUT_VAL;
SDL_VTM_getSensorStatus(iSDL_VTM_INSTANCE_TS_0, &readCtrl, &statusVal);
adc_code = statusVal.data_out; // data_out has the current temperature
Acknowledge and Disable an interrupt
SDL_VTM_intrCtrl ctrl;
/* Ack and disable the interrupt, by clearing the pending and enable bits */
ctrl = (SDL_VTM_VD_GT_THR2_INTR_EN_CLR | \
SDL_VTM_VD_GT_THR2_INTR_RAW_CLR);
SDL_VTM_intrCntrl(SDL_VTM_INSTANCE_VD_DOMAIN_1, ctrl);
API Reference
This file contains the SDL VTM API’s.
Provides the APIs for VTM.
Functions
-
int32_t SDL_VTM_initVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig)
VTM Voltage Domain initialization.
This function executes a VTM Voltage Domain initialization of the specified type for a specific VTM VD instance. VTM is a feature that is used to set OPP VID, event selection, global configuration
- Parameters:
instance – [IN] VTM Voltage Domain instance
pConfig – [IN] Pointer to VTM VD configuration (optional)
- Returns:
The SDL error code for the API. If pConfig is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_initTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig)
VTM Temperature sensor initialization.
This function executes a VTM Temperature sensor initialization of the specified type for a specific VTM TS instance. VTM is a feature that is used to set control register, thermal shutdown range, Threshold values and interrupts
- Parameters:
instance – [IN] VTM Temperature sensor instance
pConfig – [IN] Pointer to VTM TS configuration (optional)
- Returns:
The SDL error code for the API. If pConfig is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_getTemp(SDL_VTM_InstTs instance, int32_t *pTempVal)
Read VTM Temperature sensor values in degree celcius.
- Parameters:
instance – [IN] VTM Temperature sensor instance
pTempVal – [OUT] Pointer to Temperature sensor values
- Returns:
The SDL error code for the API. If pTempVal is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_getSensorStatus(SDL_VTM_InstTs instance, const SDL_VTM_Stat_read_ctrl *pCtrl, SDL_VTM_Stat_val *pStat_val)
Read VTM Temperature sensor status.
- Parameters:
instance – [IN] VTM Temperature sensor instance
pCtrl – [IN] Pointer to VTM interrupt control
pStat_val – [OUT] Pointer to Temperature sensor status
- Returns:
The SDL error code for the API. If pCtrl and pStat_val are NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_intrCntrl(SDL_VTM_InstVd instance, SDL_VTM_intrCtrl intrCtrl)
Set maximum Threshold values of VTM Temperature sensor.
- Parameters:
instance – [IN] VTM Temperature sensor instance
intrCtrl – [IN] VTM interrupt control
- Returns:
The SDL error code for the API. If intrCtrl and instance are invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_verifyConfigVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig)
VTM Voltage Domain configures verification.
- Parameters:
instance – [IN] VTM Voltage Domain instance
pConfig – [IN] Pointer to VTM VD configuration (optional)
- Returns:
The SDL error code for the API. If pConfig is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_verifyConfigTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig)
VTM Temperature sensor configures verification.
- Parameters:
instance – [IN] VTM Temperature sensor instance
pConfig – [IN] Pointer to VTM VD configuration (optional)
- Returns:
The SDL error code for the API. If pConfig is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_getStaticRegistersVd(SDL_VTM_InstVd instance, SDL_VTM_staticRegsVd *pStaticRegs)
VTM Voltage Domain readback Static configuration registers.
- Parameters:
instance – [IN] VTM Voltage Domain instance
pStaticRegs – [OUT] Pointer to VTM VD static register
- Returns:
The SDL error code for the API. If pStaticRegs is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
int32_t SDL_VTM_getStaticRegistersTs(SDL_VTM_InstTs instance, SDL_VTM_staticRegsTs *pStaticRegs)
VTM Temperature sensor readback Static configuration registers.
- Parameters:
instance – [IN] VTM Temperature sensor instance
pStaticRegs – [OUT] Pointer to VTM TS static register
- Returns:
The SDL error code for the API. If pStaticRegs is NULL: SDL_EBADARGS If instance is invalid: SDL_EBADARGS Success: SDL_PASS
-
struct SDL_VTM_configVd
- #include <sdl_vtm.h>
VTM Voltage Domain configuration.
This structure contains VTM Voltage Domain configuration
Public Members
-
SDL_VTM_configVdCtrl configVdCtrl
Valid control bit map the configuration
-
SDL_VTM_vid_opp vid_opp
VID OPP
-
uint8_t vid_opp_val
VID OPP value
-
SDL_VTM_vdEvtSel_set vd_temp_evts
VD Event selection
-
SDL_VTM_tsGlobal_cfg tsGlobal_cfg
Global configuration
-
SDL_VTM_configVdCtrl configVdCtrl
-
struct SDL_VTM_configTs
- #include <sdl_vtm.h>
VTM temperature sensor configuration.
This structure contains VTM temperature sensor configuration
Public Members
-
SDL_VTM_configTsCtrl configTsCtrl
Valid control bit map the configuration
-
SDL_VTM_Ctrlcfg tsCtrl_cfg
Temperature sensor control configuration
-
int32_t high_temp_in_milli_degree_celsius
Thermal shutdown range high value
-
int32_t low_temp_in_milli_degree_celsius
Thermal shutdown range low value
-
SDL_VTM_tsThrVal thr_val
Threshold value
-
SDL_VTM_configTsCtrl configTsCtrl
-
struct SDL_VTM_staticRegsVd
- #include <sdl_vtm.h>
VTM Static Registers for Voltage Domain.
This structure contains VTM static register for a given configuration The register values are not expected to change until a new configuration is done.
Public Members
-
uint32_t vtm_vd_evt_sel_ctrl
Voltage domain event selection control values
-
uint32_t vtm_vd_opp_vid
VTM OPP voltages
-
SDL_VTM_tsGlobal_cfg vtm_global_cfg
VTM global configuration configuration
-
uint32_t vtm_vd_evt_sel_ctrl
-
struct SDL_VTM_staticRegsTs
- #include <sdl_vtm.h>
VTM Static Registers for Temperature sensor.
This structure contains VTM static register for a given configuration The register values are not expected to change until a new configuration is done.
Defines
-
SDL_VTM_VD_CONFIG_CTRL_VID_OPP
-
SDL_VTM_VD_CONFIG_CTRL_EVT_SEL
-
SDL_VTM_VD_CONFIG_CTRL_GLB_CFG
-
SDL_VTM_VD_CONFIG_CTRL_SET_CTL
-
SDL_VTM_VD_CONFIG_CTRL_OUTRNG_ALRT
-
SDL_VTM_VD_CONFIG_CTRL_SET_THR
-
SDL_VTM_VD_CONFIG_CTRL_OUTRNG_ALRT_DISABLE
-
SDL_VTM_VID_OPP_MAX_NUM
Maximum number of OPP VID Codes
-
SDL_VTM_VID_OPP_3_CODE
VID OPP3 Code
-
SDL_VTM_VID_OPP_2_CODE
VID OPP2 Code
-
SDL_VTM_VID_OPP_1_CODE
VID OPP1 Code
-
SDL_VTM_VID_OPP_0_CODE
VID OPP0 Code
-
SDL_VTM_TS_STAT_VD_MAP_RTC
RTC Voltage Domain map
-
SDL_VTM_TS_STAT_VD_MAP_WKUP
WKUP Voltage Domain map
-
SDL_VTM_TS_STAT_VD_MAP_MCU
MCU Voltage Domain map
-
SDL_VTM_TS_STAT_VD_MAP_CORE
Core Voltage Domain map
-
SDL_VTM_TSTAT_VD_MAP_NOT_IMPLEMENTED
Voltage Domain map not implemented
-
SDL_VTM_VD_LT_THR0_INTR_RAW_SET
-
SDL_VTM_VD_GT_THR1_INTR_RAW_SET
-
SDL_VTM_VD_GT_THR2_INTR_RAW_SET
-
SDL_VTM_VD_LT_THR0_INTR_RAW_CLR
-
SDL_VTM_VD_GT_THR1_INTR_RAW_CLR
-
SDL_VTM_VD_GT_THR2_INTR_RAW_CLR
-
SDL_VTM_VD_LT_THR0_INTR_EN_SET
-
SDL_VTM_VD_GT_THR1_INTR_EN_SET
-
SDL_VTM_VD_GT_THR2_INTR_EN_SET
-
SDL_VTM_VD_LT_THR0_INTR_EN_CLR
-
SDL_VTM_VD_GT_THR1_INTR_EN_CLR
-
SDL_VTM_VD_GT_THR2_INTR_EN_CLR
-
SDL_VTM_VD_INTR_INVALID
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_0
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_1
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_2
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_3
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_4
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_5
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_6
-
SDL_VTM_VD_EVT_SELECT_TEMP_SENSOR_7
-
SDL_VTM_TSGLOBAL_CLK_SEL_VALID
-
SDL_VTM_TSGLOBAL_CLK_DIV_VALID
-
SDL_VTM_TSGLOBAL_ANY_MAXT_OUTRG_ALERT_EN_VALID
-
SDL_VTM_TSGLOBAL_MAXT_OUTRG_ALERT_THR0_VALID
-
SDL_VTM_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
-
SDL_VTM_TS_CTRL_SENSOR_RESET
-
SDL_VTM_TS_CTRL_SENSOR_NORM_OP
-
SDL_VTM_TS_CTRL_SINGLESHOT_MODE
-
SDL_VTM_TS_CTRL_CONTINUOUS_MODE
-
SDL_VTM_TS_CTRL_SINGLESHOT_ADC_CONV_IN_PROGRESS
-
SDL_VTM_TS_CTRL_SINGLESHOT_ADC_CONV_COMPLETE
-
SDL_VTM_GT_TH1_VALID
-
SDL_VTM_GT_TH2_VALID
-
SDL_VTM_LT_TH0_VALID
-
SDL_VTM_TS_READ_VD_MAP_VAL
-
SDL_VTM_TS_READ_ALL_THRESHOLD_ALERTS
-
SDL_VTM_TS_READ_FIRST_TIME_EOC_BIT
-
SDL_VTM_TS_READ_DATA_VALID_BIT
-
SDL_VTM_TS_READ_DATA_OUT_VAL
-
SDL_VTM_VD_EVT_STAT_THR_ALERTS_MASK
-
SDL_VTM_VD_EVT_STAT_LT_TH0_ALERT
-
SDL_VTM_VD_EVT_STAT_GT_TH1_ALERT
-
SDL_VTM_VD_EVT_STAT_GT_TH2_ALERT
Typedefs
-
typedef uint8_t SDL_VTM_configVdCtrl
This enumerator define forVTM VD configuration valid map.
-
typedef uint8_t SDL_VTM_configTsCtrl
This enumerator define for VTM TS configuration valid map.
-
typedef uint8_t SDL_VTM_vid_opp
This enumerator defines the possible VID Codes to set various voltage domain supply voltages.
-
typedef uint8_t SDL_VTM_ts_stat_vd_map
This enumerator defines the core voltage domain mapping of VTM VD.
-
typedef uint16_t SDL_VTM_intrCtrl
This enumerator define for VTM Voltage domain threshold interrupt control.
-
typedef uint16_t SDL_VTM_vdEvtSel_set
This enumerator define for VTM Voltage domain Event selection set.
-
typedef uint32_t SDL_VTM_tsGlobal_ctrl_valid_map
This enumerator defines for VTM Temperature sensor id control update valid maps. This controls the selective update of the fields in the temperature sensor control field.
-
typedef uint8_t SDL_VTM_tsGlobal_clkSel
This enumerator define for VTM Temperature sensor global control Clock select options.
-
typedef uint8_t SDL_VTM_tsGlobal_clkDiv
This enumerator define for VTM Temperature sensor global control Clock divide options.
-
typedef uint8_t SDL_VTM_tsGlobal_any_maxt_outrg_alert_en
This enumerator define for VTM Temperature sensor global control any max temperature alert enable control.
-
typedef uint16_t SDL_VTM_tsGlobal_samples_per_count
This enumerator define for VTM Temperature sensor global control samples per count.
-
typedef uint8_t SDL_VTM_tsCtrl_valid_map
This enumerator define for VTM Temperature sensor control valid map.
-
typedef uint8_t SDL_VTM_tsCtrl_max_outrg_alert
This enumerator define for VTM temperature sensor band gap maximum temperature out of range alert control.
-
typedef uint8_t SDL_VTM_tsCtrl_resetCtrl
This enumerator define for VTM temperature sensor band gap reset control bits.
-
typedef uint8_t SDL_VTM_tsCtrl_mode
This enumerator define for VTM temperature sensor mode control bits.
-
typedef uint8_t SDL_VTM_tsCtrl_singleshot_conv_stat
This enumerator define for VTM temperature sensor band gap single shot mode start of conversion trigger.
-
typedef uint8_t SDL_VTM_thr_valid_map
This enumerator define for VTM Temperature Sensor thresholds valid bit map.
-
typedef uint8_t SDL_VTM_Stat_read_ctrl
This enumerator define for VTM temperature sensor STAT read valid map.
-
typedef int16_t SDL_VTM_adc_code
This enumerator define for VTM temperature sensor ADC code This is the data_out value of the temperature sensor stat register.
-
typedef uint8_t SDL_VTM_vdEvt_status
This enumerator define for VTM Voltage domain event status.
Functions
-
void SDL_VTM_getSensorVDCount(const SDL_VTM_cfg1Regs *p_cfg1)
get sensor and VD count
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
-
SDL_VTM_adc_code SDL_VTM_getBestValue(SDL_VTM_adc_code c0, SDL_VTM_adc_code c1, SDL_VTM_adc_code c2)
select best ADC code
- Parameters:
c0 – [IN] ADC code 0
c1 – [IN] ADC code 1
c2 – [IN] ADC code 2
- Returns:
The SDL SDL_VTM_adc_code
-
SDL_VTM_adc_code SDL_VTM_getAdcCode(const SDL_VTM_cfg1Regs_TMPSENS *p_sensor)
read Temperature sensor ADC code
- Parameters:
p_sensor – [IN] Pointer to the sensor code
- Returns:
The SDL SDL_VTM_adc_code
-
int32_t SDL_VTM_vdSetOppVid(const SDL_VTM_cfg1Regs *p_cfg1, SDL_VTM_InstVd instance, SDL_VTM_vid_opp vid_opp, uint8_t vid_opp_val)
set the VID OPP Code for VID OPP register
Reset defaults are sourced from efuse for each OPP. The default reset values will not be necessarily overwritten. The write capability in the MMR is for having the option to debug and have software driven adjustments if necessary
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
instance – [IN] VTM Voltage Domain instance
vid_opp – [IN] which VID OPP to be updated
vid_opp_val – [IN] VID OPP Code value
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_vdGetOppVid(const SDL_VTM_cfg1Regs *p_cfg1, SDL_VTM_InstVd instance, SDL_VTM_vid_opp vid_opp, uint8_t *p_vid_opp_val)
get VTM VID OPP Code from VID OPP register
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
instance – [IN] VTM Voltage Domain instance
vid_opp – [IN] which VID OPP to be updated
p_vid_opp_val – [OUT] Pointer to VID OPP Code value
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_vdEvtSelSet(const SDL_VTM_cfg1Regs *p_cfg1, SDL_VTM_InstVd instance, SDL_VTM_vdEvtSel_set vd_temp_evts)
set Voltage domain a event select and control set register. In this API, select which of the event contributions of the temp-monitors controlled by this VTM will contribute to generate the merged event/alerts of this VD. Any combination of them could be selected
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
instance – [IN] VTM Voltage Domain instance
vd_temp_evts – [IN] Temperature events to be selected for VD
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsSetGlobalCfg(const SDL_VTM_cfg2Regs *p_cfg2, const SDL_VTM_tsGlobal_cfg *p_tsGlobal_cfg)
VTM Temperature Sensor Set Global configuration values.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
p_tsGlobal_cfg – [IN] Pointer to temperature global configuration
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsGetGlobalCfg(const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_tsGlobal_cfg *p_tsGlobal_cfg)
VTM Temperature Sensor Get Global configuration values.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
p_tsGlobal_cfg – [OUT] Pointer to temperature global configuration
- Returns:
The SDL error code for the API. Success : SDL_PASS Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsSetCtrl(const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_InstTs instance, const SDL_VTM_Ctrlcfg *p_tsCtrl_cfg)
VTM Temperature Sensor Control.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
instance – [IN] VTM Temperature sensor instance
p_tsCtrl_cfg – [IN] Pointer to temperature sensor control configuration
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsGetCtrl(const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_InstTs instance, SDL_VTM_Ctrlcfg *p_tsCtrl_cfg)
Read VTM Temperature Sensor Control.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
instance – [IN] VTM Temperature sensor instance
p_tsCtrl_cfg – [IN] Pointer to temperature sensor control configuration
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsSetThresholds(const SDL_VTM_cfg1Regs *p_cfg1, SDL_VTM_InstTs instance, const SDL_VTM_tsThrVal *p_thr_val)
VTM Temperature sensor set, clear threshold values and enable, disable threshold events.
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
instance – [IN] VTM Temperature sensor instance
p_thr_val – [IN] Pointer to temperature threshold values
- Returns:
The SDL error code for the API. Success : SDL_PASS Fail : SDL_EFAIL Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsGetThresholds(const SDL_VTM_cfg1Regs *p_cfg1, SDL_VTM_InstTs instance, SDL_VTM_tsThrVal *p_thr_val)
VTM Temperature Sensor get threshold values and threshold enable/disable status.
- Parameters:
p_cfg1 – [IN] Pointer to the VTM configuration1 structure
instance – [IN] VTM Temperature sensor instance
p_thr_val – [OUT] Pointer to temperature threshold values
- Returns:
The SDL error code for the API. Success : SDL_PASS Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsSetMaxTOutRgAlertThr(const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_InstTs instance, int32_t high_temp_in_milli_degree_celsius, int32_t low_temp_in_milli_degree_celsius)
VTM Temperature Sensor Maximum Temperature Out of Range Alert threshold.
This function sets the “high temperature threshold” and “low temperature threshold” alert thresholds for the VTM hardware to use in determining when to apply the device reset (and when to release it). When the temperatures are above the high threshold, a SoC reset would be done and gets released after the temperature falls below the low temperature threshold. There should not be any ISR (Interrupt Service Routine) need to program for maximum temperature out of range programming. The caller should have actively taken necessary cooling actions, prior to temperature reaching to this maximum value, with the help of GT_THR1 and/or GT_THR2 alert ISRs.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
instance – [IN] VTM Temperature sensor instance
high_temp_in_milli_degree_celsius – [IN] high temperature in milli degree celsius
low_temp_in_milli_degree_celsius – [IN] low temperature in milli degree celsius
- Returns:
The CSL error code for the API. Success : SDL_PASS Invalid Args : SDL_EBADARGS
-
int32_t SDL_VTM_tsSetMaxTOutRgAlertThrDisable(const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_InstTs instance)
VTM Temperature Sensor Maximum Temperature Out of Range Alert threshold.
This function disables the “high temperature threshold” and “low temperature threshold” alert thresholds for the VTM hardware.
- Parameters:
p_cfg2 – [IN] Pointer to the VTM configuration2 structure
instance – [IN] VTM Temperature sensor instance
- Returns:
The CSL error code for the API. Success: SDL_PASS Invalid Args: SDL_EBADARGS
-
struct SDL_VTM_tsGlobal_cfg
- #include <sdl_ip_vtm.h>
VTM Global Configuration Registers.
This structure contains VTM Global Configuration register.
Public Members
-
SDL_VTM_tsGlobal_ctrl_valid_map validMap
valid bit map for temperature sensor global control
-
SDL_VTM_tsGlobal_clkSel clkSel
Temperature sensor clock source selector. 0 = fix_ref_clk as source. 1 = fix_ref2_clk as source
-
SDL_VTM_tsGlobal_clkDiv clkDiv
Temperature sensor clock source divider selector. Default set by e-fuse or tie-off. Divider uses select reference clock as source. 0 = 1x divide. 1 = 2x divide. … 15 = 16x divide. … 63 = 64x divide.
-
SDL_VTM_tsGlobal_any_maxt_outrg_alert_en any_maxt_outrg_alert_en
This bit in VTM_MISC_CTRL register, when enable will cause, the VTM’s output therm_maxtemp_outrange_alert to be driven high, if any of the sources for the MAXT_OUTRG_ALERT, is set high.
-
SDL_VTM_adc_code maxt_outrg_alert_thr0
ADC code programmed in VTM_MISC_CTRL2 for the global max temperature out of range safe sample value. If the alert is enabled globally for the sensor, and the sensor reads a value <= this value, then the alert is cleared after being triggered
-
SDL_VTM_adc_code maxt_outrg_alert_thr
ADC code programmed in VTM_MISC_CTRL2 for the global max temperature out of range sample value. If the alert is enabled globally for the sensor, and the sensor reads a value >= this value, then the alert is triggered
-
SDL_VTM_tsGlobal_samples_per_count samplesPerCnt
Temperature sensor sample period count selector, programmed in VTM_SAMPLE_CTRL reg
-
SDL_VTM_tsGlobal_ctrl_valid_map validMap
-
struct SDL_VTM_Ctrlcfg
- #include <sdl_ip_vtm.h>
VTM temperature sensor band gap control.
This structure contains VTM temperature sensor control.
Public Members
-
SDL_VTM_tsCtrl_valid_map valid_map
Valid control map for temperature sensor control parameters
-
SDL_VTM_tsCtrl_max_outrg_alert maxt_outrg_alert_en
Enable out-of-range event. This bit enables generation of the alert in case the given temperature sensors generates a temp code above a programmed max
-
SDL_VTM_tsCtrl_resetCtrl tsReset
Temp-Monitor control to reset all Temp-monitor digital outputs or allow operation of sensor
-
SDL_VTM_tsCtrl_singleshot_conv_stat adc_stat
Temp-Monitor control: ADC Start of Conversion. A transition from 0 to 1 starts a new ADC conversion cycle. The bit will automatically clear when the conversion has completed. This mode is not valid when already in continuous mode.
-
SDL_VTM_tsCtrl_mode mode
Temp-Monitor control: ADC Continuous mode. Setting this mode enables the VTM to continuously monitor the sensor automatically
-
SDL_VTM_tsCtrl_valid_map valid_map
-
struct SDL_VTM_tsThrVal
- #include <sdl_ip_vtm.h>
VTM temperature sensor threshold values.
This structure contains VTM temperature sensor threshold values
Public Members
-
SDL_VTM_thr_valid_map thrValidMap
Valid control bit map the threshold
-
SDL_VTM_adc_code gtTh1
Over threshold value 1
-
bool gtTh1En
-
SDL_VTM_adc_code gtTh2
Over threshold value 2
-
bool gtTh2En
-
SDL_VTM_adc_code ltTh0
Under threshld value 0
-
bool ltTh0En
-
SDL_VTM_thr_valid_map thrValidMap
-
struct SDL_VTM_Stat_val
- #include <sdl_ip_vtm.h>
VTM temperature sensor Stat values.
This structure contains VTM temperature sensor Stat values
Public Members
-
SDL_VTM_ts_stat_vd_map vd_map
Indicates the core voltage domain placement of the temperature sensor. Device specific field. This field indicates in which core voltage domain, cVD, has been physically placed the temp-monitor. Valid values: 0x0 to 0xE where: 0x0 = VD_RTC, not present is some SOCs, 0x1 = VD_WKUP, 0x2 = VD_MCU, 0x3 = VD_CORE etc
-
uint8_t maxt_outrg_alert
This bit will be driven to a level 1 for a given temperature monitor if it has its corresponding bit maxt_outrg_en = 1, and the temperature reading is reporting to be outside the max temperature supported, temp > programmed value
-
uint8_t lt_th0_alert
reflects the status of the lt_th0_alert comparator result.
-
uint8_t gt_th1_alert
reflects the status of the gt_th1_alert comparator result
-
uint8_t gt_th2_alert
reflects the status of the gt_th2_alert comparator result
-
uint8_t soc_fc_update
ADC conversion status
-
uint8_t data_valid
Data valid bit after the adc is done
-
SDL_VTM_adc_code data_out
Data_out signal value from sensor: Temperature data from the ADC in monitor.
-
SDL_VTM_ts_stat_vd_map vd_map