PoC.io.pmod.KYPD

This module drives a 4-bit one-cold encoded column vector to read back a 4-bit rows vector. By scanning column-by-column it’s possible to extract the current button state of the whole keypad. This wrapper converts the high-active signals from PoC.io.KeypadScanner to low-active signals for the pmod. An additional debounce circuit filters the button signals. The scan frequency and bounce time can be configured.

Entity Declaration:

 1  generic (
 2    CLOCK_FREQ    : FREQ        := 100 MHz;
 3    SCAN_FREQ     : FREQ        := 1 kHz;
 4    BOUNCE_TIME   : T_TIME      := 10.0e-3
 5  );
 6  port (
 7    Clock         : in  std_logic;
 8    Reset         : in  std_logic;
 9    -- Matrix interface
10    Keys          : out T_PMOD_KYPD_KEYPAD;
11    -- KeyPad interface
12    Columns_n     : out std_logic_vector(3 downto 0);
13    Rows_n        : in  std_logic_vector(3 downto 0)
14  );
15end entity;