From 643f3f9a93b75330d1fa8204a2cfc658c010edcd Mon Sep 17 00:00:00 2001 From: Radek Pesina Date: Wed, 30 Aug 2023 09:58:06 +1000 Subject: [PATCH] test_i2c: add more commands --- test/test_i2c.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_i2c.py b/test/test_i2c.py index 309357476..c8f648eeb 100755 --- a/test/test_i2c.py +++ b/test/test_i2c.py @@ -192,6 +192,18 @@ class TestI2C(unittest.TestCase): yield from i2c_write(0x41<<1 | 1) yield from i2c_read(0x18, ack=False) + print("write 2 bytes 0x10 0x00 to address 0x11") + yield from i2c_restart() + yield from i2c_write(0x11 << 1 | 0) + yield from i2c_write(0x10, ack=True) + yield from i2c_write(0x00, ack=False) + yield from i2c_stop() + + print("read 1 byte from address 0x11") + yield from i2c_start() + yield from i2c_write(0x11 << 1 | 1) + yield from i2c_read(0x81, ack=False) + print("read 2 bytes from address 0x55") yield from i2c_restart() yield from i2c_write(0x55<<1 | 1)