URL
https://opencores.org/ocsvn/apbi2c/apbi2c/trunk
[/] [apbi2c/] [trunk/] [rtl/] [module_i2c.v] - Diff between revs 22 and 23
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 22 |
Rev 23 |
Line 223... |
Line 223... |
end
|
end
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 || fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b1)
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 || fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b1)
|
begin
|
begin
|
next_state_tx = IDLE;
|
next_state_tx = IDLE;
|
end
|
end
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 || fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b0 && count_timeout < TIMEOUT_TX)
|
else if(DATA_CONFIG_REG[0] == 1'b1 && ((fifo_tx_f_full == 1'b0 && fifo_tx_f_empty == 1'b0) || fifo_tx_f_full == 1'b1) && DATA_CONFIG_REG[1] == 1'b0 && count_timeout < TIMEOUT_TX)
|
begin
|
begin
|
next_state_tx = START;
|
next_state_tx = START;
|
end
|
end
|
|
|
|
|
Line 785... |
Line 785... |
begin
|
begin
|
count_send_data <= 12'd0;
|
count_send_data <= 12'd0;
|
SDA_OUT<= 1'b1;
|
SDA_OUT<= 1'b1;
|
BR_CLK_O <= 1'b1;
|
BR_CLK_O <= 1'b1;
|
end
|
end
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 ||fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b0)
|
else if(DATA_CONFIG_REG[0] == 1'b1 && ((fifo_tx_f_empty == 1'b0 && fifo_tx_f_full == 1'b0 )|| fifo_tx_f_full == 1'b1 ) && DATA_CONFIG_REG[1] == 1'b0)
|
begin
|
begin
|
count_send_data <= count_send_data + 12'd1;
|
count_send_data <= count_send_data + 12'd1;
|
SDA_OUT<=1'b0;
|
SDA_OUT<=1'b0;
|
end
|
end
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 ||fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b1)
|
else if(DATA_CONFIG_REG[0] == 1'b1 && (fifo_tx_f_full == 1'b1 ||fifo_tx_f_empty == 1'b0) && DATA_CONFIG_REG[1] == 1'b1)
|
Line 2580... |
Line 2580... |
|
|
case(state_rx)
|
case(state_rx)
|
IDLE:
|
IDLE:
|
begin
|
begin
|
|
|
SDA_OUT_RX<= SDA;
|
|
BR_CLK_O_RX<=SCL;
|
|
|
|
if(((fifo_rx_f_full == 1'b0 && fifo_rx_f_empty == 1'b0) || (fifo_rx_f_full == 1'b0 && fifo_rx_f_empty == 1'b1)) && DATA_CONFIG_REG[1] == 1'b1)
|
if(((fifo_rx_f_full == 1'b0 && fifo_rx_f_empty == 1'b0) || (fifo_rx_f_full == 1'b0 && fifo_rx_f_empty == 1'b1)) && DATA_CONFIG_REG[1] == 1'b1)
|
begin
|
begin
|
|
|
|
SDA_OUT_RX<= SDA;
|
|
BR_CLK_O_RX<=SCL;
|
count_receive_data <= count_receive_data + 12'd1;
|
count_receive_data <= count_receive_data + 12'd1;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
SDA_OUT_RX<= SDA_OUT_RX;
|
|
BR_CLK_O_RX<=BR_CLK_O_RX;
|
count_receive_data <= count_receive_data;
|
count_receive_data <= count_receive_data;
|
end
|
end
|
|
|
end
|
end
|
START:
|
START:
|
Line 3359... |
Line 3362... |
begin
|
begin
|
count_timeout <= 12'd0;
|
count_timeout <= 12'd0;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
if(count_timeout <= TIMEOUT_TX)
|
if(count_timeout <= TIMEOUT_TX && state_tx == IDLE)
|
begin
|
begin
|
if(SDA == 1'b0 && SCL == 1'b0)
|
if(SDA == 1'b0 && SCL == 1'b0)
|
count_timeout <= count_timeout + 12'd1;
|
count_timeout <= count_timeout + 12'd1;
|
end
|
end
|
else
|
else
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.