mt2503 60 ISINK单独控制sample code
时间:10-02
整理:3721RD
点击:
需要屏蔽原uem_GPIO.c中的背光函数
换成如下API
以ISINK0设为最大电流值为例,调用方法为
custom_bl_enable((PMU_ISINK_LIST_ENUM)0,DCL_TRUE,(PMU_CTRL_ISINK_STEP_ENUM)ISINK_STEP_4
8_MA);
custom_bl_enable(PMU_ISINK_LIST_ENUM i,DCL_BOOL enable, PMU_CTRL_ISINK_STEP_ENUM step)
{
PMU_CTRL_ISINK_SET_STEP_DOUBLE IsinkSetStepDouble;
PMU_CTRL_ISINK_STEP_ENUM isink_step;
DCL_UINT16 val;
DCL_HANDLE handle;
handle = DclPMU_Open(DCL_PMU, FLAGS_NONE);
pmu6260_cust_isink_en = enable;
pmu_cust_isink_step = step;
if (pmu6260_cust_isink_en)
{
// set isink double bit
if (pmu_cust_isink_step > ISINK_STEP_24_MA)
{
IsinkSetStepDouble.isink = (PMU_ISINK_LIST_ENUM)i;
IsinkSetStepDouble.enable = DCL_TRUE;;
dcl_pmu6260_control_handler(handle, ISINK_SET_STEP_DOUBLE, (DCL_CTRL_DATA_T
*)&IsinkSetStepDouble);
}
else
{
IsinkSetStepDouble.isink = (PMU_ISINK_LIST_ENUM)i;
IsinkSetStepDouble.enable = DCL_FALSE;
dcl_pmu6260_control_handler(handle, ISINK_SET_STEP_DOUBLE, (DCL_CTRL_DATA_T
*)&IsinkSetStepDouble);
}
// set isink step
if (pmu_cust_isink_step > ISINK_STEP_24_MA)
{
isink_step = (PMU_CTRL_ISINK_STEP_ENUM)(pmu_cust_isink_step >> 1);
}
else
{
isink_step = pmu_cust_isink_step;
}
val=PMU_Parameter_to_Value(ENC(ISINK_SET_STEP, ALLMOD), isink_step);
if (val!=PARAMETER_UNKNOWN)
pmu_set_isink((PMU_ISINK_LIST_ENUM)i, ISINK_STEP, val);
}
// set isink enable
pmu_set_isink((PMU_ISINK_LIST_ENUM)i,ISINK_EN,(DCL_UINT32)enable);
DclPMU_Close(handle);
}
换成如下API
以ISINK0设为最大电流值为例,调用方法为
custom_bl_enable((PMU_ISINK_LIST_ENUM)0,DCL_TRUE,(PMU_CTRL_ISINK_STEP_ENUM)ISINK_STEP_4
8_MA);
custom_bl_enable(PMU_ISINK_LIST_ENUM i,DCL_BOOL enable, PMU_CTRL_ISINK_STEP_ENUM step)
{
PMU_CTRL_ISINK_SET_STEP_DOUBLE IsinkSetStepDouble;
PMU_CTRL_ISINK_STEP_ENUM isink_step;
DCL_UINT16 val;
DCL_HANDLE handle;
handle = DclPMU_Open(DCL_PMU, FLAGS_NONE);
pmu6260_cust_isink_en = enable;
pmu_cust_isink_step = step;
if (pmu6260_cust_isink_en)
{
// set isink double bit
if (pmu_cust_isink_step > ISINK_STEP_24_MA)
{
IsinkSetStepDouble.isink = (PMU_ISINK_LIST_ENUM)i;
IsinkSetStepDouble.enable = DCL_TRUE;;
dcl_pmu6260_control_handler(handle, ISINK_SET_STEP_DOUBLE, (DCL_CTRL_DATA_T
*)&IsinkSetStepDouble);
}
else
{
IsinkSetStepDouble.isink = (PMU_ISINK_LIST_ENUM)i;
IsinkSetStepDouble.enable = DCL_FALSE;
dcl_pmu6260_control_handler(handle, ISINK_SET_STEP_DOUBLE, (DCL_CTRL_DATA_T
*)&IsinkSetStepDouble);
}
// set isink step
if (pmu_cust_isink_step > ISINK_STEP_24_MA)
{
isink_step = (PMU_CTRL_ISINK_STEP_ENUM)(pmu_cust_isink_step >> 1);
}
else
{
isink_step = pmu_cust_isink_step;
}
val=PMU_Parameter_to_Value(ENC(ISINK_SET_STEP, ALLMOD), isink_step);
if (val!=PARAMETER_UNKNOWN)
pmu_set_isink((PMU_ISINK_LIST_ENUM)i, ISINK_STEP, val);
}
// set isink enable
pmu_set_isink((PMU_ISINK_LIST_ENUM)i,ISINK_EN,(DCL_UINT32)enable);
DclPMU_Close(handle);
}