An implantable neural interface with electromagnetic stimulation capabilities