We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcb7acb commit b6043beCopy full SHA for b6043be
src/i2c_master.sv
@@ -66,7 +66,7 @@ logic [COUNTER_WIDTH-1:0] countdown = COUNTER_WIDTH'(0);
66
logic [3:0] transaction_progress = 4'd0;
67
68
logic release_line;
69
-assign release_line = transaction_progress == 4'd0 || countdown > 0;
+assign release_line = (transaction_progress == 4'd0 && counter == COUNTER_HIGH) || countdown > 0;
70
71
clock #(
72
.COUNTER_WIDTH(COUNTER_WIDTH),
@@ -189,7 +189,7 @@ begin
189
begin
190
transaction_progress <= 4'd1;
191
sda_internal <= 1'b0;
192
- if (transaction_progress == 4'd11) // Hold time padding
+ if (transaction_progress == 4'd11 && COUNTER_HOLD_REPEATED_START > (COUNTER_END - COUNTER_RECEIVE)) // Hold time padding
193
countdown <= COUNTER_HOLD_REPEATED_START - (COUNTER_END - COUNTER_RECEIVE);
194
busy <= 1'b1;
195
end
0 commit comments