Circuitry for powering a load and charging of a battery from a power
source by a smart power supply is provided. The smart power supply
controls the maximum current for battery charging based in part upon
variables such as the maximum rate of charge of the battery and maximum
source current. The smart power supply is thus capable of providing the
power requested by the load, and use the remaining power for battery
charging.