A system drives one or plurality of LEDs regulating their brightness by
controlling LEDs average current or voltage. The system includes a
switching power converter and an integrated digital regulator with at
least one of electrical, thermal and optical feedbacks. The regulator is
constructed as a hysteretic peak current mode controller for continuous
mode of operation of the power converter. For discontinuous mode of
operation of the power converter a pulse averaging sliding mode control
is being used. Average LED current is measured by integrating LED pulse
current at off time and hysteretically adjusting on time of the power
switch. Input battery is protected from discharging at abnormally low
impedance of the output.