Switchable diode effect and ferroelectric resistive switching in epitaxial BiFeO3 thin films | Synapse