mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
tests/pyb: Add simple test for stm module on pyboard.
This commit is contained in:
parent
3a042fb921
commit
f7e5e677df
13
tests/pyb/modstm.py
Normal file
13
tests/pyb/modstm.py
Normal file
@ -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))
|
2
tests/pyb/modstm.py.exp
Normal file
2
tests/pyb/modstm.py.exp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
0x8000
|
||||||
|
0x0
|
Loading…
Reference in New Issue
Block a user