summaryrefslogtreecommitdiff
path: root/include/keyboard_config.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-21 13:28:11 -0700
committerChromeBot <chrome-bot@google.com>2013-03-22 11:24:29 -0700
commit10ac310605b32bf7fbd6fc83066e72e1e70a803c (patch)
treef7784c6416902032d6fd49164f9e8c1fbc94aa85 /include/keyboard_config.h
parent743c05f01f8f2b19dbf565bee645076fff75c42d (diff)
downloadchrome-ec-10ac310605b32bf7fbd6fc83066e72e1e70a803c.tar.gz
Move keyboard dimension and key constants to keyboard_config.h
These were previously duplicated between multiple keyboard_scan.c and board.c files, and there were a bunch of different constants #defined to be 13. BUG=chrome-os-partner:18360 BRANCH=none TEST=compile all boards; test keyboard on spring and link Change-Id: I91bf9d56d2a56ff25ff307ff10883ca87b6937e5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46165
Diffstat (limited to 'include/keyboard_config.h')
-rw-r--r--include/keyboard_config.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/keyboard_config.h b/include/keyboard_config.h
new file mode 100644
index 0000000000..ff2eded50c
--- /dev/null
+++ b/include/keyboard_config.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2013 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.
+ */
+
+/* Keyboard configuration constants for Chrome EC */
+
+#ifndef __CROS_EC_KEYBOARD_CONFIG_H
+#define __CROS_EC_KEYBOARD_CONFIG_H
+
+#include "common.h"
+
+/* Keyboard matrix is 13 output columns x 8 input rows */
+#define KEYBOARD_COLS 13
+#define KEYBOARD_ROWS 8
+
+/* Columns and masks for keys we particularly care about */
+#define KEYBOARD_COL_DOWN 11
+#define KEYBOARD_MASK_DOWN 0x40
+#define KEYBOARD_COL_ESC 1
+#define KEYBOARD_MASK_ESC 0x02
+#define KEYBOARD_COL_KEY_H 6
+#define KEYBOARD_MASK_KEY_H 0x02
+#define KEYBOARD_COL_KEY_R 3
+#define KEYBOARD_MASK_KEY_R 0x80
+#define KEYBOARD_COL_LEFT_ALT 10
+#define KEYBOARD_MASK_LEFT_ALT 0x40
+#define KEYBOARD_COL_REFRESH 2
+#define KEYBOARD_MASK_REFRESH 0x04
+#define KEYBOARD_COL_RIGHT_ALT 10
+#define KEYBOARD_MASK_RIGHT_ALT 0x01
+#define KEYBOARD_COL_VOL_UP 4
+#define KEYBOARD_MASK_VOL_UP 0x01
+
+#endif /* __CROS_EC_KEYBOARD_CONFIG_H */