@@ -44,6 +44,7 @@ module ibi (
44
44
input logic scl_posedge_i,
45
45
input logic bus_available_i,
46
46
input logic bus_stop_i,
47
+ input logic bus_rstart_i,
47
48
48
49
// Bus TX interface
49
50
input logic bus_tx_done_i,
@@ -105,7 +106,7 @@ module ibi (
105
106
// Transmitt T bit
106
107
SendTbit,
107
108
// Wait for stop condition
108
- WaitStop ,
109
+ WaitStopOrRstart ,
109
110
// Flush remaining IBI data bytes
110
111
Flush,
111
112
// Signal to primary FSM that IBI is done
@@ -144,7 +145,7 @@ module ibi (
144
145
if (bus_stop_i) state_q <= Done;
145
146
else if (bus_rx_done_i)
146
147
if (bus_rx_req_nack) // NACK
147
- state_q <= WaitStop ;
148
+ state_q <= WaitStopOrRstart ;
148
149
else // ACK
149
150
state_q <= WaitForSclNegedgeAfterAck;
150
151
@@ -159,7 +160,7 @@ module ibi (
159
160
if (bus_stop_i) state_q <= Flush;
160
161
else if (bus_tx_done_i) state_q <= ibi_byte_last_i ? Done : SendData;
161
162
162
- WaitStop : if (bus_stop_i) state_q <= Idle;
163
+ WaitStopOrRstart : if (bus_stop_i | bus_rstart_i ) state_q <= Idle;
163
164
164
165
Flush: if (! ibi_byte_valid_i) state_q <= Done;
165
166
@@ -273,6 +274,6 @@ module ibi (
273
274
assign done_o = (state_q == Done);
274
275
275
276
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);
277
278
278
279
endmodule
0 commit comments