in my application, I have a lithium battery.
the system is powered when USB is pluging in and a specific IC charge the battery?
the IC charger has two differents set up: 1: limit the current at USB specifications (100 mA and 500mA after enumeration) and 2 :boost current more than 500mA (max 1800mA) when the USB cable is connect to a wall adapter.
I need to kown, when this two different stage happen
_ when enumeration is ok and USB port can send 500mA
_when the USB cable is connect to a wall adapter.
is there fonctions in the API of the USBFS component that can handle that.
Hi @ThBi_3905606 ,
When we connect our device to any powered device such as PC, it gets powered through VBUS. You can check whether the enumeration is done or not by using the API USBFS_GetConfiguration() which gets the current configuration of the USB device. The implementation of the code should be as the below image-
The MaxPower(mA) attribute in the configuration descriptor specifies the maximum possible current drawn(power consumption) by the USB device from the bus when the device is fully operational. You can set the value between 50mA to 500mA according to your application for this attribute. Please go through the USBFS component datasheet for details here : https://www.cypress.com/file/376416/download .
Since you have mentioned that current boost must be more than 500mA for set up 2, we would suggest it is not in accordance with the USB specifications. According to USB Spec, the current consumption by any USB device should be less than 500mA. You can check externally using a probe for the current more than 500mA.
Please go through the above and let us know in case of further queries.