當前位置: 首頁>>代碼示例>>C++>>正文


C++ GETARRAYNUM函數代碼示例

本文整理匯總了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;
 } 	
開發者ID:Jlsmily,項目名稱:android_kernel_meilan2,代碼行數:26,代碼來源:charging_hw_fan5405.c

示例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;
}     
開發者ID:djun,項目名稱:m463,代碼行數:27,代碼來源:charging_hw_bq24261.c

示例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;
 } 	
開發者ID:AudioGod,項目名稱:MediaTek-HelioX10-Kernel,代碼行數:28,代碼來源:charging_hw_bq24250.c

示例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;
 } 	
開發者ID:yangxianting,項目名稱:mediatek,代碼行數:10,代碼來源:charging_hw_fan5405.c

示例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;
}  
開發者ID:JustAndroids,項目名稱:ZTEBladeL2,代碼行數:10,代碼來源:charging_hw_6333.c

示例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;
}
開發者ID:WayWingsDev,項目名稱:testmywatch,代碼行數:10,代碼來源:bmt_bl_chr_setting.c

示例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;
}     
開發者ID:djun,項目名稱:m463,代碼行數:55,代碼來源:charging_hw_bq24261.c

示例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;
}  
開發者ID:Jlsmily,項目名稱:android_kernel_meilan2,代碼行數:12,代碼來源:charging_hw_pmic.c

示例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;
}     
開發者ID:Jlsmily,項目名稱:android_kernel_meilan2,代碼行數:52,代碼來源:charging_hw_pmic.c

示例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, &reg_value, 0x1F, 3); //ICHG to BAT
    *(kal_uint32 *)data = charging_value_to_parameter(CS_VTH,array_size,reg_value);
   
    return status;
}  
開發者ID:djun,項目名稱:m463,代碼行數:13,代碼來源:charging_hw_bq24261.c

示例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, &reg_value, 0x3, 0x6);	//IINLIM
    *(kal_uint32 *)data = charging_value_to_parameter(CS_VTH,array_size,reg_value);
	
    return status;
 }  
開發者ID:yangxianting,項目名稱:mediatek,代碼行數:13,代碼來源:charging_hw_fan5405.c

示例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;
}
開發者ID:WayWingsDev,項目名稱:testmywatch,代碼行數:14,代碼來源:bmt_bl_chr_setting.c

示例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;
}     
開發者ID:Jlsmily,項目名稱:android_kernel_meilan2,代碼行數:14,代碼來源:charging_hw_pmic.c

示例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;
}
開發者ID:John677,項目名稱:Kernal_k3note,代碼行數:15,代碼來源:charging_hw_bq24196.c

示例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;
} 	
開發者ID:John677,項目名稱:Kernal_k3note,代碼行數:15,代碼來源:charging_hw_bq24196.c


注:本文中的GETARRAYNUM函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。