def enable(parameters = None): """ Name: enable Desc: This enables the Main Power for the board. The board is powered on with AUX enabled. Params: parameters (list) None """ global EN for key in PINS.keys(): GPIO.output(PINS[key], GPIO.LOW) GPIO.output(PINS["MAINPW_EN"], GPIO.HIGH) with open("EN", "wb") as ENFile: ENFile.write("1") EN = True time.sleep(1) aux([1]) i2c = Adafruit_I2C(address, busNum) pll = si5338POST(i2c = i2c, regs = VCOREGS) pll._init() print "Main Power Enabled" print "Note: When finished use 'disable' or 'quit'"
def enable(parameters=None): """ Name: enable Desc: This enables the Main Power for the board. The board is powered on with AUX enabled. Params: parameters (list) None """ global EN for key in PINS.keys(): GPIO.output(PINS[key], GPIO.LOW) GPIO.output(PINS["MAINPW_EN"], GPIO.HIGH) with open("EN", "wb") as ENFile: ENFile.write("1") EN = True time.sleep(1) aux([1]) i2c = Adafruit_I2C(address, busNum) pll = si5338POST(i2c=i2c, regs=VCOREGS) pll._init() print "Main Power Enabled" print "Note: When finished use 'disable' or 'quit'"
GPIO.setup(PINS["TESTEN"], GPIO.OUT) GPIO.setup(PINS["SCRODSEL"], GPIO.OUT) GPIO.output(PINS["TESTEN"], True) bus = SMBus(1) user = userSettings() print "PLL Select: (0: RF or 1: VCO)" vco = raw_input() user.vco = bool(int(vco)) print bcolors.WARNING + "Loading PLL" + bcolors.ENDC pll = si5338POST(0x70, user.vco, bus, VCOREGS, PINS["INTERRUPT"], GPIO) time.sleep(0.5) if pll.check(): print bcolors.FAIL + "Exiting..." + bcolors.ENDC exit() else: print bcolors.OKGREEN + "PLL Ready" + bcolors.ENDC bus.close() print "Enable Test Signal: (0: Disable or 1: Enable)" testSignal = raw_input() print "Select SCROD: (A or B)" scrod = raw_input() print "Input bunchMarkerA: (0 - 5280)"