]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - fx2lib/examples/fx2/scripts/fx2load
Import fx2lib into fx2lafw directly.
[sigrok-firmware-fx2lafw.git] / fx2lib / examples / fx2 / scripts / fx2load
diff --git a/fx2lib/examples/fx2/scripts/fx2load b/fx2lib/examples/fx2/scripts/fx2load
new file mode 100755 (executable)
index 0000000..b461c6b
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/env python
+
+# Copyright (C) 2009 Ubixum, Inc. 
+#
+# This library is free software; you can redistribute it and/or
+#
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+import optparse
+
+parser=optparse.OptionParser (usage="Usage: %prog [options] bixfile")
+parser.add_option( "-v", "--vid", type='int', default=0x04b4,help='Vendor ID (0x04b4)')
+parser.add_option( "-p", '--pid', type='int', default=0x0082,help='Product Id (0x0082)')
+
+opts,args=parser.parse_args()
+
+if len(args) < 1:
+    parser.error("Specify the path to your firmware bix file as the first argument")
+
+from fx2load import *
+openfx2(opts.vid,opts.pid)
+reset_bix(args[0])