FreeCalypso > hg > fc-selenite
comparison src/cs/drivers/drv_app/kpd/kpd_cfg.h @ 0:b6a5e36de839
src/cs: initial import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jul 2018 04:39:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b6a5e36de839 |
---|---|
1 /** | |
2 * @file kpd_cfg.h | |
3 * | |
4 * Configuration file for keypad driver. | |
5 * | |
6 * This file is part of the keypad API. | |
7 * | |
8 * @author Laurent Sollier (l-sollier@ti.com) | |
9 * @version 0.1 | |
10 */ | |
11 | |
12 /* | |
13 * History: | |
14 * | |
15 * Date Author Modification | |
16 * ---------------------------------------- | |
17 * 10/11/2001 L Sollier Create | |
18 * | |
19 * | |
20 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved | |
21 */ | |
22 | |
23 #ifndef _KPD_CFG_H_ | |
24 #define _KPD_CFG_H_ | |
25 | |
26 #ifndef _WINDOWS | |
27 #include "config/board.cfg" | |
28 #include "config/chipset.cfg" | |
29 #endif | |
30 | |
31 /** Define the number of physical keys on the keypad (including PWR key). | |
32 */ | |
33 #if (BOARD == 7) || (BOARD == 8) || (BOARD == 9) | |
34 #define KPD_NB_PHYSICAL_KEYS (18) | |
35 | |
36 #elif (BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (BOARD == 34) || (BOARD == 35) || (defined _WINDOWS) | |
37 #define KPD_NB_PHYSICAL_KEYS (24) | |
38 #endif | |
39 | |
40 | |
41 #if (CHIPSET == 12) | |
42 | |
43 #define SetGroupBits16(registre,position,number,value) {\ | |
44 UINT16 tmp=registre;\ | |
45 volatile UINT16 tmpvalue;\ | |
46 tmpvalue = (value<<(16-(number)));\ | |
47 tmpvalue = (tmpvalue>>(16-(number)));\ | |
48 tmp&=~((0xFFFF>>(16-(number)))<<(position));\ | |
49 tmp|=((tmpvalue&(0xFFFF>>(16-(number))))<<(position));\ | |
50 registre=tmp;\ | |
51 } | |
52 /** Types Definitions | |
53 */ | |
54 | |
55 /** T_KPD_Nsoftware_mode : Keyboard Enable Software Mode Type | |
56 */ | |
57 typedef enum | |
58 { | |
59 SOFTWARE_MODE_ENABLE = 0, | |
60 HARDWARE_DECODING = 1 | |
61 } T_KPD_Nsoftware_mode; | |
62 | |
63 | |
64 | |
65 /** T_KPD_PTV : Divisor factor | |
66 */ | |
67 typedef enum | |
68 { | |
69 KPD_CLK_DIV2 = 0, | |
70 KPD_CLK_DIV4 = 1, | |
71 KPD_CLK_DIV8 = 2, | |
72 KPD_CLK_DIV16 = 3, | |
73 KPD_CLK_DIV32 = 4, | |
74 KPD_CLK_DIV64 = 5, | |
75 KPD_CLK_DIV128 = 6, | |
76 KPD_CLK_DIV256 = 7 | |
77 } T_KPD_PTV; | |
78 | |
79 | |
80 | |
81 /** T_KPD_EnableDetection : Keyboard Detection Enable Type | |
82 */ | |
83 typedef enum | |
84 { | |
85 KPD_DETECTION_ENABLED = 1, | |
86 KPD_DETECTION_DISABLED = 0 | |
87 } T_KPD_EnableDetection; | |
88 | |
89 | |
90 /** T_KPD_Status : Keyboard State Machine Status Type | |
91 */ | |
92 typedef enum | |
93 { | |
94 KPD_IDLE = 0x0, | |
95 KPD_SCANNING = 0x1, | |
96 KPD_LOAD_TIMER_DEBOUNCING = 0x2, | |
97 KPD_TEST_TIMER_DEBOUNCING = 0x3, | |
98 KPD_GEN_IT_EVENT = 0x4, | |
99 KPD_GEN_IT_KEY_AND_EVENT = 0x5, | |
100 KPD_LOAD_TIMER_LONG_KEY = 0x6, | |
101 KPD_TEST_TIMER_LONG_KEY = 0x7, | |
102 KPD_GEN_IT_LONG_KEY = 0x8, | |
103 KPD_LOAD_TIMER_TIME_OUT = 0x9, | |
104 KPD_TEST_TIMER_TIME_OUT = 0xA, | |
105 KPD_GEN_IT_TIME_OUT = 0xB, | |
106 KPD_LOAD_TIMER_REPEAT_KEY = 0xC, | |
107 KPD_TEST_TIMER_REPEAT_KEY = 0xD, | |
108 KPD_OTHER = 0xF | |
109 } T_KPD_Status; | |
110 | |
111 | |
112 #endif | |
113 | |
114 | |
115 | |
116 /** Define the number max of client that can subscribe to the keypad driver. | |
117 * This value must be lower or equal than 32. | |
118 */ | |
119 #define KPD_MAX_SUBSCRIBER (4) | |
120 | |
121 /** Define the number of available mode. This value must be greater or equal to 2 | |
122 * because default and alphanumeric mode must always be defined. | |
123 * (This value define the size of kpd_vpm_table array). | |
124 */ | |
125 #define KPD_NB_MODE (3) | |
126 | |
127 /** Define the configurable mode value. This value must be defined with the enumerated | |
128 * type T_KPD_MODE. If KPD_MODE_CONFIG is not defined, the configurable mode is not supported. | |
129 */ | |
130 #define KPD_MODE_CONFIG (KPD_GAME_MODE) | |
131 | |
132 /** Base value for memory bank size, can be increased for customer needs. | |
133 */ | |
134 #define KPD_MB_BASE_SIZE (100) | |
135 | |
136 | |
137 | |
138 /** | |
139 * @var T_KPD_MODE | |
140 * Enumerated type that defines all the available modes. | |
141 * The mandatory default mode are KPD_DEFAULT_MODE and KPD_ALPHANUMERIC_MODE. | |
142 * Some others mode can be added by the customer (Update KPD_NB_MODE value). | |
143 * Values must be consecutive. KPD_DEFAULT_MODE and KPD_ALPHANUMERIC_MODE must always | |
144 * be respectively equal to 1 and 2. | |
145 */ | |
146 typedef enum { KPD_DEFAULT_MODE = 1, | |
147 KPD_ALPHANUMERIC_MODE = 2, | |
148 KPD_GAME_MODE = 3 | |
149 } T_KPD_MODE; | |
150 | |
151 /** | |
152 * Definition of all the virtual key ID. All Id's must be distinct. | |
153 */ | |
154 /* KPD_KEY_NULL must always be defined */ | |
155 /* KPD_KEY_NULL is not a key that can be notified to a subscriber */ | |
156 #define KPD_KEY_NULL (0) | |
157 | |
158 #define KPD_KEY_0 (1) | |
159 #define KPD_KEY_1 (2) | |
160 #define KPD_KEY_2 (3) | |
161 #define KPD_KEY_3 (4) | |
162 #define KPD_KEY_4 (5) | |
163 #define KPD_KEY_5 (6) | |
164 #define KPD_KEY_6 (7) | |
165 #define KPD_KEY_7 (8) | |
166 #define KPD_KEY_8 (9) | |
167 #define KPD_KEY_9 (10) | |
168 #define KPD_KEY_UP (11) | |
169 #define KPD_KEY_DOWN (12) | |
170 #define KPD_KEY_SOFT_LEFT (13) | |
171 #define KPD_KEY_SOFT_RIGHT (14) | |
172 #define KPD_KEY_CONNECT (15) | |
173 #define KPD_KEY_DISCONNECT (16) | |
174 #define KPD_KEY_STAR (17) | |
175 #define KPD_KEY_DIESE (18) | |
176 | |
177 #define KPD_KEY_VOL_UP (19) | |
178 #define KPD_KEY_VOL_DOWN (20) | |
179 #define KPD_KEY_LEFT (21) | |
180 #define KPD_KEY_RIGHT (22) | |
181 #define KPD_KEY_ENTER (23) | |
182 #define KPD_KEY_RECORD (24) | |
183 | |
184 | |
185 /* This virtual key is defined for Condat callback when Power key is pressed | |
186 until new interface is defined with Condat */ | |
187 #define KPD_PWR (25) | |
188 | |
189 #define KPD_KEY_ABC (30) | |
190 #define KPD_KEY_DEF (31) | |
191 #define KPD_KEY_GHI (32) | |
192 #define KPD_KEY_JKL (33) | |
193 #define KPD_KEY_MNO (34) | |
194 #define KPD_KEY_PQR (35) | |
195 #define KPD_KEY_ST (36) | |
196 #define KPD_KEY_UV (37) | |
197 #define KPD_KEY_WX (38) | |
198 #define KPD_KEY_YZ (39) | |
199 | |
200 | |
201 #endif /* _KPD_CFG_H_ */ |