📄 _csl_pscpdstatecfg.c
字号:
#include <csl_pscAux.h>
#pragma CODE_SECTION (CSL_pscPdStateCfg, ".text:csl_section:psc");
CSL_Status CSL_pscPdStateCfg(
CSL_PscHandle hPsc,
CSL_PscPdCfg pdCfg
){
CSL_Status status = CSL_SOK;
Uint16 i;
/* If numPds is zero, configure no Power Domains and return CSL_SOK */
if( pdCfg.numPds == 0 ){
return (CSL_SOK);
}
/* If the number of Power Domains parameter is greater than CSL_PSC_NUM_PD then return error code */
if( pdCfg.numPds > CSL_PSC_NUM_PD ){
return (CSL_ESYS_INVPARAMS);
}
/* Update the Power Domain states */
for( i = 0; i < pdCfg.numPds; i++ ){
if( pdCfg.pdId[i] == CSL_PSC_PD_ALWAYSON ){
/* Check if software is attempting to turn-off the ALWAYSON Domain */
if( pdCfg.pdState[i] == CSL_PSC_PD_STATE_OFF ){
return CSL_ESYS_INVPARAMS; /* You cannot turn-off the ALWAYSON Power Domain */
}
}
/* Update the DSP Power Domain state */
if( pdCfg.pdId[i] == CSL_PSC_PD_DSP ){
status = CSL_pscPdDspPwrOnOff(hPsc, pdCfg.pdState[i] );
}
/* Update the PD state record array if not NULL */
if( pdCfg.pdStateRecord != NULL ){
pdCfg.pdStateRecord[pdCfg.pdId[i]] = pdCfg.pdState[i];
}
}
return (status);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -