From 120bd2d21211edf832729714153efad2ea2e30d3 Mon Sep 17 00:00:00 2001 From: Dan White Date: Tue, 16 Oct 2012 00:50:36 -0500 Subject: [PATCH] Fixup changes --- python-lib/usbio.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/python-lib/usbio.py b/python-lib/usbio.py index 18b7365..b16958b 100644 --- a/python-lib/usbio.py +++ b/python-lib/usbio.py @@ -812,10 +812,6 @@ class MuxOTA(OTA): def __init__(self, mode=0, fast=0, gain=0, offset=0): # setup main functionality super(MuxOTA, self).__init__(fast=fast, gain=gain, offset=offset) - # remove references to re-defined bits, they are named ".mode" now - del self.__dict__['cint'] - del self.__dict__['zero'] - del self.__dict__['se'] self.mode = mode @property @@ -1224,10 +1220,10 @@ class AD524x(object): """Return a dict of settings which can be passed to constructor to restore the state.""" s = {} - s['posA'] = self.posA - s['posB'] = self.posB - s['gpo1'] = self.gpo1 - s['gpo2'] = self.gpo2 + s['posA'] = int(self.posA) + s['posB'] = int(self.posB) + s['gpo1'] = int(self.gpo1) + s['gpo2'] = int(self.gpo2) return s class DAC8568(object): @@ -1898,14 +1894,13 @@ class DAC_atoi(DAC8568): # put into official operating mode # - dac.swreset() + self.swreset() # reference is tied to ADC, do not power down - dac.reference(dac.REF_FLEXIBLE_ALWAYS_ON) + self.reference(self.REF_FLEXIBLE_ALWAYS_ON) # CLR is tied high, explicitly ignore anyway - dac.CCR(dac.IGNORE_CLR) + self.CCR(self.IGNORE_CLR) # power up all channels - bitfield = 0xff - dac.power(dac.POWER_ON, bitfield) + self.power(self.POWER_ON, 0xff) # set outputs if we are restoring state for name, value in ( ('vina', vina), @@ -1919,7 +1914,7 @@ class DAC_atoi(DAC8568): # zero unused outputs # part A already POR's to 0 but... for i in range(5, 8): - dac.setv(i, 0.0) + self.setv(i, 0.0) def _pos2v(self, pos): -- 2.25.1