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