Physics of a-Si:H switching diodes