comparison chipsetsw/drivers/drv_app/kpd/kpd_virtual_key_table_def.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /**
2 * @file kpd_virtual_key_table_def.h
3 *
4 * Definition of the keypad tables.
5 * ***********************************************************************
6 * * This file must be included only by kpd_virtual_key_table_mgt.c file.*
7 * ***********************************************************************
8 * Tables have to be modified according to the keypad hardwire.
9 *
10 * @author Laurent Sollier (l-sollier@ti.com)
11 * @version 0.1
12 */
13
14 /*
15 * History:
16 *
17 * Date Author Modification
18 * ----------------------------------------
19 * 11/02/2001 L Sollier Create
20 *
21 *
22 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
23 */
24
25 #ifndef _KPD_VIRTUAL_KEY_TABLE_DEF_H_
26 #define _KPD_VIRTUAL_KEY_TABLE_DEF_H_
27
28 #ifndef _WINDOWS
29 #include "config/board.cfg"
30 #endif
31
32 #include "kpd/kpd_cfg.h"
33
34
35 /**
36 * @name Internal types
37 *
38 * Types used in implementation functions.
39 *
40 */
41 /*@{*/
42
43 /** Definition of the link between one virtual key and its associated ASCII value
44 * according to the mode.
45 * Important note: the variable virtual_ascii_table is defined at the compilation
46 * as a link from virtual key Id, but for better performance, the function kpd_initialize_ascii_table
47 * modify the table and and set a link from physical key Id to avoid an indirection, and so
48 * losing time to search in all the table.
49 */
50 typedef struct { T_KPD_VIRTUAL_KEY_ID key_id;
51 char* default_value_p;
52 char* alphanumeric_value_p;
53 } T_VIRTUAL_ASCII;
54
55 /** Table for definition of the link between all virtual keys and theirs associated
56 * ASCII value according to the mode.
57 */
58 typedef T_VIRTUAL_ASCII T_VIRTUAL_ASCII_TABLE[KPD_NB_PHYSICAL_KEYS];
59
60 /**
61 * Definition of the link between virtual and physical key according to the mode
62 * used by the client.
63 */
64 typedef T_KPD_VIRTUAL_KEY_ID T_VPM_TABLE[KPD_NB_PHYSICAL_KEYS][KPD_NB_MODE+1];
65
66 /*@}*/
67
68
69
70 /* Definition of the static variable which define the link between physical
71 and virtual keys. The position of the physical key Id in the table is
72 defined by their value. if KPD_PKEY_MISC is defined to 8, its position
73 in the table will be the eighth. The function kpd_vpm_table_is_valid
74 check this condition.
75 It's unauthorized to define two same virtual key Id in default mode
76 (except KPD_KEY_NULL). No verification is done on this point. */
77 #if (BOARD == 7) || (BOARD == 8) || (BOARD == 9)
78 static T_VPM_TABLE vpm_table =
79 /* Physical key Id, Default mode, Alphanumeric mode, Config mode */
80 { { KPD_PKEY_0, KPD_KEY_0, KPD_KEY_ABC, KPD_KEY_NULL},
81 { KPD_PKEY_1, KPD_KEY_1, KPD_KEY_DEF, KPD_KEY_NULL},
82 { KPD_PKEY_2, KPD_KEY_2, KPD_KEY_GHI, KPD_KEY_NULL},
83 { KPD_PKEY_3, KPD_KEY_3, KPD_KEY_JKL, KPD_KEY_NULL},
84 { KPD_PKEY_4, KPD_KEY_4, KPD_KEY_MNO, KPD_KEY_NULL},
85 { KPD_PKEY_5, KPD_KEY_5, KPD_KEY_PQR, KPD_KEY_NULL},
86 { KPD_PKEY_6, KPD_KEY_6, KPD_KEY_ST, KPD_KEY_NULL},
87 { KPD_PKEY_7, KPD_KEY_7, KPD_KEY_UV, KPD_KEY_NULL},
88 { KPD_PKEY_8, KPD_KEY_8, KPD_KEY_WX, KPD_KEY_NULL},
89 { KPD_PKEY_9, KPD_KEY_9, KPD_KEY_YZ, KPD_KEY_NULL},
90 { KPD_PKEY_UP, KPD_KEY_UP, KPD_KEY_UP, KPD_KEY_NULL},
91 { KPD_PKEY_DOWN, KPD_KEY_DOWN, KPD_KEY_DOWN, KPD_KEY_NULL},
92 { KPD_PKEY_SOFT_LEFT, KPD_KEY_SOFT_LEFT, KPD_KEY_SOFT_LEFT, KPD_KEY_NULL},
93 { KPD_PKEY_SOFT_RIGHT, KPD_KEY_SOFT_RIGHT, KPD_KEY_SOFT_RIGHT, KPD_KEY_NULL},
94 { KPD_PKEY_GREEN, KPD_KEY_CONNECT, KPD_KEY_CONNECT, KPD_KEY_NULL},
95 { KPD_PKEY_RED, KPD_KEY_DISCONNECT, KPD_KEY_DISCONNECT, KPD_KEY_NULL},
96 { KPD_PKEY_DIESE, KPD_KEY_DIESE , KPD_KEY_DIESE, KPD_KEY_NULL},
97 { KPD_PKEY_STAR, KPD_KEY_STAR, KPD_KEY_STAR, KPD_KEY_NULL}};
98 #elif (BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (defined _WINDOWS)
99 static T_VPM_TABLE vpm_table =
100 /* Physical key Id, Default mode, Alphanumeric mode, Config mode */
101 { { KPD_PKEY_0, KPD_KEY_0, KPD_KEY_ABC, KPD_KEY_NULL},
102 { KPD_PKEY_1, KPD_KEY_1, KPD_KEY_DEF, KPD_KEY_NULL},
103 { KPD_PKEY_2, KPD_KEY_2, KPD_KEY_GHI, KPD_KEY_NULL},
104 { KPD_PKEY_3, KPD_KEY_3, KPD_KEY_JKL, KPD_KEY_NULL},
105 { KPD_PKEY_4, KPD_KEY_4, KPD_KEY_MNO, KPD_KEY_NULL},
106 { KPD_PKEY_5, KPD_KEY_5, KPD_KEY_PQR, KPD_KEY_NULL},
107 { KPD_PKEY_6, KPD_KEY_6, KPD_KEY_ST, KPD_KEY_NULL},
108 { KPD_PKEY_7, KPD_KEY_7, KPD_KEY_UV, KPD_KEY_NULL},
109 { KPD_PKEY_8, KPD_KEY_8, KPD_KEY_WX, KPD_KEY_NULL},
110 { KPD_PKEY_9, KPD_KEY_9, KPD_KEY_YZ, KPD_KEY_NULL},
111 { KPD_PKEY_UP, KPD_KEY_UP, KPD_KEY_UP, KPD_KEY_NULL},
112 { KPD_PKEY_DOWN, KPD_KEY_DOWN, KPD_KEY_DOWN, KPD_KEY_NULL},
113 { KPD_PKEY_SOFT_LEFT, KPD_KEY_SOFT_LEFT, KPD_KEY_SOFT_LEFT, KPD_KEY_NULL},
114 { KPD_PKEY_SOFT_RIGHT, KPD_KEY_SOFT_RIGHT, KPD_KEY_SOFT_RIGHT, KPD_KEY_NULL},
115 { KPD_PKEY_GREEN, KPD_KEY_CONNECT, KPD_KEY_CONNECT, KPD_KEY_NULL},
116 { KPD_PKEY_RED, KPD_KEY_DISCONNECT, KPD_KEY_DISCONNECT, KPD_KEY_NULL},
117 { KPD_PKEY_DIESE, KPD_KEY_DIESE , KPD_KEY_DIESE, KPD_KEY_NULL},
118 { KPD_PKEY_STAR, KPD_KEY_STAR, KPD_KEY_STAR, KPD_KEY_NULL},
119 { KPD_PKEY_VOL_UP, KPD_KEY_VOL_UP, KPD_KEY_VOL_UP, KPD_KEY_NULL},
120 { KPD_PKEY_VOL_DOWN, KPD_KEY_VOL_DOWN, KPD_KEY_VOL_DOWN, KPD_KEY_NULL},
121 { KPD_PKEY_LEFT, KPD_KEY_LEFT, KPD_KEY_LEFT, KPD_KEY_NULL},
122 { KPD_PKEY_RIGHT, KPD_KEY_RIGHT, KPD_KEY_RIGHT, KPD_KEY_NULL},
123 { KPD_PKEY_NAV_CENTER, KPD_KEY_ENTER, KPD_KEY_ENTER, KPD_KEY_NULL},
124 { KPD_PKEY_REC, KPD_KEY_RECORD, KPD_KEY_RECORD, KPD_KEY_NULL}};
125 #endif
126
127
128 /* Definition of the static variable which define the link between default
129 virtual key and ASCII code. It's unauthorized to define two same virtual
130 key Id in the table (except KPD_KEY_NULL). No verification is done on
131 this point. */
132 #if (BOARD == 7) || (BOARD == 8) || (BOARD == 9)
133 static T_VIRTUAL_ASCII_TABLE virtual_ascii_table =
134 { { KPD_KEY_0, "0", "+0" },
135 { KPD_KEY_1, "1", " 1" },
136 { KPD_KEY_2, "2", "abc2" },
137 { KPD_KEY_3, "3", "def3" },
138 { KPD_KEY_4, "4", "ghi4" },
139 { KPD_KEY_5, "5", "jkl5" },
140 { KPD_KEY_6, "6", "mno6" },
141 { KPD_KEY_7, "7", "pqrs7" },
142 { KPD_KEY_8, "8", "tuv8" },
143 { KPD_KEY_9, "9", "wxyz9" },
144 { KPD_KEY_DIESE, "#", "" },
145 { KPD_KEY_STAR, "*", "" },
146 { KPD_KEY_UP, "up", "" },
147 { KPD_KEY_DOWN, "down", "" },
148 { KPD_KEY_SOFT_LEFT, "SoftL", "" },
149 { KPD_KEY_SOFT_RIGHT, "SoftR", "" },
150 { KPD_KEY_CONNECT, "c", "" },
151 { KPD_KEY_DISCONNECT, "d", "" }};
152 #elif (BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (defined _WINDOWS)
153 static T_VIRTUAL_ASCII_TABLE virtual_ascii_table =
154 { { KPD_KEY_0, "0" , "+0"},
155 { KPD_KEY_1, "1", " 1" },
156 { KPD_KEY_2, "2" , "abc2" },
157 { KPD_KEY_3, "3" , "def3" },
158 { KPD_KEY_4, "4" , "ghi4" },
159 { KPD_KEY_5, "5" , "jkl5" },
160 { KPD_KEY_6, "6" , "mno6" },
161 { KPD_KEY_7, "7" , "pqrs7" },
162 { KPD_KEY_8, "8" , "tuv8" },
163 { KPD_KEY_9, "9" , "wxyz9" },
164 { KPD_KEY_DIESE, "#" , "" },
165 { KPD_KEY_STAR, "*" , "" },
166 { KPD_KEY_UP, "up" , "" },
167 { KPD_KEY_DOWN, "down" , "" },
168 { KPD_KEY_SOFT_LEFT, "SoftL", "" },
169 { KPD_KEY_SOFT_RIGHT, "SoftR", "" },
170 { KPD_KEY_CONNECT, "c" , "" },
171 { KPD_KEY_DISCONNECT, "d" , "" },
172 { KPD_KEY_VOL_UP, "Vol +", "" },
173 { KPD_KEY_VOL_DOWN, "Vol -", "" },
174 { KPD_KEY_LEFT, "left" , "" },
175 { KPD_KEY_RIGHT, "right" , "" },
176 { KPD_KEY_ENTER, "Enter", "" },
177 { KPD_KEY_RECORD, "Rec" , "" }};
178 #endif
179
180 #endif /* #ifndef _KPD_VIRTUAL_KEY_TABLE_DEF_H_ */