The gating cycle of a K+ channel at atomic resolution