summaryrefslogtreecommitdiff
path: root/cros_ec/include/ec_keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'cros_ec/include/ec_keyboard.h')
-rw-r--r--cros_ec/include/ec_keyboard.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/cros_ec/include/ec_keyboard.h b/cros_ec/include/ec_keyboard.h
index 4f00209953..2c8290fa0b 100644
--- a/cros_ec/include/ec_keyboard.h
+++ b/cros_ec/include/ec_keyboard.h
@@ -1,13 +1,14 @@
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
+ *
+ * The functions implemented by keyboard component of EC core.
*/
-/* Keyboard emulation */
-
-#ifndef __CROS_EC_KEYBOARD_H
-#define __CROS_EC_KEYBOARD_H
+#ifndef __CROS_INCLUDE_EC_KEYBOARD_H
+#define __CROS_INCLUDE_EC_KEYBOARD_H
+#include "cros_ec/include/ec_common.h"
/* The initialize code of keyboard lib. Called by core main. */
EcError EcKeyboardInit();
@@ -15,12 +16,19 @@ EcError EcKeyboardInit();
/* Register the board-specific keyboard matrix translation function.
* The callback function accepts col/row and returns the scan code.
+ *
+ * Note that *scan_code must be at least 4 bytes long to store maximum
+ * possible sequence.
*/
-EcError EcKeyboardMatrixRegister(
- int8_t col_num, int8_t row_num,
- EcError (*callback)(
- int8_t column, int8_t row, int8_t pressed,
- uint8_t *scan_code, int32_t* len));
+typedef EcError (*EcKeyboardMatrixCallback)(
+ int8_t row, int8_t col, int8_t pressed,
+ uint8_t *scan_code, int32_t* len);
+
+EcError EcKeyboardMatrixRegisterCallback(
+ int8_t row_num, int8_t col_num,
+ EcKeyboardMatrixCallback callback);
+
+#define MAX_SCAN_CODE_LEN 4
-#endif /* __CROS_EC_KEYBOARD_H */
+#endif /* __CROS_INCLUDE_EC_KEYBOARD_H */