[source]

Entity io_KeyPadScanner

CLOCK_FREQSCAN_FREQROWSCOLUMNSADD_INPUT_SYNCHRONIZERSClockstd_logicResetstd_logicRowVector[ROWS - 1 downto 0]std_logic_vectorKeyPadMatrixT_SLM[COLUMNS - 1 downto 0 , ROWS - 1 downto 0]ColumnVectorstd_logic_vector[COLUMNS - 1 downto 0]

Block Diagram of io_KeyPadScanner

This module drives a one-hot encoded column vector to read back a rows vector. By scanning column-by-column it's possible to extract the current button state of the whole keypad. The scanner uses high-active logic. The keypad size and scan frequency can be configured. The outputed signal matrix is not debounced.

Generics

Name

Type

Default

Description

CLOCK_FREQ

FREQ

100 MHz

SCAN_FREQ

FREQ

1 kHz

ROWS

positive

4

COLUMNS

positive

4

ADD_INPUT_SYNCHRONIZERS

boolean

TRUE

Ports

Name

Type

Direction

Description

Clock

std_logic

in

Reset

std_logic

in

KeyPadMatrix

T_SLM

out

Matrix interface

ColumnVector

std_logic_vector

out

KeyPad interface

RowVector

std_logic_vector

in