3 `define CLK_DIV `IN_CLK / `OUT_CLK
4 `define MMAP_ADDR 16'hFF50
14 reg [7:0] data_stor = 0;
15 reg [15:0] clkdiv = 0;
18 reg [3:0] diqing = 4'b0000;
20 wire new = (wr) && (!have_data) && (addr == `MMAP_ADDR);
22 always @ (negedge clk)
24 `define FUQING 4'b1010
25 /* deal with diqing */
30 end else if (clkdiv == 0) begin
35 4'b0001: serial <= data_stor[0];
36 4'b0010: serial <= data_stor[1];
37 4'b0011: serial <= data_stor[2];
38 4'b0100: serial <= data_stor[3];
39 4'b0101: serial <= data_stor[4];
40 4'b0110: serial <= data_stor[5];
41 4'b0111: serial <= data_stor[6];
42 4'b1000: serial <= data_stor[7];
44 4'b1010: have_data <= 0;
49 /* deal with clkdiv */
50 if((new && !have_data) || clkdiv == `CLK_DIV)