Electroluminescence and photo-response of inorganic halide perovskite bi-functional diodes