亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ps2_keyboard.v

?? 來自FPGA開發(fā)板的PS2開發(fā)源代碼
?? V
?? 第 1 頁 / 共 2 頁
字號:
      end

    default : m1_next_state <= m1_rx_clk_h;
  endcase
end

// State register
always @(posedge clk)
begin : m2_state_register
  if (!reset) m2_state <= m2_rx_data_ready_ack;
  else m2_state <= m2_next_state;
end

// State transition logic
always @(m2_state or rx_output_strobe or rx_read)
begin : m2_state_logic
  case (m2_state)
    m2_rx_data_ready_ack:
          begin
            rx_data_ready <= 1'b0;
            if (rx_output_strobe) m2_next_state <= m2_rx_data_ready;
            else m2_next_state <= m2_rx_data_ready_ack;
          end
    m2_rx_data_ready:
          begin
            rx_data_ready <= 1'b1;
            if (rx_read) m2_next_state <= m2_rx_data_ready_ack;
            else m2_next_state <= m2_rx_data_ready;
          end
    default : m2_next_state <= m2_rx_data_ready_ack;
  endcase
end

// This is the bit counter
always @(posedge clk)
begin
  if (   !reset
      || rx_shifting_done
      || (m1_state == m1_tx_wait_keyboard_ack)        // After tx is done.
      ) bit_count <= 0;  // normal reset
  else if (timer_60usec_done
           && (m1_state == m1_rx_clk_h)
           && (ps2_clk_s)
      ) bit_count <= 0;  // rx watchdog timer reset
  else if ( (m1_state == m1_rx_falling_edge_marker)   // increment for rx
           ||(m1_state == m1_tx_rising_edge_marker)   // increment for tx
           )
    bit_count <= bit_count + 1;
end
// This signal is high for one clock at the end of the timer count.
assign rx_shifting_done = (bit_count == `TOTAL_BITS);
assign tx_shifting_done = (bit_count == `TOTAL_BITS-1);

// This is the signal which enables loading of the shift register.
// It also indicates "ack" to the device writing to the transmitter.
assign tx_write_ack_o = (  (tx_write && (m1_state == m1_rx_clk_h))
                         ||(tx_write && (m1_state == m1_rx_clk_l))
                         );

// This is the ODD parity bit for the transmitted word.
assign tx_parity_bit = ~^tx_data;

// This is the shift register
always @(posedge clk)
begin
  if (!reset) q <= 0;
  else if (tx_write_ack_o) q <= {1'b1,tx_parity_bit,tx_data,1'b0};
  else if ( (m1_state == m1_rx_falling_edge_marker)
           ||(m1_state == m1_tx_rising_edge_marker) )
    q <= {ps2_data_s,q[`TOTAL_BITS-1:1]};
end

// This is the 60usec timer counter
always @(posedge clk)
begin
  if (~enable_timer_60usec) timer_60usec_count <= 0;
  else if (~timer_60usec_done) timer_60usec_count <= timer_60usec_count + 1;
end
assign timer_60usec_done = (timer_60usec_count == (TIMER_60USEC_VALUE_PP - 1));

// This is the 5usec timer counter
always @(posedge clk)
begin
  if (~enable_timer_5usec) timer_5usec_count <= 0;
  else if (~timer_5usec_done) timer_5usec_count <= timer_5usec_count + 1;
end
assign timer_5usec_done = (timer_5usec_count == TIMER_5USEC_VALUE_PP - 1);


// Create the signals which indicate special scan codes received.
// These are the "unlatched versions."
assign extended = (q[8:1] == `EXTEND_CODE) && rx_shifting_done;
assign released = (q[8:1] == `RELEASE_CODE) && rx_shifting_done;

// Store the special scan code status bits
// Not the final output, but an intermediate storage place,
// until the entire set of output data can be assembled.
always @(posedge clk)
begin
  if (!reset || rx_output_event)
  begin
    hold_extended <= 0;
    hold_released <= 0;
  end
  else
  begin
    if (rx_shifting_done && extended) hold_extended <= 1;
    if (rx_shifting_done && released) hold_released <= 1;
  end
end


// These bits contain the status of the two shift keys
always @(posedge clk)
begin
  if (!reset) left_shift_key <= 0;
  else if ((q[8:1] == `LEFT_SHIFT) && rx_shifting_done && ~hold_released)
    left_shift_key <= 1;
  else if ((q[8:1] == `LEFT_SHIFT) && rx_shifting_done && hold_released)
    left_shift_key <= 0;
end

always @(posedge clk)
begin
  if (!reset) right_shift_key <= 0;
  else if ((q[8:1] == `RIGHT_SHIFT) && rx_shifting_done && ~hold_released)
    right_shift_key <= 1;
  else if ((q[8:1] == `RIGHT_SHIFT) && rx_shifting_done && hold_released)
    right_shift_key <= 0;
end

assign rx_shift_key_on = left_shift_key || right_shift_key;

// Output the special scan code flags, the scan code and the ascii
always @(posedge clk)
begin
  if (!reset)
  begin
    rx_extended <= 0;
    rx_released <= 0;
    rx_scan_code <= 0;
    rx_ascii <= 0;
  end
  else if (rx_output_strobe)
  begin
    rx_extended <= hold_extended;
    rx_released <= hold_released;
    rx_scan_code <= q[8:1];
    rx_ascii <= ascii;
  end
end

// Store the final rx output data only when all extend and release codes
// are received and the next (actual key) scan code is also ready.
// (the presence of rx_extended or rx_released refers to the
// the current latest scan code received, not the previously latched flags.)
assign rx_output_event  = (rx_shifting_done
                          && ~extended 
                          && ~released
                          );

assign rx_output_strobe = (rx_shifting_done
                          && ~extended 
                          && ~released
                          && ( (TRAP_SHIFT_KEYS_PP == 0) 
                               || ( (q[8:1] != `RIGHT_SHIFT)
                                    &&(q[8:1] != `LEFT_SHIFT)
                                  )
                             )
                          );

// This part translates the scan code into an ASCII value...
// Only the ASCII codes which I considered important have been included.
// if you want more, just add the appropriate case statement lines...
// (You will need to know the keyboard scan codes you wish to assign.)
// The entries are listed in ascending order of ASCII value.
assign shift_key_plus_code = {3'b0,rx_shift_key_on,q[8:1]};
always @(shift_key_plus_code)
begin
  casez (shift_key_plus_code)
    12'h?66 : ascii <= 8'h08;  // Backspace ("backspace" key)
    12'h?0d : ascii <= 8'h09;  // Horizontal Tab
    12'h?5a : ascii <= 8'h0d;  // Carriage return ("enter" key)
    12'h?76 : ascii <= 8'h1b;  // Escape ("esc" key)
    12'h?29 : ascii <= 8'h20;  // Space
    12'h116 : ascii <= 8'h21;  // !
    12'h152 : ascii <= 8'h22;  // "
    12'h126 : ascii <= 8'h23;  // #
    12'h125 : ascii <= 8'h24;  // $
    12'h12e : ascii <= 8'h25;  // %
    12'h13d : ascii <= 8'h26;  // &
    12'h052 : ascii <= 8'h27;  // '
    12'h146 : ascii <= 8'h28;  // (
    12'h145 : ascii <= 8'h29;  // )
    12'h13e : ascii <= 8'h2a;  // *
    12'h155 : ascii <= 8'h2b;  // +
    12'h041 : ascii <= 8'h2c;  // ,
    12'h04e : ascii <= 8'h2d;  // -
    12'h049 : ascii <= 8'h2e;  // .
    12'h04a : ascii <= 8'h2f;  // /
    12'h045 : ascii <= 8'h30;  // 0
    12'h016 : ascii <= 8'h31;  // 1
    12'h01e : ascii <= 8'h32;  // 2
    12'h026 : ascii <= 8'h33;  // 3
    12'h025 : ascii <= 8'h34;  // 4
    12'h02e : ascii <= 8'h35;  // 5
    12'h036 : ascii <= 8'h36;  // 6
    12'h03d : ascii <= 8'h37;  // 7
    12'h03e : ascii <= 8'h38;  // 8
    12'h046 : ascii <= 8'h39;  // 9
    12'h14c : ascii <= 8'h3a;  // :
    12'h04c : ascii <= 8'h3b;  // ;
    12'h141 : ascii <= 8'h3c;  // <
    12'h055 : ascii <= 8'h3d;  // =
    12'h149 : ascii <= 8'h3e;  // >
    12'h14a : ascii <= 8'h3f;  // ?
    12'h11e : ascii <= 8'h40;  // @
    12'h11c : ascii <= 8'h41;  // A
    12'h132 : ascii <= 8'h42;  // B
    12'h121 : ascii <= 8'h43;  // C
    12'h123 : ascii <= 8'h44;  // D
    12'h124 : ascii <= 8'h45;  // E
    12'h12b : ascii <= 8'h46;  // F
    12'h134 : ascii <= 8'h47;  // G
    12'h133 : ascii <= 8'h48;  // H
    12'h143 : ascii <= 8'h49;  // I
    12'h13b : ascii <= 8'h4a;  // J
    12'h142 : ascii <= 8'h4b;  // K
    12'h14b : ascii <= 8'h4c;  // L
    12'h13a : ascii <= 8'h4d;  // M
    12'h131 : ascii <= 8'h4e;  // N
    12'h144 : ascii <= 8'h4f;  // O
    12'h14d : ascii <= 8'h50;  // P
    12'h115 : ascii <= 8'h51;  // Q
    12'h12d : ascii <= 8'h52;  // R
    12'h11b : ascii <= 8'h53;  // S
    12'h12c : ascii <= 8'h54;  // T
    12'h13c : ascii <= 8'h55;  // U
    12'h12a : ascii <= 8'h56;  // V
    12'h11d : ascii <= 8'h57;  // W
    12'h122 : ascii <= 8'h58;  // X
    12'h135 : ascii <= 8'h59;  // Y
    12'h11a : ascii <= 8'h5a;  // Z
    12'h054 : ascii <= 8'h5b;  // [
    12'h05d : ascii <= 8'h5c;  // \
    12'h05b : ascii <= 8'h5d;  // ]
    12'h136 : ascii <= 8'h5e;  // ^
    12'h14e : ascii <= 8'h5f;  // _    
    12'h00e : ascii <= 8'h60;  // `
    12'h01c : ascii <= 8'h61;  // a
    12'h032 : ascii <= 8'h62;  // b
    12'h021 : ascii <= 8'h63;  // c
    12'h023 : ascii <= 8'h64;  // d
    12'h024 : ascii <= 8'h65;  // e
    12'h02b : ascii <= 8'h66;  // f
    12'h034 : ascii <= 8'h67;  // g
    12'h033 : ascii <= 8'h68;  // h
    12'h043 : ascii <= 8'h69;  // i
    12'h03b : ascii <= 8'h6a;  // j
    12'h042 : ascii <= 8'h6b;  // k
    12'h04b : ascii <= 8'h6c;  // l
    12'h03a : ascii <= 8'h6d;  // m
    12'h031 : ascii <= 8'h6e;  // n
    12'h044 : ascii <= 8'h6f;  // o
    12'h04d : ascii <= 8'h70;  // p
    12'h015 : ascii <= 8'h71;  // q
    12'h02d : ascii <= 8'h72;  // r
    12'h01b : ascii <= 8'h73;  // s
    12'h02c : ascii <= 8'h74;  // t
    12'h03c : ascii <= 8'h75;  // u
    12'h02a : ascii <= 8'h76;  // v
    12'h01d : ascii <= 8'h77;  // w
    12'h022 : ascii <= 8'h78;  // x
    12'h035 : ascii <= 8'h79;  // y
    12'h01a : ascii <= 8'h7a;  // z
    12'h154 : ascii <= 8'h7b;  // {
    12'h15d : ascii <= 8'h7c;  // |
    12'h15b : ascii <= 8'h7d;  // }
    12'h10e : ascii <= 8'h7e;  // ~
    12'h?71 : ascii <= 8'h7f;  // (Delete OR DEL on numeric keypad)
    default : ascii <= 8'h2e;  // '.' used for unlisted characters.
  endcase
end


endmodule

//`undefine TOTAL_BITS
//`undefine EXTEND_CODE
//`undefine RELEASE_CODE
//`undefine LEFT_SHIFT
//`undefine RIGHT_SHIFT

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
偷拍日韩校园综合在线| 午夜av一区二区| 91高清视频免费看| 极品尤物av久久免费看| 中日韩免费视频中文字幕| 精品视频免费看| 国产a视频精品免费观看| 午夜不卡在线视频| 日韩美女精品在线| 精品国产伦一区二区三区观看方式 | 日韩精品一区二区三区视频 | 日韩视频一区二区在线观看| 成人美女视频在线观看18| 秋霞电影网一区二区| 亚洲裸体在线观看| 欧美国产精品久久| 久久综合中文字幕| 日韩一区二区三区电影| 精品视频一区 二区 三区| 91啦中文在线观看| 成人免费黄色大片| 久久国产精品99久久久久久老狼 | 欧美午夜精品电影| 成人va在线观看| 国产精品亚洲人在线观看| 日本亚洲欧美天堂免费| 亚洲无线码一区二区三区| 亚洲乱码中文字幕| 国产精品国模大尺度视频| 国产丝袜欧美中文另类| 欧美mv日韩mv亚洲| 精品国精品自拍自在线| 欧美日韩在线直播| 欧美日韩国产成人在线免费| 在线免费精品视频| 91在线无精精品入口| 波多野洁衣一区| 99国产一区二区三精品乱码| 成人午夜视频在线| 99麻豆久久久国产精品免费 | 亚洲国产经典视频| 国产精品污www在线观看| 中文字幕精品一区二区三区精品| 精品国精品国产尤物美女| 久久蜜臀精品av| 国产亚洲综合性久久久影院| 久久香蕉国产线看观看99| 国产亚洲精品精华液| 国产欧美一区二区精品性色| 亚洲国产岛国毛片在线| 中文字幕在线观看不卡视频| 中文字幕字幕中文在线中不卡视频| 国产精品美女一区二区在线观看| 综合久久久久久久| 五月天久久比比资源色| 青青草原综合久久大伊人精品 | 日韩综合在线视频| 久久福利资源站| 国产成人夜色高潮福利影视| 国产91丝袜在线观看| 色网站国产精品| 欧美精品一卡两卡| 精品久久久久久久久久久久久久久 | 中文字幕一区二区三区在线观看| 综合精品久久久| 午夜精品久久久久久久| 久草精品在线观看| 99久久精品费精品国产一区二区| 日本二三区不卡| 精品日韩一区二区三区| 中文一区二区在线观看| 亚洲黄网站在线观看| 蜜臀av一级做a爰片久久| 国产高清不卡一区二区| 色狠狠综合天天综合综合| 欧美一级在线免费| 国产精品久线观看视频| 午夜视黄欧洲亚洲| 国产不卡视频在线播放| 欧美三电影在线| 国产午夜亚洲精品不卡| 亚洲欧美二区三区| 久久91精品国产91久久小草| 99精品在线观看视频| 日韩限制级电影在线观看| 国产精品久99| 蜜乳av一区二区三区| 91在线视频播放| 日韩精品一区二区三区视频在线观看| 国产精品久久久久永久免费观看| 天天色天天爱天天射综合| 国产91在线观看| 日韩欧美在线综合网| 亚洲免费观看视频| 韩日欧美一区二区三区| 欧洲精品一区二区| 欧美国产视频在线| 久久99国产精品免费网站| 欧美在线|欧美| 欧美国产在线观看| 极品美女销魂一区二区三区| 欧美视频在线播放| 亚洲三级免费观看| 丁香婷婷综合五月| 欧美不卡123| 亚洲成av人片在线观看无码| 成人免费精品视频| 国产亚洲欧美激情| 精品一区二区三区免费毛片爱| 欧美系列在线观看| 日韩毛片高清在线播放| 国产成人日日夜夜| 久久久精品免费免费| 久久精品99国产精品日本| 精品久久99ma| 午夜不卡av在线| 欧美日韩一区二区电影| 一区二区三区精品视频| 91免费版在线| 国产精品成人一区二区艾草 | 狠狠色狠狠色合久久伊人| 欧美精选午夜久久久乱码6080| 一区精品在线播放| 国产福利一区二区| 欧美va亚洲va国产综合| 免费精品99久久国产综合精品| 欧美人牲a欧美精品| 亚洲成a人在线观看| 欧美日韩国产在线观看| 亚洲成人资源在线| 色婷婷综合久久久中文一区二区| 国产精品美女久久久久久久 | 欧美大白屁股肥臀xxxxxx| 偷窥国产亚洲免费视频| 欧美午夜精品一区二区蜜桃| 一区二区三区影院| 在线观看一区二区视频| 亚洲国产精品综合小说图片区| 色噜噜狠狠色综合欧洲selulu| 亚洲欧美日韩一区二区 | 亚洲人成在线观看一区二区| 成人精品小蝌蚪| 国产精品久久久久一区| 91影院在线免费观看| ●精品国产综合乱码久久久久| 色综合天天天天做夜夜夜夜做| 亚洲欧美日韩人成在线播放| 欧美又粗又大又爽| 日本视频一区二区三区| 欧美成人国产一区二区| 懂色av一区二区三区免费观看 | 日韩一区二区三区视频在线观看| 日韩高清电影一区| 日韩一区二区视频| 国产精品亚洲一区二区三区妖精| 国产校园另类小说区| 色综合色狠狠天天综合色| 亚洲精品国产a| 欧美理论在线播放| 国产一区二区三区蝌蚪| 国产精品毛片久久久久久久| 在线观看日韩电影| 精品一区二区在线观看| 亚洲国产精品t66y| 欧美特级限制片免费在线观看| 日本麻豆一区二区三区视频| 国产日韩欧美a| 欧美视频在线一区二区三区| 激情综合五月天| 亚洲欧美一区二区三区国产精品 | 精品久久久久久综合日本欧美| 一本久久a久久精品亚洲| 日韩福利视频导航| 国产欧美va欧美不卡在线| 一本色道久久综合亚洲91| 裸体健美xxxx欧美裸体表演| 国产精品嫩草影院com| 欧美日韩综合在线免费观看| 国产精品一区二区黑丝| 一区二区三区加勒比av| 久久久一区二区三区| 在线免费观看成人短视频| 国产一区二区三区在线观看免费视频| 中文字幕一区二区三区av| 欧美一区二区三区在线看| 不卡的av电影| 日本不卡免费在线视频| 日韩理论片网站| 精品av久久707| 欧美在线观看视频一区二区三区| 激情综合色播五月| 午夜伦理一区二区| 国产精品高清亚洲| 久久综合网色—综合色88| 欧美三级日本三级少妇99| www.亚洲在线| 黑人巨大精品欧美一区| 日精品一区二区三区| 亚洲精品中文在线观看| 色婷婷精品大在线视频|