summaryrefslogtreecommitdiff
path: root/include/keyboard_8042.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/keyboard_8042.h')
-rw-r--r--include/keyboard_8042.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/keyboard_8042.h b/include/keyboard_8042.h
index 00fdc9901b..d18a81562a 100644
--- a/include/keyboard_8042.h
+++ b/include/keyboard_8042.h
@@ -8,8 +8,10 @@
#ifndef __CROS_EC_KEYBOARD_8042_H
#define __CROS_EC_KEYBOARD_8042_H
-#include "common.h"
+#include <stddef.h>
+
#include "button.h"
+#include "common.h"
/**
* Called by power button handler and button interrupt handler.
@@ -28,4 +30,26 @@ void button_state_changed(enum keyboard_button_type button, int is_pressed);
*/
void keyboard_host_write(int data, int is_cmd);
+
+/* Utilities for scan code and make code. */
+
+enum scancode_set_list {
+ SCANCODE_GET_SET = 0,
+ SCANCODE_SET_1,
+ SCANCODE_SET_2,
+ SCANCODE_SET_3,
+ SCANCODE_MAX = SCANCODE_SET_3,
+};
+
+/**
+ * Returns a board-specific translated make code.
+ *
+ * @param make_code 8042 make code
+ * @param pressed Whether the key was pressed
+ * @param code_set 8042 scan code set
+ */
+uint16_t keyboard_board_translate(
+ uint16_t make_code, int8_t pressed,
+ enum scancode_set_list code_set);
+
#endif /* __CROS_EC_KEYBOARD_8042_H */