summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h')
-rw-r--r--zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h b/zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h
new file mode 100644
index 0000000000..0117fea09c
--- /dev/null
+++ b/zephyr/test/drivers/keyboard_scan/include/keyboard_test_utils.h
@@ -0,0 +1,19 @@
+/* Copyright 2022 The ChromiumOS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * @brief Press or release a key through the keyboard emulator
+ *
+ * @param row Key row
+ * @param col Key column
+ * @param pressed 1 if pressed, 0 otherwise
+ * @return int 0 if successful
+ */
+int emulate_keystate(int row, int col, int pressed);
+
+/**
+ * @brief Clears any pressed keys in the keyboard emulator
+ */
+void clear_emulated_keys(void);