12,6 → 12,10 |
import sys |
from pymlab import config |
|
import logging |
logging.basicConfig(level=logging.DEBUG) |
|
|
#### Script Arguments ############################################### |
|
if (len(sys.argv) != 3): |
23,13 → 27,15 |
#### Sensor Configuration ########################################### |
|
cfg = config.Config( |
port = port, |
i2c = { |
"port": port, |
}, |
bus = [ |
{ |
"type": "i2chub", |
"address": 0x70, |
"address": 0x72, |
"children": [ |
{ "name":"clkgen", "type":"clkgen01", "channel": 5, }, |
{ "name":"clkgen", "type":"clkgen01", "channel": 7, }, |
], |
}, |
], |
38,6 → 44,9 |
|
fgen = cfg.get_device("clkgen") |
sys.stdout.write("Frequency will be set to " + sys.argv[2] + " MHz.\r\n") |
|
time.sleep(3) |
fgen.route() |
fgen.reset() # Reset Si570 to 10 MHz |
time.sleep(3) |
fgen = cfg.get_device("clkgen") # Reopen CP2112 |