diff --git a/firmware/src/edubrm.c b/firmware/src/edubrm.c index 3506321..6abf965 100644 --- a/firmware/src/edubrm.c +++ b/firmware/src/edubrm.c @@ -37,8 +37,7 @@ void SetOutReport (uint8_t dst[], uint32_t length) break; case 'm': which = dst[1]; - chan = dst[2]; - mult = dst[3] + (dst[4]<<8); + mult = dst[2] + (dst[3]<<8); // TODO: set opamp (which) on channel (chan) with multiplicator (mult) break; case 's': diff --git a/software/device.py b/software/device.py index f9b3d68..c86c572 100644 --- a/software/device.py +++ b/software/device.py @@ -7,8 +7,6 @@ class Device: INSIZE = 64 OUTSIZE = 64 - polling = 0 - def __init__(self): usbdev = usb.core.find(idVendor = self.VENDORID, idProduct = self.PRODUCTID) if usbdev == None: @@ -33,9 +31,9 @@ class Device: def dds(self, wavetype, freq): self.epo.write('d' + chr(wavetype) + chr(freq & 0xff) + chr((freq >> 8) & 0xff) + chr((freq >> 16) & 0xff) + chr(freq >> 24)) - # set opamp (which=1,2), (chan=6), (mult=16bit) - def opamp(self, which, chan, mult): - self.epo.write('m' + chr(which) + chr(chan) + chr(mult & 0xff) + chr(mult >> 8)) + # set opamp (which=1,2), (mult=16bit) + def opamp(self, which, mult): + self.epo.write('m' + chr(which) + chr(mult & 0xff) + chr(mult >> 8)) # set switch (which=1..8), state=(0,1) def switch(self, which, state): @@ -53,9 +51,6 @@ class Device: def setout(self, which): self.epo.write('O' + chr(which)) - def pollfreq(self, freq): - self.polling = freq - def state(self): # 4x AD (16 bits) + 8x I i = self.epi.read(self.INSIZE) diff --git a/software/modules/ModuleDebug.py b/software/modules/ModuleDebug.py index 638ae8f..db8fa5d 100644 --- a/software/modules/ModuleDebug.py +++ b/software/modules/ModuleDebug.py @@ -1,5 +1,6 @@ from PyQt4.QtGui import QWidget from PyQt4.QtCore import pyqtSlot +from PyQt4.QtCore import QObject from ModuleDebugUi import Ui_ModuleDebug class ModuleDebugWidget(QWidget): diff --git a/software/modules/ModuleDebug.ui b/software/modules/ModuleDebug.ui index 0ae5516..f8b078a 100644 --- a/software/modules/ModuleDebug.ui +++ b/software/modules/ModuleDebug.ui @@ -13,162 +13,603 @@ Form - + 10 10 - 151 - 21 + 171 + 131 - + PWM - Qt::AlignCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + 10 + 90 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 90 + 90 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 90 + 20 + 71 + 71 + + + + 65535 + + + 256 + + + + + + 10 + 20 + 71 + 71 + + + + 65535 + + + 256 + + - + - 10 - 30 - 71 - 71 - - - - 65535 - - - 256 - - - - - - 90 - 30 - 71 - 71 - - - - 65535 - - - 256 - - - - - - 10 - 100 - 71 - 31 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0 - - - 65535 - - - 0 - - - 5 - - - - - - 90 - 100 - 71 - 31 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0 - - - 65535 - - - 0 - - - 5 - - - - - - 160 + 190 10 - 151 + 201 + 131 + + + + DDS + + + + + 90 + 90 + 101 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 16777216 + + + 0 + + + 8 + + + + + + 90 + 10 + 101 + 81 + + + + 16777216 + + + 100 + + + + + + 10 + 30 + 71 + 26 + + + + Sine + + + true + + + + + + 10 + 50 + 71 + 26 + + + + Square + + + + + + 10 + 70 + 71 + 26 + + + + Saw + + + + + + 10 + 90 + 71 + 26 + + + + InvSaw + + + + + + + 10 + 150 + 171 + 131 + + + + OPAMP + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + 10 + 90 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 90 + 90 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 90 + 20 + 71 + 71 + + + + 65535 + + + 256 + + + + + + 10 + 20 + 71 + 71 + + + + 65535 + + + 256 + + + + + + + 190 + 150 + 201 + 61 + + + + Outputs + + + + + 10 + 30 + 21 + 26 + + + + + + + + + + 30 + 30 + 21 + 26 + + + + + + + + + + 50 + 30 + 21 + 26 + + + + + + + + + + 70 + 30 + 21 + 26 + + + + + + + + + + 90 + 30 + 21 + 26 + + + + + + + + + + 110 + 30 + 21 + 26 + + + + + + + + + + 130 + 30 + 21 + 26 + + + + + + + + + + 150 + 30 + 21 + 26 + + + + + + + + + + + 200 + 200 + 161 21 - DDS - - - Qt::AlignCenter - - - - - - 250 - 30 - 71 - 71 - - - - 16777216 - - - 100 - - - - - - 220 - 100 - 101 - 31 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0 - - - 16777216 - - - 0 - - - 8 + 8 7 6 5 4 3 2 1 - + + + dialPWM1 + valueChanged(int) + linePWM1 + setValue(int) + + + 55 + 65 + + + 55 + 115 + + + + + dialPWM2 + valueChanged(int) + linePWM2 + setValue(int) + + + 135 + 65 + + + 135 + 115 + + + + + linePWM1 + valueChanged(int) + dialPWM1 + setValue(int) + + + 55 + 115 + + + 55 + 65 + + + + + linePWM2 + valueChanged(int) + dialPWM2 + setValue(int) + + + 135 + 115 + + + 135 + 65 + + + + + dialAMP1 + valueChanged(int) + lineAMP1 + setValue(int) + + + 55 + 205 + + + 55 + 255 + + + + + dialAMP2 + valueChanged(int) + lineAMP2 + setValue(int) + + + 135 + 205 + + + 135 + 255 + + + + + lineAMP1 + valueChanged(int) + dialAMP1 + setValue(int) + + + 55 + 255 + + + 55 + 205 + + + + + lineAMP2 + valueChanged(int) + dialAMP2 + setValue(int) + + + 135 + 255 + + + 135 + 205 + + + + + dialDDS + valueChanged(int) + lineDDS + setValue(int) + + + 330 + 60 + + + 330 + 115 + + + + + lineDDS + valueChanged(int) + dialDDS + setValue(int) + + + 330 + 115 + + + 330 + 60 + + + +