state <= state+1;
end
8'h18:
begin
scl <= 1'b1;
state <= state+1;
end
8'h19:
begin
state <= state+1;
end
8'h1A:
begin
scl <= 1'b0;
state <= state+1;
end
8'h1B:
begin
sdai <= ldata[1];
state <= state+1;
end
8'h1C:
begin
scl <= 1'b1;
state <= state+1;
end
8'h1D:
begin
state <= state+1;
end
8'h1E:
begin
scl <= 1'b0;
state <= state+1;
end
8'h1F:
begin
sdai <= ldata[0];
state <= state+1;
end
8'h20:
begin
scl <= 1'b1;
state <= state+1;
end
8'h21:
begin
state <= state+1;
end
8'h22:
begin
scl <= 1'b0;
state <= state+1;
end
8'h23: // Acknowledge bit
begin
state <= state+1;
end
8'h24:
begin
scl <= 1'b1;
state <= state+1;
end
8'h25:
begin
state <= state+1;
end
8'h26:
begin
scl <= 1'b0;
if (load)
begin
ldata <= data;
ack <= 1'b1;
state <= 3;
end
else
state <= state+1;
end
8'h27:
begin
sdai <= 1'b0;
state <= state+1;
end
8'h28:
begin
scl <= 1'b1;
state <= state+1;
end
8'h29:
begin
sdai <= 1'b1;
state <= 0;
end
endcase
endmodule