suppose you have some analog smps ic that drives power electronics needed, the smps switch uses somewhere a reference for its internal control loop. The trick is to vary this reference with a micro controller.
For this strategy, you need an smps design that has an external reference input. And if possible for both voltage and current. If I may refer back to my post about using the TL494 (very old chip, ...), if you look into some datasheets and application notes, you will find some possibilities to make a voltage and current controlled system. There are two control loops, one for current, and one for voltage, both control loops are tied together with a diode, so the lowest request wins the game (voltage regulation or current regulation). You can best compare it to a proper bench top power supply that has a maximum voltage and a maximum current regulation knob.
If you first make a design that fully works in all desired conditions with only the power stage hooked up (by setting the reference voltage with potentiometers, ...), you can start thinking on adding the micro-controller for the battery-charging process. The micro also has to measure the momentary output current and voltage, and can decide what to do with the references for the desired maximum current and voltage.
Since the micro controller does not have to do high speed duty-cycle settings, but only some slow-changing reference values, the reference can be made with a PWM-output from the micro controller. Hook up an appropriate RC to the micro controllers PWM/Timer peripheral and there the reference is.
Stefaan