I want to charge a single lithium-ion cell from a current-limited voltage source. My "black box" (or rather, it's white -- with a question mark inside) has inputs of ~250mA @ [3.7V to 5.4V], and target output (i.e., the lithium-ion cell) of 3.2V to Vch = 4.2V. Which means: I can't charge the battery at the low end of the input voltage range with a simple linear or buck type charger, and a boost type of charger will not work at the high end of the input range. Since the output voltage range can be greater or less than the input, I've thought about building a SEPIC converter which could be controlled with a PWM driver and, e.g., a uC. However, I have little experience (and time..) with the ins and outs of SMPS, so I wonder if I would be shooting myself in the foot with this idea. Ideally, there would be a lonely IC sitting out there somewhere waiting for me to find it, but I've had no such luck in my searches yet. Any ideas?