aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/peripspiled.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-06-27 21:09:43 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-06-27 21:09:43 +0200
commit30b15c6d1a328df5d8b0f99a5cbb1f72f25c9cdf (patch)
treeb6ff12cbad9294fcb0d33582b6e363a8608ddd47 /qtmips_machine/peripspiled.cpp
parentd218feed51015b2d5662d802bf4cc3c6d6d165c3 (diff)
downloadqtmips-30b15c6d1a328df5d8b0f99a5cbb1f72f25c9cdf.tar.gz
qtmips-30b15c6d1a328df5d8b0f99a5cbb1f72f25c9cdf.tar.bz2
qtmips-30b15c6d1a328df5d8b0f99a5cbb1f72f25c9cdf.zip
Simulate push of dial buttons by check box.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/peripspiled.cpp')
-rw-r--r--qtmips_machine/peripspiled.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/qtmips_machine/peripspiled.cpp b/qtmips_machine/peripspiled.cpp
index 0404311..d016f90 100644
--- a/qtmips_machine/peripspiled.cpp
+++ b/qtmips_machine/peripspiled.cpp
@@ -137,3 +137,21 @@ void PeripSpiLed::blue_knob_update(int val) {
spiled_reg_knobs_8bit &= ~(0xff << 0);
spiled_reg_knobs_8bit |= (val & 0xff) << 0;
}
+
+void PeripSpiLed::red_knob_push(bool state) {
+ spiled_reg_knobs_8bit &= ~(1 << 26);
+ if (state)
+ spiled_reg_knobs_8bit |= 1 << 26;
+}
+
+void PeripSpiLed::green_knob_push(bool state) {
+ spiled_reg_knobs_8bit &= ~(1 << 25);
+ if (state)
+ spiled_reg_knobs_8bit |= 1 << 25;
+}
+
+void PeripSpiLed::blue_knob_push(bool state) {
+ spiled_reg_knobs_8bit &= ~(1 << 24);
+ if (state)
+ spiled_reg_knobs_8bit |= 1 << 24;
+}