Lateral bipolar transistor in combination with diodes, or capacitors, or resistors