Patent ID: 7898222

Claim:
A battery charger, comprising: a first port configured to be coupled to a first power supply; a second port configured to be coupled to a battery; a first transistor coupled between the first port and the second port; a first resistor coupled between the first port and a control terminal of the first transistor; a second transistor coupled between the control terminal of the first transistor and ground; a third transistor coupled to the second transistor to form a first current mirror; a fourth transistor coupled between a third port and the third transistor, wherein the third port is configured to be coupled to a second power supply; a fifth transistor coupled to the fourth transistor to foam a second current mirror; a second resistor coupled to the fifth transistor at a node, the second resistor having a variable resistance; a first operational amplifier configured to compare a voltage at the node with a first reference voltage and to produce a voltage at a control terminal of the fifth transistor; a third resistor coupled between the first transistor and the second port; a differential amplifier configured to compare a voltage drop across the third resistor with a second reference voltage and to produce a control signal; and a controller configured to receive the control signal and to control the variable resistance.