summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--tests/pyb/modstm.py13
-rw-r--r--tests/pyb/modstm.py.exp2
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/pyb/modstm.py b/tests/pyb/modstm.py
new file mode 100644
index 0000000000..f1e147c052
--- /dev/null
+++ b/tests/pyb/modstm.py
@@ -0,0 +1,13 @@
+# test stm module
+
+import stm
+import pyb
+
+# test storing a full 32-bit number
+# turn on then off the A15(=yellow) LED
+BSRR = 0x18
+stm.mem32[stm.GPIOA + BSRR] = 0x00008000
+pyb.delay(100)
+print(hex(stm.mem32[stm.GPIOA + stm.GPIO_ODR] & 0x00008000))
+stm.mem32[stm.GPIOA + BSRR] = 0x80000000
+print(hex(stm.mem32[stm.GPIOA + stm.GPIO_ODR] & 0x00008000))
diff --git a/tests/pyb/modstm.py.exp b/tests/pyb/modstm.py.exp
new file mode 100644
index 0000000000..a24c9f8657
--- /dev/null
+++ b/tests/pyb/modstm.py.exp
@@ -0,0 +1,2 @@
+0x8000
+0x0