summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/ibasso/button-ibasso.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/ibasso/button-ibasso.h')
-rw-r--r--firmware/target/hosted/ibasso/button-ibasso.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/firmware/target/hosted/ibasso/button-ibasso.h b/firmware/target/hosted/ibasso/button-ibasso.h
new file mode 100644
index 0000000000..09c09e7c83
--- /dev/null
+++ b/firmware/target/hosted/ibasso/button-ibasso.h
@@ -0,0 +1,61 @@
1/***************************************************************************
2 * __________ __ ___
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2014 by Ilia Sergachev: Initial Rockbox port to iBasso DX50
10 * Copyright (C) 2014 by Mario Basister: iBasso DX90 port
11 * Copyright (C) 2014 by Simon Rothen: Initial Rockbox repository submission, additional features
12 * Copyright (C) 2014 by Udo Schläpfer: Code clean up, additional features
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23
24
25#ifndef _BUTTON_IBASSO_H_
26#define _BUTTON_IBASSO_H_
27
28
29#include <sys/types.h>
30
31
32/* /dev/input/event0 */
33#define EVENT_CODE_BUTTON_PWR 116
34#define EVENT_CODE_BUTTON_PWR_LONG 117
35
36/* /dev/input/event1 */
37#define EVENT_CODE_BUTTON_VOLPLUS 158
38#define EVENT_CODE_BUTTON_VOLMINUS 159
39#define EVENT_CODE_BUTTON_REV 160
40#define EVENT_CODE_BUTTON_PLAY 161
41#define EVENT_CODE_BUTTON_NEXT 162
42
43#define EVENT_VALUE_BUTTON_PRESS 1
44#define EVENT_VALUE_BUTTON_RELEASE 0
45
46
47/*
48 Handle hardware button events.
49 code: Input event code.
50 value: Input event value.
51 last_btns: Last known pressed buttons.
52 Returns: Currently pressed buttons as bitmask (BUTTON_ values in button-target.h).
53*/
54int handle_button_event(__u16 code, __s32 value, int last_btns);
55
56
57/* Clean up the button device handler. */
58void button_close_device(void);
59
60
61#endif