lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * (C) Copyright 2016, ZIXC Corporation. |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | #ifndef __BOOT_CHARGE__ |
| 7 | #define __BOOT_CHARGE__ |
| 8 | |
| 9 | #include "common.h" |
| 10 | |
| 11 | enum charger_current |
| 12 | { |
| 13 | CHG_CURRENT_100 = 0, // 000 IUSB3 IUSB2 IUSB1 |
| 14 | CHG_CURRENT_500 = 1, // 001 |
| 15 | CHG_CURRENT_1500, // 010 |
| 16 | CHG_CURRENT_USB_SUSPEND, // 011 |
| 17 | CHG_CURRENT_150, // 100 |
| 18 | CHG_CURRENT_900, // 101 |
| 19 | CHG_CURRENT_800, // 110 |
| 20 | CHG_CURRENT_HIGH_IMPEDANCE, // 111 |
| 21 | MAX_CURRENT_SET /* 12 */ |
| 22 | }; |
| 23 | |
| 24 | enum charger_mode |
| 25 | { |
| 26 | CHG_MODE_NORMAL = 0, |
| 27 | CHG_MODE_HALF_CURRENT, // |
| 28 | CHG_MODE_VBAT_4_06, // |
| 29 | CHG_MODE_SUSPENDED, |
| 30 | MAX_CHG_MODE |
| 31 | }; |
| 32 | |
| 33 | |
| 34 | int low_battery_charging(uint32_t *is_start); |
| 35 | int power_off_battery_charging(void); |
| 36 | |
| 37 | //Åжϵ±Ç°ÊÇ·ñ´¦ÓÚ³äµç¹ý³ÌÖÐ |
| 38 | int charger_is_sustained(void); |
| 39 | |
| 40 | //ÉèÖóäµçµçÁ÷´óС |
| 41 | int32_t charger_set_usb_current(enum charger_current cur); |
| 42 | |
| 43 | //ÉèÖóäµçģʽ |
| 44 | int32_t set_charger_mod(enum charger_mode mode); |
| 45 | |
| 46 | //Åжϵ±Ç°ÊÇ·ñÓÐPC USB »ò ³äµçÆ÷ ÊÇ·ñ²åÈë |
| 47 | int detect_usb_online(void); |
| 48 | |
| 49 | //³õʼ»¯³äµçоƬ£¬²¢É趨³äµçµçÁ÷´óС |
| 50 | void usb_charger_init(void); |
| 51 | |
| 52 | //ÔÝÍ£³äµç |
| 53 | void usb_charger_suspend(void); |
| 54 | |
| 55 | |
| 56 | |
| 57 | #endif /* __BOOT_CHARGE__ */ |