summaryrefslogtreecommitdiff
path: root/tests/pyb/i2c.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-13 16:43:17 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-13 17:27:29 +1100
commit4b184d12819139fc51073248614111c45a5ac631 (patch)
treea9f94a55ac06d72bb1f6258d0db06aee05af13af /tests/pyb/i2c.py
parent7280bf40d9b43118cca87a7321c088e118a5ebc1 (diff)
tests/pyb: Refactor pyboard tests to work on PYBv1, PYBLITEv1 and PYBD.
Diffstat (limited to 'tests/pyb/i2c.py')
-rw-r--r--tests/pyb/i2c.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py
index 6875e5a5a..bc9dba878 100644
--- a/tests/pyb/i2c.py
+++ b/tests/pyb/i2c.py
@@ -1,8 +1,8 @@
import pyb
from pyb import I2C
-# test we can correctly create by id or name
-for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"):
+# test we can correctly create by id
+for bus in (-1, 0, 1):
try:
I2C(bus)
print("I2C", bus)
@@ -14,19 +14,3 @@ i2c = I2C(1)
i2c.init(I2C.MASTER, baudrate=400000)
print(i2c.scan())
i2c.deinit()
-
-# use accelerometer to test i2c bus
-
-accel_addr = 76
-
-pyb.Accel() # this will init the MMA for us
-i2c.init(I2C.MASTER, baudrate=400000)
-
-print(i2c.scan())
-print(i2c.is_ready(accel_addr))
-
-print(i2c.mem_read(1, accel_addr, 7, timeout=500))
-i2c.mem_write(0, accel_addr, 0, timeout=500)
-
-i2c.send(7, addr=accel_addr)
-i2c.recv(1, addr=accel_addr)