URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_twi.vhd] - Diff between revs 48 and 65
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 48 |
Rev 65 |
Line 188... |
Line 188... |
twi_sda_i_ff0 <= twi_sda_i;
|
twi_sda_i_ff0 <= twi_sda_i;
|
twi_sda_i_ff1 <= twi_sda_i_ff0;
|
twi_sda_i_ff1 <= twi_sda_i_ff0;
|
twi_scl_i_ff0 <= twi_scl_i;
|
twi_scl_i_ff0 <= twi_scl_i;
|
twi_scl_i_ff1 <= twi_scl_i_ff0;
|
twi_scl_i_ff1 <= twi_scl_i_ff0;
|
|
|
-- defaults --
|
-- interrupt --
|
|
if (arbiter = "100") then -- fire IRQ if enabled transceiver is idle
|
|
irq_o <= '1';
|
|
else
|
irq_o <= '0';
|
irq_o <= '0';
|
|
end if;
|
|
|
|
-- defaults --
|
arbiter(2) <= ctrl(ctrl_twi_en_c); -- still activated?
|
arbiter(2) <= ctrl(ctrl_twi_en_c); -- still activated?
|
|
|
-- serial engine --
|
-- serial engine --
|
-- TWI bus signals are set/sampled using 4 clock phases
|
-- TWI bus signals are set/sampled using 4 clock phases
|
case arbiter is
|
case arbiter is
|
Line 255... |
Line 261... |
twi_scl_o <= '0';
|
twi_scl_o <= '0';
|
end if;
|
end if;
|
|
|
if (twi_bitcnt = "1010") then -- 8 data bits + 1 bit for ACK + 1 tick delay
|
if (twi_bitcnt = "1010") then -- 8 data bits + 1 bit for ACK + 1 tick delay
|
arbiter(1 downto 0) <= "00"; -- go back to IDLE
|
arbiter(1 downto 0) <= "00"; -- go back to IDLE
|
irq_o <= '1'; -- fire IRQ
|
|
end if;
|
end if;
|
|
|
when others => -- "0--" OFFLINE: TWI deactivated
|
when others => -- "0--" OFFLINE: TWI deactivated
|
twi_sda_o <= '1';
|
twi_sda_o <= '1';
|
twi_scl_o <= '1';
|
twi_scl_o <= '1';
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.