15
KeyScan
15.1 KYS introduction
The KYS (Key Scan) module is used to scan the matrix keyboard to obtain key values. It periodically scans the
keyboard connection pins and generates an interrupt as soon as it finds a key press.
15.2 KYS main features
• Configurable number of rows and columns, up to 8 rows*20 columns of matrix keyboard
• Store up to four key values
• Support key interrupt
15.3 KYS function description
15.3.1 Configurable number of rows and columns
The number of rows and columns of the matrix keyboard can be configured through the bits <ROW_NUM> and
<COL_NUM> of the register KS_CTRL, and the configuration value is the actual value minus one. The maximum
number of rows supports 8 rows, and the maximum number of columns supports 20 columns.
15.3.2 GPIO selection
Since the button scan is fixed from the GPIO pins with the functions of ROW_0 and COL_0, the row pins need to be
selected sequentially from the GPIO with the function of ROW_0, that is, from any one of GPIO0/GPIO8/GPIO16/GPIO24.
The column pins need to be selected in order from the GPIO with the function of COL_0, that is, from any one of GPIO0/GPIO20.
BL702/704/706 Reference Manual
277/ 375
@2021 Bouffalo Lab