Electrical properties and switching mechanisms of flexible organic-inorganic bistable devices