summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pyb
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-10 17:06:07 +0000
committerDamien George <damien.p.george@gmail.com>2016-02-10 17:06:07 +0000
commitf7e5e677df120122eeaac18b81d3fccfe0965180 (patch)
tree46bdfc2facdc63e5cb7c7049e7da7f34c231464e /tests/pyb
parent3a042fb9215528b5b918d7850c1b776dd359fce7 (diff)
downloadmicropython-f7e5e677df120122eeaac18b81d3fccfe0965180.tar.gz
micropython-f7e5e677df120122eeaac18b81d3fccfe0965180.zip
tests/pyb: Add simple test for stm module on pyboard.
Diffstat (limited to 'tests/pyb')
-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