From 86eea83ceee8004c6120a759b35cf88745e548a7 Mon Sep 17 00:00:00 2001 From: ChromeOS Developer Date: Sat, 11 Jan 2014 11:13:39 -0800 Subject: Add support for extra buttons not on the keyboard BUG=chrome-os-partner:24370 BRANCH=tot TEST=Run button unit test. Orig-Change-Id: I61b4a6624d62831ce0bfdf7a0f36a45349b37f96 Signed-off-by: Dave Parker Reviewed-on: https://chromium-review.googlesource.com/184544 Reviewed-by: Randall Spangler (cherry picked from commit f6426cc21c20a4f876cff28b9ce7e3115f0b054a) Change-Id: I4face9bf0797a91ec8bef390093aab8e3d8f97ab Reviewed-on: https://chromium-review.googlesource.com/185243 Tested-by: Randall Spangler Reviewed-by: Bill Richardson Commit-Queue: Randall Spangler --- include/button.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/button.h') diff --git a/include/button.h b/include/button.h index e8344b308f..eedf7974f8 100644 --- a/include/button.h +++ b/include/button.h @@ -21,4 +21,24 @@ enum keyboard_button_type { KEYBOARD_BUTTON_COUNT }; +struct button_config { + const char *name; + enum keyboard_button_type type; + enum gpio_signal gpio; + uint32_t debounce_us; + int flags; +}; + +/* + * Defined in board.c. Should be CONFIG_BUTTON_COUNT elements long. + */ +extern const struct button_config buttons[]; + +/* + * Interrupt handler for button. + * + * @param signal Signal which triggered the interrupt. + */ +void button_interrupt(enum gpio_signal signal); + #endif /* __CROS_EC_BUTTON_H */ -- cgit v1.2.1