2017-02-06 02:48:01 +00:00
|
|
|
# test pyb module on F405 MCUs
|
|
|
|
|
|
|
|
import os, pyb
|
|
|
|
|
|
|
|
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
|
2021-06-12 05:53:44 +01:00
|
|
|
i2c = pyb.I2C(2, pyb.I2C.CONTROLLER)
|
2019-12-13 05:43:17 +00:00
|
|
|
try:
|
|
|
|
i2c.recv(1, 1)
|
|
|
|
except OSError as e:
|
|
|
|
print(repr(e))
|