]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - PS2Button.v
Semi-working, but prone to anus, keyboard driver
[fpgaboy.git] / PS2Button.v
index e65226c37b6903b94d2e48e8504ff5e6fa73d277..169346c73335883fede324d1afb2bd4404833e84 100644 (file)
@@ -1,26 +1,20 @@
 module PS2Button(
        input inclk,
        input indata,
-       input rst,
-       output outclk,
-       output outdata,
-       output reg [7:0] buttons
+       output wire [7:0] buttons
        );
 
-       assign outdata = 1'b1;
-       assign outclk = 1'b1;
-
-       reg bitcount [3:0] = 0;
-       reg [7:0] key;
-       reg keyarrow, keyup, parity;
-       reg key_a,key_b,key_st,key_sel,key_up,key_dn,key_l,key_r;
+       reg [3:0] bitcount = 0;
+       reg [7:0] key = 0;
+       reg keyarrow = 0, keyup = 0, parity = 0;
+       reg key_a = 0,key_b = 0,key_st = 0,key_sel = 0,key_up = 0,key_dn = 0,key_l = 0,key_r = 0;
 
        assign buttons = {key_st,key_sel,key_b,key_a,key_dn,key_up,key_l,key_r};
 
        always @ (negedge inclk) begin
                if(bitcount == 10) begin
                        bitcount <= 0;
-                       if(parity == (^ key)) begin
+                       if(parity != (^ key)) begin
                                if(keyarrow) begin
                                        keyarrow <= 0;
                                        case(key)
This page took 0.028583 seconds and 4 git commands to generate.