Automatic characterization of silicon single-photon avalanche photodiode