Skip to content

Commit

Permalink
tests/psoc6/dut: Codeformatting i2c tests.
Browse files Browse the repository at this point in the history
Signed-off-by: NikhitaR-IFX <Nikhita.Rajasekhar@infineon.com>
  • Loading branch information
NikhitaR-IFX committed Nov 6, 2023
1 parent 0821767 commit 5509a8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/psoc6/dut/i2c_hard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
scl_pin = "P6_4"
sda_pin = "P6_5"

i2c = I2C(0,scl=scl_pin,sda=sda_pin,freq=400000)
i2c = I2C(0, scl=scl_pin, sda=sda_pin, freq=400000)
addr = i2c.scan()
master_data = b'\x01\x00\x17'
master_data = b"\x01\x00\x17"
counter = 0

while(counter!=5):
while counter != 5:
i2c.writeto(addr[0], master_data)
time.sleep(1)
slave_data = i2c.readfrom(addr[0], 3)
print("Slave sent data: ", slave_data)
master_data = slave_data
time.sleep(1)
counter = counter+1
counter = counter + 1
7 changes: 3 additions & 4 deletions tests/psoc6/dut/i2c_soft.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@

i2c = SoftI2C(scl=scl_pin, sda=sda_pin, freq=400000)
addr = i2c.scan()
master_data = b'\x01\x00\x17'
master_data = b"\x01\x00\x17"
counter = 0

while(counter!=5):
while counter != 5:
i2c.writeto(addr[0], master_data)
time.sleep(1)
slave_data = i2c.readfrom(addr[0], 3)
print("Slave sent data: ", slave_data)
master_data = slave_data
time.sleep(1)
counter = counter+1

counter = counter + 1

0 comments on commit 5509a8a

Please sign in to comment.