DS2417 lib

functions extracted to lib