Skip to content

Commit f7e5e67

Browse files
committed
tests/pyb: Add simple test for stm module on pyboard.
1 parent 3a042fb commit f7e5e67

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/pyb/modstm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# test stm module
2+
3+
import stm
4+
import pyb
5+
6+
# test storing a full 32-bit number
7+
# turn on then off the A15(=yellow) LED
8+
BSRR = 0x18
9+
stm.mem32[stm.GPIOA + BSRR] = 0x00008000
10+
pyb.delay(100)
11+
print(hex(stm.mem32[stm.GPIOA + stm.GPIO_ODR] & 0x00008000))
12+
stm.mem32[stm.GPIOA + BSRR] = 0x80000000
13+
print(hex(stm.mem32[stm.GPIOA + stm.GPIO_ODR] & 0x00008000))

tests/pyb/modstm.py.exp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0x8000
2+
0x0

0 commit comments

Comments
 (0)