Fermi energy pinning at the surface during growth of n- and p-type GaAs