@@ -44,6 +44,7 @@ module ibi (
4444 input logic scl_posedge_i,
4545 input logic bus_available_i,
4646 input logic bus_stop_i,
47+ input logic bus_rstart_i,
4748
4849 // Bus TX interface
4950 input logic bus_tx_done_i,
@@ -105,7 +106,7 @@ module ibi (
105106 // Transmitt T bit
106107 SendTbit,
107108 // Wait for stop condition
108- WaitStop ,
109+ WaitStopOrRstart ,
109110 // Flush remaining IBI data bytes
110111 Flush,
111112 // Signal to primary FSM that IBI is done
@@ -144,7 +145,7 @@ module ibi (
144145 if (bus_stop_i) state_q <= Done;
145146 else if (bus_rx_done_i)
146147 if (bus_rx_req_nack) // NACK
147- state_q <= WaitStop ;
148+ state_q <= WaitStopOrRstart ;
148149 else // ACK
149150 state_q <= WaitForSclNegedgeAfterAck;
150151
@@ -159,7 +160,7 @@ module ibi (
159160 if (bus_stop_i) state_q <= Flush;
160161 else if (bus_tx_done_i) state_q <= ibi_byte_last_i ? Done : SendData;
161162
162- WaitStop : if (bus_stop_i) state_q <= Idle;
163+ WaitStopOrRstart : if (bus_stop_i | bus_rstart_i ) state_q <= Idle;
163164
164165 Flush: if (! ibi_byte_valid_i) state_q <= Done;
165166
@@ -273,6 +274,6 @@ module ibi (
273274 assign done_o = (state_q == Done);
274275
275276 assign ibi_status_o = ibi_status;
276- assign ibi_status_we_o = (state_q == Done) | ((state_q == WaitStop ) & bus_stop_i);
277+ assign ibi_status_we_o = (state_q == Done) | ((state_q == WaitStopOrRstart ) & bus_stop_i);
277278
278279endmodule
0 commit comments