Import code from pyftdi project