Files
OpenCellular/include/button.h
ChromeOS Developer 86eea83cee 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 <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184544
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit f6426cc21c20a4f876cff28b9ce7e3115f0b054a)

Change-Id: I4face9bf0797a91ec8bef390093aab8e3d8f97ab
Reviewed-on: https://chromium-review.googlesource.com/185243
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
2014-02-07 04:13:18 +00:00

45 lines
926 B
C

/* Copyright (c) 2014 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.
*/
/* Button API for Chrome EC */
#ifndef __CROS_EC_BUTTON_H
#define __CROS_EC_BUTTON_H
#include "common.h"
#include "gpio.h"
#define BUTTON_FLAG_ACTIVE_HIGH (1 << 0)
enum keyboard_button_type {
KEYBOARD_BUTTON_POWER = 0,
KEYBOARD_BUTTON_VOLUME_DOWN,
KEYBOARD_BUTTON_VOLUME_UP,
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 */