2017-02-05 21:48:01 -05:00
|
|
|
# test pyb module on F405 MCUs
|
|
|
|
|
|
|
|
import os, pyb
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
if not "STM32F405" in os.uname().machine:
|
|
|
|
print("SKIP")
|
2017-06-10 13:14:16 -04:00
|
|
|
raise SystemExit
|
2017-02-05 21:48:01 -05:00
|
|
|
|
|
|
|
print(pyb.freq())
|
|
|
|
print(type(pyb.rng()))
|
2019-12-13 00:43:17 -05:00
|
|
|
|
|
|
|
# test HAL error specific to F405
|
2021-06-12 00:53:44 -04:00
|
|
|
i2c = pyb.I2C(2, pyb.I2C.CONTROLLER)
|
2019-12-13 00:43:17 -05:00
|
|
|
try:
|
|
|
|
i2c.recv(1, 1)
|
|
|
|
except OSError as e:
|
|
|
|
print(repr(e))
|