summaryrefslogtreecommitdiffstatshomepage
path: root/tests/ports/stm32/modstm.py
blob: 1459ee2a9e3f605fcd618f2c65c8bfcd19e688b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# test stm module

import stm
import time

# test storing a full 32-bit number
# turn on then off the A15(=yellow) LED
BSRR = 0x18
stm.mem32[stm.GPIOA + BSRR] = 0x00008000
time.sleep_ms(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))