Line 31... |
Line 31... |
31 |
"port": port, |
31 |
"port": port, |
32 |
}, |
32 |
}, |
33 |
bus = [ |
33 |
bus = [ |
34 |
{ |
34 |
{ |
35 |
"type": "i2chub", |
35 |
"type": "i2chub", |
36 |
"address": 0x72, |
36 |
"address": 0x70, |
37 |
"children": [ |
37 |
"children": [ |
38 |
{ "name":"clkgen", "type":"clkgen01", "channel": 7, }, |
38 |
{ "name":"clkgen", "type":"clkgen01", "channel": 1, }, |
39 |
], |
39 |
], |
40 |
}, |
40 |
}, |
41 |
], |
41 |
], |
42 |
) |
42 |
) |
43 |
cfg.initialize() |
43 |
cfg.initialize() |
44 |
|
44 |
|
45 |
fgen = cfg.get_device("clkgen") |
45 |
fgen = cfg.get_device("clkgen") |
46 |
sys.stdout.write("Frequency will be set to " + sys.argv[2] + " MHz.\r\n") |
46 |
sys.stdout.write("Frequency will be set to " + sys.argv[2] + " MHz.\r\n") |
47 |
|
- |
|
48 |
time.sleep(3) |
- |
|
49 |
fgen.route() |
47 |
fgen.route() |
- |
|
48 |
time.sleep(3) |
50 |
fgen.reset() # Reset Si570 to 10 MHz |
49 |
fgen.recall_nvm() # Reload settings for 10 MHz |
51 |
time.sleep(3) |
50 |
time.sleep(3) |
52 |
fgen = cfg.get_device("clkgen") # Reopen CP2112 |
51 |
fgen = cfg.get_device("clkgen") # Reopen CP2112 |
53 |
fgen.set_freq(10., float(eval(sys.argv[2]))) # Set frequency |
52 |
fgen.set_freq(10., float(eval(sys.argv[2]))) # Set frequency |
54 |
sys.stdout.write("Done.\r\n") |
53 |
sys.stdout.write("Done.\r\n") |
55 |
sys.stdout.flush() |
54 |
sys.stdout.flush() |