I'm working on a battery powered device with embedded USB. The device has a Li+ battery charger, and I wish to both power the device and charge the battery when it's plugged into a powered USB port on a computer. My understanding is that I can draw up to 500mA of current in this way (assuming its not a hub).
I'd also like the option of powering this device from an AC power adapter with a mini usb plug on one end (commonly seen on cell phone wall adapters). When powering the device from a wall adapter I could potentially draw much more current to more quickly charge the battery.
My question is: If there's only one USB interface on my device, how can I determine if it's plugged into a wall adapter or a computer? And then make a determination on how much current I can draw? The wall adapter I imagine is a dumb device, and unable to report its current capabilities.
I know many battery charger IC's have a power path capable of switching between two seperate power interfaces: A DC wall adapter input and a seperate USB plug. I'd rather not have two seperate power interfaces though. Just the one mini USB plug.
Thanks for your suggestions.