summaryrefslogtreecommitdiff
path: root/utils/nwztools/plattools/nwz_keys.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-10-19 17:03:52 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2016-10-19 17:09:04 +0200
commitba91ff10e8c974e50e429d072641ac5e0acdd72e (patch)
treea8ef07988845f67e22dfed9bef3602126e831da0 /utils/nwztools/plattools/nwz_keys.h
parent13d892eef1c78d14314b7d3a2cb9035e9ba1420c (diff)
downloadrockbox-ba91ff10e8c974e50e429d072641ac5e0acdd72e.tar.gz
rockbox-ba91ff10e8c974e50e429d072641ac5e0acdd72e.zip
nwztools: add a new plattools directory with code to run on the device
This is code is intended to development into a library of code for the NWZ that will be useful to write the "bootloader" on those device. At the same time, it comes with test programs that are easy to run in firmware upgrade mode and also provide a great test bench for the library. At the moment, two test programs are available: - test_display: simply prints two messages using /usr/bin/lcdmsg - test_keys: displays input key event Change-Id: I9d214894ffc9127b528fcdd3eb5d6b61f4e657a7
Diffstat (limited to 'utils/nwztools/plattools/nwz_keys.h')
-rw-r--r--utils/nwztools/plattools/nwz_keys.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/utils/nwztools/plattools/nwz_keys.h b/utils/nwztools/plattools/nwz_keys.h
new file mode 100644
index 0000000000..8228e5b620
--- /dev/null
+++ b/utils/nwztools/plattools/nwz_keys.h
@@ -0,0 +1,60 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2016 Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef __NWZ_KEYS_H__
22#define __NWZ_KEYS_H__
23
24/* The Sony icx_key driver reports keys via the /dev/input/event0 device and
25 * abuses the standard struct input_event. The input_event.code is split into
26 * two parts:
27 * - one part giving the code of the key just pressed/released
28 * - one part is a bitmap of various keys (such as HOLD)
29 * The status of the HOLD can be queried at any time by reading the state of
30 * the first LED.
31 */
32
33/* key code and mask */
34#define NWZ_KEY_MASK 0x1f
35#define NWZ_KEY_PLAY 0
36#define NWZ_KEY_RIGHT 1
37#define NWZ_KEY_LEFT 2
38#define NWZ_KEY_UP 3
39#define NWZ_KEY_DOWN 4
40#define NWZ_KEY_ZAPPIN 5
41#define NWZ_KEY_AD0_6 6
42#define NWZ_KEY_AD0_7 7
43/* special "key" when event is for bitmap key, like HOLD */
44#define NWZ_KEY_NONE 15
45#define NWZ_KEY_VOL_DOWN 16
46#define NWZ_KEY_VOL_UP 17
47#define NWZ_KEY_BACK 18
48#define NWZ_KEY_OPTION 19
49#define NWZ_KEY_BT 20
50#define NWZ_KEY_AD1_5 21
51#define NWZ_KEY_AD1_6 22
52#define NWZ_KEY_AD1_7 23
53
54/* bitmap of other things */
55#define NWZ_KEY_NMLHP_MASK 0x20
56#define NWZ_KEY_NCHP_MASK 0x40
57#define NWZ_KEY_HOLD_MASK 0x80
58#define NWZ_KEY_NC_MASK 0x100
59
60#endif /* __NWZ_KEYS_H__ */