Skip to content

Commit

Permalink
ports/psoc6: Fix formatting.
Browse files Browse the repository at this point in the history
Signed-off-by: IFX-Anusha <Anusha.TR@infineon.com>
  • Loading branch information
IFX-Anusha committed Nov 17, 2023
1 parent 1fb6c7e commit 5c2cd23
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions tests/psoc6/dut/i2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,44 @@
import time
import array

# Allocate pin based on board
# Allocate pin based on board
machine = os.uname().machine
if "CY8CPROTO-062-4343W" in machine:
sck_tx_pin ="P13_1"
sck_tx_pin = "P13_1"
ws_tx_pin = "P13_2"
sd_tx_pin = "P13_3"
sck_rx_pin ="P5_4"
ws_rx_pin = "P5_5"
sd_rx_pin = "P5_6"
sck_rx_pin = "P5_4"
ws_rx_pin = "P5_5"
sd_rx_pin = "P5_6"

audio_out = I2S(0, sck=sck_tx_pin, ws=ws_tx_pin, sd=sd_tx_pin, mode=I2S.TX, bits=16, format=I2S.STEREO, rate=8000, ibuf=20000)
audio_in = I2S(1, sck=sck_rx_pin, ws=ws_rx_pin, sd=sd_rx_pin, mode=I2S.RX, bits=16, format=I2S.STEREO, rate=8000, ibuf=20000)
buf=bytearray(10)
buf = b"\x01\x00\x17\x15\x16\x44"
audio_out = I2S(
0,
sck=sck_tx_pin,
ws=ws_tx_pin,
sd=sd_tx_pin,
mode=I2S.TX,
bits=16,
format=I2S.STEREO,
rate=8000,
ibuf=20000,
)
audio_in = I2S(
1,
sck=sck_rx_pin,
ws=ws_rx_pin,
sd=sd_rx_pin,
mode=I2S.RX,
bits=16,
format=I2S.STEREO,
rate=8000,
ibuf=20000,
)
buf = bytearray(10)
buf = b"\x01\x00\x17\x15\x16\x44"
print("tx Buffer")
print(buf)
num_written = audio_out.write(buf)
buf1= bytearray(10)
buf1 = bytearray(10)
num_read = audio_in.readinto(buf1)
print("Rx Buffer")
print(buf1)

print(buf1)

0 comments on commit 5c2cd23

Please sign in to comment.