6621CGc,6621Cqc 都自带锂电池(4.2V)充电管理,客户使用中经常遇到不知道怎样下手使用,今天介绍下如何使用我们充电功能 1)充电脚硬件接口是VBAT_CHG,此脚接锂电池+极,VBUS是+5V输入脚 2)充电状态有直接的接口可以获得如下 if(PMU_CHARGE_EXTRACT == pmu_charge_status()) { log_debug("pmu_charge_status CHARGING to EXTRACT\n");//未插充电 } else if(PMU_CHARGE_CHARGING == pmu_charge_status()) { log_debug("pmu_charge_status EXTRACT to CHARGING\n");//充电中 } else if(PMU_CHARGE_COMPLETE == pmu_charge_status()) { log_debug("pmu_charge_status PMU_CHARGE_COMPLETE\n");//在充电并且充满 } 3)VBAT脚电压 uint16_t voltage_chage_mV = 0; voltage_chage_mV = adc_battery_voltage_read_by_single_pin(ADC_CHANNEL_CHIP_BATTERY, ADC_PGA_GAIN_0P5, NULL, 10); log_debug("\nVCC_VBAT volt_0=%d", voltage_chage_mV); 打印输出 4)VBAT_CHG脚电压 uint16_t voltage_chage_mV = 0; voltage_chage_mV = 3*adc_battery_voltage_read_by_single_pin(ADC_CHANNEL_VCC_VBAT_CHG, ADC_PGA_GAIN_0P5, NULL, 10); log_debug("\nVCC_VBAT_CHG volt_0=%d", voltage_chage_mV); |