eink_154.v 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. module eink(red, black, clk_24khz, DC, CS, DIN, RST, BUSY);
  2. input red, black, clk_24khz;
  3. output DC, CS, DIN, RST, BUSY, eink_clk;
  4. reg dc_r, cs_r, din_r, rst_r, busy_r;
  5. reg [4:0] counter = 5'b0;
  6. //1st step
  7. reg [7:0] sw_reset_c = 8'h12;
  8. //BUSY HIGH
  9. //wait 10 ms
  10. reg [7:0] driver_output_c = 8'h01;
  11. reg [23:0] driver_d = 24'hC70001;
  12. reg [7:0] data_entry_c = 8'h11;
  13. reg [7:0] entry_d = 8'h01;
  14. reg [7:0] ram_sec_c = 8'h44;
  15. reg [7:0] ram_sec_d = 8'h0018;
  16. reg [7:0] ram_sep_c = 8'h45;
  17. reg [31:0] ram_sep_d = 32'hC7000000;
  18. reg [7:0] border_c = 8'h3C;
  19. reg [7:0] border_d = 8'h05;
  20. reg [7:0] ram_acx_c = 8'h4E;
  21. reg [7:0] ram_acx_d = 8'h00;
  22. reg [7:0] ram_acy_c = 8'h4F;
  23. reg [7:0] ram_acy_d = 8'hC700;
  24. reg [7:0] black_c = 8'h10;
  25. reg [40000:0] screen_black=black; //200x200/16 = 2500
  26. reg [7:0] red_c = 8'h13;
  27. reg [40000:0] screen_red=red;
  28. reg [7:0] sleep_c = 8'h10;
  29. //BUSY high
  30. assign DIN = din_r;
  31. assign CS = cs_r;
  32. assign DC = dc_r;
  33. assign RST = rst_r;
  34. assign BUSY = busy_r;
  35. always @(red or black)
  36. begin
  37. CS=1'b0;
  38. counter = 14'b0;
  39. end
  40. always @(posedge clk_24khz)
  41. counter = counter + 1;
  42. always @(!CS && posedge clk_24khz)
  43. begin
  44. din_r = ;
  45. end
  46. endmodule