Photosensitization and photocurrent switching effects in wide band gap semiconductors: CuI and TiO2 functionalized with iron and nickel complexes: from semiconductors to logic devices