Skip to content

Commit

Permalink
check for ack on sensor address register
Browse files Browse the repository at this point in the history
  • Loading branch information
schnommus committed Nov 9, 2023
1 parent 0756934 commit 46a3305
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions gateware/drivers/pmod_i2c_master.sv
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,21 @@ always_ff @(posedge clk) begin
end
// Sensor 0 difference counts
2: begin
case (nsensor)
0: data_in <= 8'hBA;
1: data_in <= 8'hBC;
2: data_in <= 8'hBE;
3: data_in <= 8'hC0;
4: data_in <= 8'hC2;
5: data_in <= 8'hC4;
6: data_in <= 8'hC6;
7: data_in <= 8'hC8;
endcase
if (ack_out == 1'b1) begin
i2c_state <= I2C_TOUCH5;
cmd <= I2CMASTER_STOP;
end else begin
case (nsensor)
0: data_in <= 8'hBA;
1: data_in <= 8'hBC;
2: data_in <= 8'hBE;
3: data_in <= 8'hC0;
4: data_in <= 8'hC2;
5: data_in <= 8'hC4;
6: data_in <= 8'hC6;
7: data_in <= 8'hC8;
endcase
end
end
3: cmd <= I2CMASTER_STOP;

Expand Down

0 comments on commit 46a3305

Please sign in to comment.