⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyboard.v

📁 ps2_键盘控制器源码verilog源码
💻 V
字号:
////////////////////////////////////////////////////////////////////////////////
// *****************************************************************************
// *  RICHIC CONFIDENTIAL PROPRIETARY NOTE                                     *
// *                                                                           *
// *  This software contains information confidential and proprietary to       *
// *  RicHic Inc.It shall not be reproduced in whole or in part or transferred *
// *  to other documents, or disclosed to third parties, or used for any       *
// *  purpose other than that for which it was obtained, without the prior     *
// *  written consent of RicHic Inc.                                           *
// *             (c) 2003, 2004, 2005 RicHic Inc.                              *
// *                All rights reserved                                        * 
/******************************************************************************/


module keyboard(
    ps2k_clk,
    ps2k_data,
    seg,    
    clk,
    rst_n // synthesis attribute clock_buffer of rst_n is ibufg;    
    );

inout               ps2k_clk;
inout               ps2k_data;
output  [11:0]      seg ;
input               clk;
input               rst_n; 

wire    [6 :0]      led ;
wire    [4 :0]      segcode;
wire    [3 :0]      hex;
wire    [7:0]       rx_scan_code;
wire    [7:0]       rx_ascii;

  dynamic_hex dynamic_hex_inst(
    .hex    (hex),
    .segcode(segcode),
    
    .clk    (clk    ),
    .rst_n  (rst_n  ),
    .data   ({rx_scan_code,rx_ascii}),
    .dot    (4'b0000)
    );

  hex2led_common_cathode hex2led_inst (
    .hex(hex), 
    .led(led)
    ) ;            
                
  led2seg led2seg_inst(
    .seg    (seg),
    .led    (led),
    .segcode(segcode) 
    );

wire    rx_extended;
wire    rx_released;
wire    rx_shift_key_on;
wire    rx_data_ready;
wire    rx_read;
wire    [7:0] tx_data;
wire    tx_write;
wire    tx_write_ack_o;
wire    tx_error_no_keyboard_ack;

ps2_keyboard ps2_keyboard_inst(
    .clk        (clk    ),
    .reset      (!rst_n ),
    .ps2_clk    (ps2k_clk),
    .ps2_data   (ps2k_data),
    .rx_extended(rx_extended),
    .rx_released(rx_released),
    .rx_shift_key_on(rx_shift_key_on),
    .rx_scan_code(rx_scan_code),
    .rx_ascii(rx_ascii),
    .rx_data_ready(rx_data_ready),       // rx_read_o
    .rx_read(rx_read),             // rx_read_ack_i
    .tx_data(tx_data),
    .tx_write(tx_write),
    .tx_write_ack_o(tx_write_ack_o),
    .tx_error_no_keyboard_ack(tx_error_no_keyboard_ack)
    );

endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -