if dut.iocell_side_io2_cell_out != 1:
raise TestFailure(
- "gpioa_a2=0/mux=0/out=1 %s iocell_io2 != 1" %
+ "gpioa_a2=1/mux=0/out=1 %s iocell_io2 != 1" %
str(dut.iocell_side_io2_cell_out))
# GPIO2-in test (first see if it's tri-state)
#
if str(dut.peripheral_side_gpioa_a2_in) != "x":
raise TestFailure(
- "gpioa_a2=0/mux=0/out=1 %s gpio_a2_in != x" %
+ "gpioa_a2=x/mux=0/out=1 %s gpio_a2_in != x" %
str(dut.peripheral_side_gpioa_a2_in))
dut.peripheral_side_gpioa_a2_outen_in = 0
if dut.iocell_side_io0_cell_out != 1:
raise TestFailure(
- "uart_tx=1/mux=0/out=1 %s iocell_io0 != 1" %
+ "uart_tx=1/mux=1/out=1 %s iocell_io0 != 1" %
str(dut.iocell_side_io0_cell_out))
dut.peripheral_side_uart_tx_in = 0
if dut.iocell_side_io0_cell_out != 0:
raise TestFailure(
- "uart_tx=0/mux=0/out=1 %s iocell_io0 != 0" %
+ "uart_tx=0/mux=1/out=1 %s iocell_io0 != 0" %
str(dut.iocell_side_io0_cell_out))
dut._log.info("Ok!, uart passed")
if dut.iocell_side_io2_cell_out != 0:
raise TestFailure(
- "twi_scl=0/mux=0/out=1 %s iocell_io2 != 0" %
+ "twi_scl=0/mux=2/out=1 %s iocell_io2 != 0" %
str(dut.iocell_side_io2_cell_out))
dut.peripheral_side_twi_scl_out_in = 1
if dut.iocell_side_io2_cell_out != 1:
raise TestFailure(
- "twi_scl=0/mux=0/out=1 %s iocell_io2 != 0" %
+ "twi_scl=1/mux=2/out=1 %s iocell_io2 != 1" %
str(dut.iocell_side_io2_cell_out))
dut._log.info("twi_scl_in %s" % dut.peripheral_side_twi_scl_in)
if dut.peripheral_side_twi_scl_in != 0:
raise TestFailure(
- "iocell_io2=0/mux=0/out=0 %s twi_scl != 0" %
+ "iocell_io2=0/mux=2/out=0 %s twi_scl != 0" %
str(dut.peripheral_side_twi_scl_in))
dut.iocell_side_io2_cell_in_in = 1
if dut.peripheral_side_twi_scl_in != 1:
raise TestFailure(
- "iocell_io2=1/mux=0/out=0 %s twi_scl != 1" %
+ "iocell_io2=1/mux=2/out=0 %s twi_scl != 1" %
str(dut.peripheral_side_twi_scl_in))
dut.peripheral_side_twi_scl_outen_in = 1
if dut.iocell_side_io2_cell_out != 1:
raise TestFailure(
- "twi_scl=0/mux=0/out=1 %s iocell_io2 != 1" %
+ "twi_scl=0/mux=2/out=1 %s iocell_io2 != 1" %
str(dut.iocell_side_io2_cell_out))
yield Timer(2)
# Test for out for twi_sda
if dut.iocell_side_io1_cell_out != 0:
raise TestFailure(
- "twi_sda=0/mux=0/out=1 %s iocell_io1 != 0" %
+ "twi_sda=0/mux=2/out=1 %s iocell_io1 != 0" %
str(dut.iocell_side_io1_cell_out))
dut.peripheral_side_twi_sda_out_in = 1
if dut.iocell_side_io1_cell_out != 1:
raise TestFailure(
- "twi_sda=1/mux=0/out=1 %s iocell_io1 != 1" %
+ "twi_sda=1/mux=2/out=1 %s iocell_io1 != 1" %
str(dut.iocell_side_io1_cell_out))
dut._log.info("twi_sda_in %s" % dut.peripheral_side_twi_sda_in)
if dut.peripheral_side_twi_sda_in != 0:
raise TestFailure(
- "iocell_io1=0/mux=0/out=0 %s twi_sda != 0" %
+ "iocell_io1=0/mux=2/out=0 %s twi_sda != 0" %
str(dut.peripheral_side_twi_sda_in))
dut.iocell_side_io1_cell_in_in = 1
if dut.peripheral_side_twi_sda_in != 1:
raise TestFailure(
- "iocell_io1=1/mux=0/out=0 %s twi_sda != 1" %
+ "iocell_io1=1/mux=2/out=0 %s twi_sda != 1" %
str(dut.peripheral_side_twi_sda_in))
dut.peripheral_side_twi_sda_outen_in = 1
if dut.iocell_side_io1_cell_out != 1:
raise TestFailure(
- "twi_sda=0/mux=0/out=1 %s iocell_io1 != 1" %
+ "twi_sda=1/mux=2/out=1 %s iocell_io1 != 1" %
str(dut.iocell_side_io1_cell_out))
yield Timer(2)
if dut.peripheral_side_twi_sda_in != 0:
raise TestFailure(
- "iocell_io1=0/mux=0/out=0 %s twi_sda != 0" %
+ "iocell_io1=0/mux=2/out=0 %s twi_sda != 0" %
str(dut.peripheral_side_twi_sda_in))
dut.iocell_side_io1_cell_in_in = 1
if dut.peripheral_side_twi_sda_in != 1:
raise TestFailure(
- "iocell_io1=1/mux=0/out=0 %s twi_sda != 1" %
+ "iocell_io1=1/mux=2/out=0 %s twi_sda != 1" %
str(dut.peripheral_side_twi_sda_in))
dut.iocell_side_io1_cell_in_in = 0
if dut.peripheral_side_twi_sda_in != 0:
raise TestFailure(
- "iocell_io1=1/mux=0/out=0 %s twi_sda != 0" %
+ "iocell_io1=0/mux=2/out=0 %s twi_sda != 0" %
str(dut.peripheral_side_twi_sda_in))
# ok now set up gpioa0, set it to the opposite of twi_sda (0) i.e. gpioa0=1
if dut.peripheral_side_gpioa_a0_in != 1: # output of iopad
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s gpio_a0 != 1" %
+ "iocell_io0=1/mux=2/out=0 %s gpio_a0 != 1" %
str(dut.peripheral_side_gpioa_a0_in))
# also twi_sda should also = 0, because.. because...
# pin1 is still routed to it, and pin1 is still set to 0...
if dut.peripheral_side_twi_sda_in != 0:
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s twi_sda != 0" %
+ "iocell_io0=1/mux=2/out=0 %s twi_sda != 0" %
str(dut.peripheral_side_twi_sda_in))
# ok flip over to test 3
# routing iopad0 to gpioa0...
if dut.peripheral_side_gpioa_a0_in != 0: # output of iopad
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s gpio_a0 != 0" %
+ "iocell_io0=1/mux=2/out=0 %s gpio_a0 != 0" %
str(dut.peripheral_side_gpioa_a0_in))
# AND, at the same time, twi_sda should also = 1, because.. because...
# gets precedence.
if dut.peripheral_side_twi_sda_in != 1:
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s twi_sda != 1" %
+ "iocell_io0=1/mux=2/out=0 %s twi_sda != 1" %
str(dut.peripheral_side_twi_sda_in))
# ok so now set cell1 muxer to point to gpioa1...
# now we test twi sda again (it shouldn't change)
if dut.peripheral_side_twi_sda_in != 1:
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s twi_sda != 1" %
+ "iocell_io0=1/mux=2/out=0 %s twi_sda != 1" %
str(dut.peripheral_side_twi_sda_in))
dut.iocell_side_io1_cell_in_in = 1 # now try setting cell1 to 0
# now we test twi sda again after changing io0, it *still* shouldn't change
if dut.peripheral_side_twi_sda_in != 1:
raise TestFailure(
- "iocell_io0=1/mux=0/out=0 %s twi_sda != 1" %
+ "iocell_io0=1/mux=2/out=0 %s twi_sda != 1" %
str(dut.peripheral_side_twi_sda_in))
# ok that's probably enough, we could check here that actually gpioa1
# Test for out for twi_sda
if dut.iocell_side_io1_cell_out != 0:
raise TestFailure(
- "twi_sda=0/mux=0/out=1 %s iocell_io1 != 0" %
+ "twi_sda=0/mux=2/out=1 %s iocell_io1 != 0" %
str(dut.iocell_side_io1_cell_out))
dut.peripheral_side_twi_sda_out_in = 1
# ok, now io1_cell_out should be equal to 1
if dut.iocell_side_io1_cell_out != 1:
raise TestFailure(
- "twi_sda=1/mux=0/out=1 %s iocell_io1 != 1" %
- str(dut.iocell_side_io1_cell_out))
+ "twi_sda=1/mux=2/out=1 %s iocell_io1 != 1" %
+ str(dut.peripheral_side_twi_sda_out_in))
# ok, now let's set the mux lines to cell0
# and select twi_sda : pin 0/mux 3
if dut.iocell_side_io0_cell_out != 1:
raise TestFailure(
- "twi_sda=1/mux=0/out=1 %s iocell_io1 != 1" %
- str(dut.iocell_side_io1_cell_out))
+ "twi_sda=1/mux=3/out=1 %s iocell_io0 != 1" %
+ str(dut.iocell_side_io0_cell_out))
# Now, let's test the working of output muxing logic
# at cell 0, by enabling the mux selection line for
# check the output is correctly getting passed
if dut.iocell_side_io0_cell_out != 0: # output of iopad
raise TestFailure(
- "gpioa_a2=0/mux=0/out=1 %s iocell_io2 != 0" %
+ "gpioa_a0=0/mux=0/out=1 %s iocell_io0 != 0" %
str(dut.iocell_side_io2_cell_out))
yield Timer(2)
if dut.peripheral_side_twi_sda_out_in != 1: # output of twi_sda
raise TestFailure(
- "gpioa_a2=0/mux=0/out=1 %s iocell_io2 != 0" %
+ "twi_sda=0/mux=0/out=1 %s iocell_io0 != 0" %
str(dut.iocell_side_io2_cell_out))
# Now, let's test the working of output muxing logic
yield Timer(2)
if dut.iocell_side_io1_cell_out != 1:
raise TestFailure(
- "twi_sda=1/mux=0/out=1 %s iocell_io1 != 1" %
+ "twi_sda=1/mux=2/out=1 %s iocell_io1 != 1" %
str(dut.iocell_side_io1_cell_out))
# ok, now set the muxing selection line for gpio1
yield Timer(2)
if dut.iocell_side_io1_cell_out != 0:
raise TestFailure(
- "twi_sda=1/mux=0/out=1 %s iocell_io1 != 1" %
+ "gpioa_a1=1/mux=0/out=1 %s iocell_io1 != 1" %
str(dut.iocell_side_io1_cell_out))
dut._log.info("Ok!, twi_sda test3 passed")