dso_keyboard.v

来自「本文件用于spi接口的键盘扫描模块」· Verilog 代码 · 共 42 行

V
42
字号
module dso_keyboard(clk,
					clr,
					din,reset,
					addr_bus,ncs_bus,noe_bus,nwe_bus,dat_bus,
					wr_enable,
					clk500k);
	input       clk;
	input       clr;
	input       din;
	input[5:0]  addr_bus; 
	input       ncs_bus;
	input       noe_bus;
	input       nwe_bus;
	inout[7:0]  dat_bus;
	output      reset;
	output      clk500k;
	output      wr_enable;
	
	//wire        clr;
	wire[7:0]   key_data;
	wire        wr_enable;
	wire        key_flag;
	wire[7:0]   key_value;
	wire        rd_enable;
		
	//assign clr = 1'b0;
	
	key_comp  key_comp_inst(.clk(clk),.clr(clr),.din(din),.reset(reset),
							.clk500k(clk500k),.key_data(key_data),
							.key_enable(wr_enable));
							
	key_arm_rd  key_arm_rd_inst(.clk(clk),.clr(clr),.key_value(key_value),
							.key_flag(key_flag),
							.addr(addr_bus),.ncs(ncs_bus),.nwe(nwe_bus),
							.data(dat_bus),.rd_enable(rd_enable));
		
	//Syn FIFO	
	key_fifo  key_fifo_inst(.clock(clk),.data(key_data),.rdreq(rd_enable),
							.wrreq(wr_enable),.empty(key_flag),.full(),
							.q(key_value));
			
endmodule

⌨️ 快捷键说明

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