summaryrefslogtreecommitdiff
path: root/tests/pyb
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-06-14 16:58:08 -0500
committerJeff Epler <jepler@unpythonic.net>2020-06-25 11:44:21 -0500
commitd82292fa1f902f014f763948996cf31a617d0a8e (patch)
treec17502123f76a8c63164da1305734d19480e56bc /tests/pyb
parent3c11f6cc05d1e53985591fec3d0297444eeee151 (diff)
README: Remove a statement that's not particularly true at the moment
Diffstat (limited to 'tests/pyb')
-rw-r--r--tests/pyb/halerror.py15
-rw-r--r--tests/pyb/i2c.py32
-rw-r--r--tests/pyb/i2c.py.exp12
-rw-r--r--tests/pyb/i2c_error.py50
4 files changed, 0 insertions, 109 deletions
diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py
deleted file mode 100644
index 1a6bce1a7..000000000
--- a/tests/pyb/halerror.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# test hal errors
-
-import pyb
-
-i2c = pyb.I2C(2, pyb.I2C.MASTER)
-try:
- i2c.recv(1, 1)
-except OSError as e:
- print(repr(e))
-
-can = pyb.CAN(1, pyb.CAN.NORMAL)
-try:
- can.send('1', 1, timeout=50)
-except OSError as e:
- print(repr(e))
diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py
deleted file mode 100644
index 6875e5a5a..000000000
--- a/tests/pyb/i2c.py
+++ /dev/null
@@ -1,32 +0,0 @@
-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"):
- try:
- I2C(bus)
- print("I2C", bus)
- except ValueError:
- print("ValueError", bus)
-
-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)
diff --git a/tests/pyb/i2c.py.exp b/tests/pyb/i2c.py.exp
deleted file mode 100644
index 709fb412d..000000000
--- a/tests/pyb/i2c.py.exp
+++ /dev/null
@@ -1,12 +0,0 @@
-ValueError -1
-ValueError 0
-I2C 1
-I2C 2
-ValueError 3
-I2C X
-I2C Y
-ValueError Z
-[]
-[76]
-True
-b'\x01'
diff --git a/tests/pyb/i2c_error.py b/tests/pyb/i2c_error.py
deleted file mode 100644
index 3201d6367..000000000
--- a/tests/pyb/i2c_error.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# test I2C errors, with polling (disabled irqs) and DMA
-
-import pyb
-from pyb import I2C
-
-# init accelerometer
-pyb.Accel()
-
-# get I2C bus
-i2c = I2C(1, I2C.MASTER, dma=True)
-
-# test polling mem_read
-pyb.disable_irq()
-i2c.mem_read(1, 76, 0x0a) # should succeed
-pyb.enable_irq()
-try:
- pyb.disable_irq()
- i2c.mem_read(1, 77, 0x0a) # should fail
-except OSError as e:
- pyb.enable_irq()
- print(repr(e))
-i2c.mem_read(1, 76, 0x0a) # should succeed
-
-# test polling mem_write
-pyb.disable_irq()
-i2c.mem_write(1, 76, 0x0a) # should succeed
-pyb.enable_irq()
-try:
- pyb.disable_irq()
- i2c.mem_write(1, 77, 0x0a) # should fail
-except OSError as e:
- pyb.enable_irq()
- print(repr(e))
-i2c.mem_write(1, 76, 0x0a) # should succeed
-
-# test DMA mem_read
-i2c.mem_read(1, 76, 0x0a) # should succeed
-try:
- i2c.mem_read(1, 77, 0x0a) # should fail
-except OSError as e:
- print(repr(e))
-i2c.mem_read(1, 76, 0x0a) # should succeed
-
-# test DMA mem_write
-i2c.mem_write(1, 76, 0x0a) # should succeed
-try:
- i2c.mem_write(1, 77, 0x0a) # should fail
-except OSError as e:
- print(repr(e))
-i2c.mem_write(1, 76, 0x0a) # should succeed