2023-09-07 10:04:01 +02:00
|
|
|
.. zephyr:code-sample:: kscan
|
|
|
|
:name: KSCAN
|
|
|
|
:relevant-api: kscan_interface timer_apis
|
2019-10-07 19:44:33 +02:00
|
|
|
|
2023-09-07 10:04:01 +02:00
|
|
|
Use the KSCAN API to read key presses and releases on a keyboard matrix.
|
2019-10-07 19:44:33 +02:00
|
|
|
|
|
|
|
Overview
|
|
|
|
********
|
|
|
|
|
2020-03-13 19:02:31 +01:00
|
|
|
This sample demonstrates how to use the :ref:`KSCAN API <kscan_api>`.
|
2019-10-07 19:44:33 +02:00
|
|
|
Callbacks are registered that will write to the console indicating KSCAN events.
|
|
|
|
These events indicate key presses and releases.
|
|
|
|
|
|
|
|
Building and Running
|
|
|
|
********************
|
|
|
|
|
|
|
|
The sample can be built and executed on boards supporting a Keyboard Matrix.
|
2020-09-08 17:35:16 +02:00
|
|
|
It requires a correct fixture setup. Please connect a Keyboard Matrix to
|
|
|
|
exercise the functionality (you need to obtain the right keymap from the vendor
|
|
|
|
because they vary across different manufactures).
|
2021-01-13 19:08:34 +01:00
|
|
|
For the correct execution of that sample in twister, add into boards's
|
2020-09-08 17:35:16 +02:00
|
|
|
map-file next fixture settings::
|
|
|
|
|
|
|
|
- fixture: fixture_connect_keyboard
|
2019-10-07 19:44:33 +02:00
|
|
|
|
|
|
|
Sample output
|
|
|
|
=============
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
KSCAN test with a Keyboard matrix
|
|
|
|
Note: You are expected to see several callbacks
|
|
|
|
as you press and release keys!
|