-
Notifications
You must be signed in to change notification settings - Fork 5
/
power.py
55 lines (44 loc) · 1.05 KB
/
power.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from classes import *
import sys, select, os, array
from array import array
#import ROOT
#from ROOT import TGraph
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-s', '--setting', metavar='F', type='string', action='store',
default = 'none',
dest = 'setting',
help = 'setting ie on or off')
(options, args) = parser.parse_args()
a = uasic(connection="file://connections_test.xml",device="board0")
mapsa = MAPSA(a)
read = a._hw.getNode("Control").getNode('firm_ver').read()
a._hw.dispatch()
print "Running firmware version " + str(read)
if options.setting=='on':
print "Voltage on..."
print "VDDPST on"
mapsa.VDDPST_on()
time.sleep(.5)
print "DVDD on"
mapsa.DVDD_on()
time.sleep(.5)
print "AVDD on"
mapsa.AVDD_on()
time.sleep(.5)
print "PVDD on"
mapsa.PVDD_on()
elif options.setting=='off':
print "Voltage off..."
print "PVDD off"
mapsa.PVDD_off()
print "AVDD off"
mapsa.AVDD_off()
print "DVDD off"
mapsa.DVDD_off()
print "VDDPST off"
mapsa.VDDPST_off()
else:
print "Please select a setting"
print ""
print "Done"