AM62Ax MCU+ SDK  08.06.00
VTM IP Functions

Introduction

Functions

void SDL_VTM_getSensorVDCount (const SDL_VTM_cfg1Regs *p_cfg1)
 get sensor and VD count More...
 
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 More...
 
SDL_VTM_adc_code SDL_VTM_getAdcCode (const SDL_VTM_cfg1Regs_TMPSENS *p_sensor)
 read Temperature sensor ADC code More...
 
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 More...
 
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 More...
 
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 More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int32_t SDL_VTM_tsConvADCToTemp (SDL_VTM_adc_code adc_code, SDL_VTM_InstTs instance, int32_t *p_milli_degree_temp_val)
 VTM Temperature ADC code to Temperature conversion. More...
 
int32_t SDL_VTM_tsConvTempToAdc (int32_t milli_degree_temp_val, SDL_VTM_InstTs instance, SDL_VTM_adc_code *p_adc_code)
 VTM Temperature to ADC code conversion. More...
 
int32_t SDL_VTM_tsSetMaxTOutRgAlertThr (const SDL_VTM_cfg2Regs *p_cfg2, SDL_VTM_InstTs instance, int32_t high_temp_in_milli_degree_celcius, int32_t low_temp_in_milli_degree_celcius)
 VTM Temperature Sensor Maximum Temperature Out of Range Alert threshold. More...
 

Function Documentation

◆ SDL_VTM_getSensorVDCount()

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_getBestValue()

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_getAdcCode()

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

◆ SDL_VTM_vdSetOppVid()

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

◆ SDL_VTM_vdGetOppVid()

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

◆ SDL_VTM_vdEvtSelSet()

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

◆ SDL_VTM_tsSetGlobalCfg()

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

◆ SDL_VTM_tsGetGlobalCfg()

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

◆ SDL_VTM_tsSetCtrl()

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

◆ SDL_VTM_tsGetCtrl()

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

◆ SDL_VTM_tsSetThresholds()

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

◆ SDL_VTM_tsGetThresholds()

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

◆ SDL_VTM_tsConvADCToTemp()

int32_t SDL_VTM_tsConvADCToTemp ( SDL_VTM_adc_code  adc_code,
SDL_VTM_InstTs  instance,
int32_t *  p_milli_degree_temp_val 
)

VTM Temperature ADC code to Temperature conversion.

Parameters
adc_code[IN] 10 Bit ADC code
instance[IN] VTM Temperature sensor instance
p_milli_degree_temp_val[OUT] Pointer to Temperature in milli degree celcius
Returns
The SDL error code for the API. Success : SDL_PASS Invalid Args : SDL_EBADARGS

◆ SDL_VTM_tsConvTempToAdc()

int32_t SDL_VTM_tsConvTempToAdc ( int32_t  milli_degree_temp_val,
SDL_VTM_InstTs  instance,
SDL_VTM_adc_code p_adc_code 
)

VTM Temperature to ADC code conversion.

Parameters
milli_degree_temp_val[IN] Temperature in milli degree celcius
instance[IN] VTM Temperature sensor instance
p_adc_code[OUT] Pointer to 10 Bit ADC code
Returns
The SDL error code for the API. Success : SDL_PASS Invalid Args : SDL_EBADARGS

◆ SDL_VTM_tsSetMaxTOutRgAlertThr()

int32_t SDL_VTM_tsSetMaxTOutRgAlertThr ( const SDL_VTM_cfg2Regs p_cfg2,
SDL_VTM_InstTs  instance,
int32_t  high_temp_in_milli_degree_celcius,
int32_t  low_temp_in_milli_degree_celcius 
)

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_celcius[IN] high temperature in milli degree celcius
low_temp_in_milli_degree_celcius[IN] low temperature in milli degree celcius
Returns
The CSL error code for the API. Success : CSL_PASS Invalid Args : CSL_EBADARGS