fix opamps

This commit is contained in:
Pavol Rusnak 2011-04-27 04:54:38 +02:00
parent 1e44b4c0ec
commit 5df11a171a
2 changed files with 43 additions and 47 deletions

View file

@ -61,26 +61,15 @@ void SetOutReport (uint8_t dst[], uint32_t length)
gain = dst[3]; gain = dst[3];
if (which == 1) { if (which == 1) {
LPC_GPIO3->MASKED_ACCESS[1<<3] &= ((0<<3) | ~(1<<3)); // set chipselect to 0 LPC_GPIO3->MASKED_ACCESS[1<<3] &= ((0<<3) | ~(1<<3)); // set chipselect to 0
} else { SSPSend2(0x40, gain); // gain: 000 - 1, 111 - 32
LPC_GPIO3->MASKED_ACCESS[1<<2] &= ((0<<2) | ~(1<<2)); // set chipselect to 0
}
// set channel
SSPSend2(0x41, chan); // 000 - ch#1, 101 - ch#6
if (which == 1) {
LPC_GPIO3->MASKED_ACCESS[1<<3] |= (1<<3); // set chipselect to 1 LPC_GPIO3->MASKED_ACCESS[1<<3] |= (1<<3); // set chipselect to 1
} else { } else {
LPC_GPIO3->MASKED_ACCESS[1<<2] &= ((0<<2) | ~(1<<2)); // set chipselect to 0
SSPSend2(0x41, chan); // chan: 000 - ch#1, 101 - ch#6
LPC_GPIO3->MASKED_ACCESS[1<<2] |= (1<<2); // set chipselect to 1 LPC_GPIO3->MASKED_ACCESS[1<<2] |= (1<<2); // set chipselect to 1
} for (which = 0; which < 75; which++) {}
if (which == 1) {
LPC_GPIO3->MASKED_ACCESS[1<<3] &= ((0<<3) | ~(1<<3)); // set chipselect to 0
} else {
LPC_GPIO3->MASKED_ACCESS[1<<2] &= ((0<<2) | ~(1<<2)); // set chipselect to 0 LPC_GPIO3->MASKED_ACCESS[1<<2] &= ((0<<2) | ~(1<<2)); // set chipselect to 0
} SSPSend2(0x40, gain); // gain: 000 - 1, 111 - 32
// set gain
SSPSend2(0x40, gain); // 000 - 1, 111 - 32
if (which == 1) {
LPC_GPIO3->MASKED_ACCESS[1<<3] |= (1<<3); // set chipselect to 1
} else {
LPC_GPIO3->MASKED_ACCESS[1<<2] |= (1<<2); // set chipselect to 1 LPC_GPIO3->MASKED_ACCESS[1<<2] |= (1<<2); // set chipselect to 1
} }
break; break;

View file

@ -231,7 +231,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>150</y> <y>150</y>
<width>151</width> <width>161</width>
<height>111</height> <height>111</height>
</rect> </rect>
</property> </property>
@ -255,31 +255,6 @@
<string>ch 1</string> <string>ch 1</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>ch 2</string>
</property>
</item>
<item>
<property name="text">
<string>ch 3</string>
</property>
</item>
<item>
<property name="text">
<string>ch 4</string>
</property>
</item>
<item>
<property name="text">
<string>ch 5</string>
</property>
</item>
<item>
<property name="text">
<string>ch 6</string>
</property>
</item>
</widget> </widget>
<widget class="QComboBox" name="comboAMP2c"> <widget class="QComboBox" name="comboAMP2c">
<property name="geometry"> <property name="geometry">
@ -324,7 +299,7 @@
<widget class="QComboBox" name="comboAMP1g"> <widget class="QComboBox" name="comboAMP1g">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>90</x>
<y>30</y> <y>30</y>
<width>61</width> <width>61</width>
<height>31</height> <height>31</height>
@ -374,7 +349,7 @@
<widget class="QComboBox" name="comboAMP2g"> <widget class="QComboBox" name="comboAMP2g">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>90</x>
<y>70</y> <y>70</y>
<width>61</width> <width>61</width>
<height>31</height> <height>31</height>
@ -421,11 +396,43 @@
</property> </property>
</item> </item>
</widget> </widget>
<widget class="QLabel" name="labelOO">
<property name="geometry">
<rect>
<x>70</x>
<y>30</y>
<width>21</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>O</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="labelOI">
<property name="geometry">
<rect>
<x>70</x>
<y>70</y>
<width>21</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>I</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget> </widget>
<widget class="QGroupBox" name="groupOut"> <widget class="QGroupBox" name="groupOut">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>310</x> <x>320</x>
<y>150</y> <y>150</y>
<width>151</width> <width>151</width>
<height>111</height> <height>111</height>
@ -534,7 +541,7 @@
<widget class="QGroupBox" name="groupSwitches"> <widget class="QGroupBox" name="groupSwitches">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>170</x> <x>180</x>
<y>150</y> <y>150</y>
<width>131</width> <width>131</width>
<height>111</height> <height>111</height>
@ -684,7 +691,7 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="text" stdset="0"> <property name="text" stdset="0">
<string>1</string> <string>0</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>