A driver circuit includes a fly capacitor with a first end and a second end. The driver circuit includes a laser diode having an anode and a cathode. The driver circuit is configured to operate in first and second operating states. The anode is coupled to the first end of the fly capacitor. In the first operating state, the cathode is coupled to a first voltage supply node, the first end of the fly capacitor is coupled to a second voltage supply node, and the second end of the fly capacitor is coupled to a first reference terminal. In the second operating state, the cathode is coupled to a second reference terminal and decoupled from the first voltage supply node, the first end of the fly capacitor is decoupled from the second voltage supply node, and the second end of the fly capacitor is coupled to a third reference terminal.