Self-calibration and digital-trimming of successive approximation analog-to-digital converters