Two-terminal p–n diodes are fundamental components in many electronic and optoelectronic systems. However, their defining characteristics limit them to single-function devices, and methods to achieve ...