本文整理汇总了C++中GETARRAYNUM函数的典型用法代码示例。如果您正苦于以下问题:C++ GETARRAYNUM函数的具体用法?C++ GETARRAYNUM怎么用?C++ GETARRAYNUM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GETARRAYNUM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: charging_set_current
static kal_uint32 charging_set_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 set_chr_current;
kal_uint32 array_size;
kal_uint32 register_value;
kal_uint32 current_value = *(kal_uint32 *)data;
if(current_value <= CHARGE_CURRENT_350_00_MA)
{
fan5405_set_io_level(1);
}
else
{
fan5405_set_io_level(0);
array_size = GETARRAYNUM(CS_VTH);
set_chr_current = bmt_find_closest_level(CS_VTH, array_size, current_value);
register_value = charging_parameter_to_value(CS_VTH, array_size ,set_chr_current);
if(register_value > 6)
{
register_value = 6;
}
fan5405_set_iocharge(register_value);
}
return status;
}
示例2: charging_set_input_current
static kal_uint32 charging_set_input_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 current_value = *(kal_uint32 *)data;
kal_uint32 set_chr_current;
kal_uint32 array_size;
kal_uint32 register_value;
if(current_value >= CHARGE_CURRENT_2500_00_MA)
{
register_value = 0x6;
}
else if(current_value == CHARGE_CURRENT_1000_00_MA)
{
register_value = 0x4;
}
else
{
array_size = GETARRAYNUM(INPUT_CS_VTH);
set_chr_current = bmt_find_closest_level(INPUT_CS_VTH, array_size, current_value);
register_value = charging_parameter_to_value(INPUT_CS_VTH, array_size ,set_chr_current);
}
bq24261_set_in_limit(register_value);
return status;
}
示例3: charging_set_input_current
static kal_uint32 charging_set_input_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 set_chr_current;
kal_uint32 array_size;
kal_uint32 register_value;
if(*(kal_uint32 *)data > CHARGE_CURRENT_500_00_MA)
{
/*lenovo-sw weiweij modified for changing input current to 3A*/
register_value = 0x7;
/*lenovo-sw weiweij modified for changing input current to 3A end*/
}
/* else if(*data==CHARGE_CURRENT_MAX)
{
register_value = 0x6;
}*/
else
{
array_size = GETARRAYNUM(INPUT_CS_VTH);
set_chr_current = bmt_find_closest_level(INPUT_CS_VTH, array_size, *(kal_uint32 *)data);
register_value = charging_parameter_to_value(INPUT_CS_VTH, array_size ,set_chr_current);
}
bq24250_set_iinlim(register_value);
return status;
}
示例4: charging_set_cv_voltage
static kal_uint32 charging_set_cv_voltage(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint16 register_value;
register_value = charging_parameter_to_value(VBAT_CV_VTH, GETARRAYNUM(VBAT_CV_VTH) ,*(kal_uint32 *)(data));
fan5405_set_oreg(register_value);
return status;
}
示例5: charging_get_current
static kal_uint32 charging_get_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 array_size;
array_size = GETARRAYNUM(CS_VTH);
*(kal_uint32 *)data = bmt_find_closest_level(CS_VTH, array_size, *(kal_uint32 *)data);
return status;
}
示例6: bmt_get_the_less_nearest_current
static DCL_STATUS bmt_get_the_less_nearest_current(void *data)
{
DCL_STATUS status = STATUS_OK;
DCL_UINT32 array_size;
array_size = GETARRAYNUM(chr_CS_VTH);
*(DCL_UINT32 *)data = bmt_find_closest_level(chr_CS_VTH, array_size, *(DCL_UINT32 *)data);
return status;
}
示例7: charging_set_cv_voltage
static kal_uint32 charging_set_cv_voltage(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint16 register_value;
static kal_int16 pre_register_value = -1;
register_value = charging_parameter_to_value(VBAT_CV_VTH, GETARRAYNUM(VBAT_CV_VTH) ,*(kal_uint32 *)(data));
#if 0
//bq24261_set_vbreg(0x14);
bq24261_set_vbreg(register_value);
#else
//PCB workaround
if(mt6325_upmu_get_swcid() == PMIC6325_E1_CID_CODE)
{
#if defined(CV_E1_INTERNAL)
bq24261_set_vbreg(0x19);
#else
bq24261_set_vbreg(0xF);
#endif
battery_xlog_printk(BAT_LOG_CRTI,"[charging_set_cv_voltage] set low CV by 6325 E1\n");
}
else
{
if(is_mt6311_exist())
{
if(mt6311_get_chip_id()==PMIC6311_E1_CID_CODE)
{
#if defined(CV_E1_INTERNAL)
bq24261_set_vbreg(0x19);
#else
bq24261_set_vbreg(0xF);
#endif
battery_xlog_printk(BAT_LOG_CRTI,"[charging_set_cv_voltage] set low CV by 6311 E1\n");
}
else
{
if (pre_register_value != register_value) {
battery_xlog_printk(BAT_LOG_CRTI,"[charging_set_cv_voltage] disable charging\n");
bq24261_set_dis_ce(1);
}
bq24261_set_vbreg(register_value);
if (pre_register_value != register_value)
bq24261_set_dis_ce(0);
pre_register_value = register_value;
}
}
else
{
bq24261_set_vbreg(register_value);
}
}
#endif
return status;
}
示例8: charging_get_current
static kal_uint32 charging_get_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 array_size;
kal_uint32 reg_value;
array_size = GETARRAYNUM(CS_VTH);
reg_value=pmic_get_register_value(PMIC_RG_CS_VTH);//RG_CS_VTH
*(kal_uint32 *)data = charging_value_to_parameter(CS_VTH,array_size,reg_value);
return status;
}
示例9: charging_set_cv_voltage
static kal_uint32 charging_set_cv_voltage(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint16 register_value;
register_value = charging_parameter_to_value(VBAT_CV_VTH, GETARRAYNUM(VBAT_CV_VTH) ,*(kal_uint32 *)(data));
cv_voltage=VBAT_CV_VTH[register_value];
/*
#if 0
mt6325_upmu_set_rg_vbat_cv_vth(register_value);
#else
//PCB workaround
if(mt6325_upmu_get_swcid() == PMIC6325_E1_CID_CODE)
{
pmic_config_interface(0xEFE,0x0,0xF,1); // [4:1]: RG_VBAT_OV_VTH; Set charger OV=3.9V
pmic_config_interface(0xEF8,0x3,0x3F,0); // [5:0]: RG_VBAT_CV_VTH; Set charger CV=3.8V
battery_log(BAT_LOG_CRTI,"[charging_set_cv_voltage] set low CV by 6325 E1\n");
}
else
{
if(is_mt6311_exist())
{
if(mt6311_get_chip_id()==PMIC6311_E1_CID_CODE)
{
pmic_config_interface(0xEFE,0x0,0xF,1); // [4:1]: RG_VBAT_OV_VTH; Set charger OV=3.9V
pmic_config_interface(0xEF8,0x3,0x3F,0); // [5:0]: RG_VBAT_CV_VTH; Set charger CV=3.8V
battery_log(BAT_LOG_CRTI,"[charging_set_cv_voltage] set low CV by 6311 E1\n");
}
else
{
mt6325_upmu_set_rg_vbat_cv_vth(register_value);
}
}
else
{
mt6325_upmu_set_rg_vbat_cv_vth(register_value);
}
}
#endif
*/
pmic_set_register_value(PMIC_RG_VBAT_CV_VTH,register_value);
battery_log(BAT_LOG_CRTI,"[charging_set_cv_voltage] [0x%x]=0x%x, [0x%x]=0x%x\n",
0xf54, upmu_get_reg_value(0xf54),
0xf4e, upmu_get_reg_value(0xf4e)
);
return status;
}
示例10: charging_get_current
static kal_uint32 charging_get_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 array_size;
kal_uint8 reg_value;
//Get current level
array_size = GETARRAYNUM(CS_VTH);
bq24261_read_interface(bq24261_CON4, ®_value, 0x1F, 3); //ICHG to BAT
*(kal_uint32 *)data = charging_value_to_parameter(CS_VTH,array_size,reg_value);
return status;
}
示例11: charging_get_current
static kal_uint32 charging_get_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 array_size;
kal_uint8 reg_value;
//Get current level
array_size = GETARRAYNUM(CS_VTH);
fan5405_read_interface(0x1, ®_value, 0x3, 0x6); //IINLIM
*(kal_uint32 *)data = charging_value_to_parameter(CS_VTH,array_size,reg_value);
return status;
}
示例12: bmt_find_and_set_the_nearest_current
static DCL_STATUS bmt_find_and_set_the_nearest_current(void *data)
{
DCL_STATUS status = STATUS_OK;
DCL_UINT32 set_chr_current;
DCL_UINT32 array_size;
DCL_UINT16 register_value;
array_size = GETARRAYNUM(chr_CS_VTH);
set_chr_current = bmt_find_closest_level(chr_CS_VTH, array_size, *(DCL_UINT32 *)data);
register_value = bmt_parameter_to_value(chr_CS_VTH, array_size ,set_chr_current);
status = bmt_set_register_value(RG_CS_VTH_OFFSET,RG_CS_VTH_MASK,register_value<<RG_CS_VTH_SHIFT);
return status;
}
示例13: charging_set_current
static kal_uint32 charging_set_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 set_chr_current;
kal_uint32 array_size;
kal_uint32 register_value;
array_size = GETARRAYNUM(CS_VTH);
set_chr_current = bmt_find_closest_level(CS_VTH, array_size, *(kal_uint32 *)data);
register_value = charging_parameter_to_value(CS_VTH, array_size ,set_chr_current);
pmic_set_register_value(PMIC_RG_CS_VTH,register_value);
return status;
}
示例14: charging_set_hv_threshold
static kal_uint32 charging_set_hv_threshold(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 set_hv_voltage;
kal_uint32 array_size;
kal_uint16 register_value;
kal_uint32 voltage = *(kal_uint32*)(data);
array_size = GETARRAYNUM(VCDT_HV_VTH);
set_hv_voltage = bmt_find_closest_level(VCDT_HV_VTH, array_size, voltage);
register_value = charging_parameter_to_value(VCDT_HV_VTH, array_size ,set_hv_voltage);
mt6325_upmu_set_rg_vcdt_hv_vth(register_value);
return status;
}
示例15: charging_set_current
static kal_uint32 charging_set_current(void *data)
{
kal_uint32 status = STATUS_OK;
kal_uint32 set_chr_current;
kal_uint32 array_size;
kal_uint32 register_value;
kal_uint32 current_value = *(kal_uint32 *)data;
array_size = GETARRAYNUM(CS_VTH);
set_chr_current = bmt_find_closest_level(CS_VTH, array_size, current_value);
register_value = charging_parameter_to_value(CS_VTH, array_size ,set_chr_current);
bq24196_set_ichg(register_value);
return status;
}