Added command line processing, frequency calibration

Hi, I added command line processing, frequency calibration based on NTP, and several changes to the DMA control loop.

BR,
James