|
|
@@ -142,7 +142,12 @@ module host_i2c_register_slave #(
|
|
|
end
|
|
|
ST_READ: begin
|
|
|
if (scl_fall) begin
|
|
|
- drive_low <= !tx_byte[7-tx_bit];
|
|
|
+ if (tx_bit == 0) begin
|
|
|
+ tx_byte <= read_data;
|
|
|
+ drive_low <= !read_data[7];
|
|
|
+ end else begin
|
|
|
+ drive_low <= !tx_byte[7-tx_bit];
|
|
|
+ end
|
|
|
end else if (scl_rise) begin
|
|
|
if (tx_bit == 7) begin
|
|
|
drive_low <= 0; state <= ST_READ_ACK; tx_bit <= 0;
|