blob: 9f552f5ac1788f90898afc2c33bedaaf3a5f0a7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/* 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.
*/
#ifndef __CROS_INCLUDE_EC_KEYBOARD_H
#define __CROS_INCLUDE_EC_KEYBOARD_H
#include "cros_ec/include/ec_common.h"
enum EcScancodeSet {
EC_SCANCODE_GET_SET = 0,
EC_SCANCODE_SET_1,
EC_SCANCODE_SET_2,
EC_SCANCODE_SET_3,
EC_SCANCODE_MAX = EC_SCANCODE_SET_3,
};
/* The initialize code of keyboard lib. Called by core main. */
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.
*/
typedef EcError (*EcKeyboardMatrixCallback)(
int8_t row, int8_t col, int8_t pressed,
enum EcScancodeSet code_set, 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_INCLUDE_EC_KEYBOARD_H */
|