summaryrefslogtreecommitdiff
path: root/zephyr/include/emul/emul_kb_raw.h
blob: ba4ea8e58fb4839feea8ba3fbd48661f78b5a36f (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
/* Copyright 2022 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.
 */

/**
 * @file
 *
 * @brief Backend API for kb raw emulator
 */

#ifndef __EMUL_KB_RAW_H
#define __EMUL_KB_RAW_H

struct device;

/**
 * @brief Raw keyboard emulator backend API
 * @defgroup kb_raw_emul raw keyboard emulator
 * @{
 *
 * The raw keyboard emulator allows for emulating a physical keyboard.
 */

/**
 * @brief Sets or clears a key.
 *
 * @param dev Pointer to kb_raw emulator device.
 * @param row The keyboard scan row.
 * @param col The keyboard scan column.
 * @param pressed If non-zero, set that key row/col as pressed, if zero it is
 *                unpressed.
 * @return 0 for success, -EINVAL for an invalid param.
 */
int emul_kb_raw_set_kbstate(const struct device *dev, uint8_t row, uint8_t col,
			    int pressed);

/**
 * @}
 */

#endif /* __EMUL_KB_RAW_H */