]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - fx2lib/examples/fx2/scripts/fx2load
Import fx2lib into fx2lafw directly.
[sigrok-firmware-fx2lafw.git] / fx2lib / examples / fx2 / scripts / fx2load
1 #!/bin/env python
2
3 # Copyright (C) 2009 Ubixum, Inc. 
4 #
5 # This library is free software; you can redistribute it and/or
6 #
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
20
21 import optparse
22
23 parser=optparse.OptionParser (usage="Usage: %prog [options] bixfile")
24 parser.add_option( "-v", "--vid", type='int', default=0x04b4,help='Vendor ID (0x04b4)')
25 parser.add_option( "-p", '--pid', type='int', default=0x0082,help='Product Id (0x0082)')
26
27 opts,args=parser.parse_args()
28
29 if len(args) < 1:
30     parser.error("Specify the path to your firmware bix file as the first argument")
31
32 from fx2load import *
33 openfx2(opts.vid,opts.pid)
34 reset_bix(args[0])