comparison src/cs/drivers/drv_app/kpd/kpd_virtual_key_table_mgt.h @ 0:945cf7f506b2

src/cs: chipsetsw import from tcs211-fcmodem binary blobs and LCD demo files have been excluded, all line endings are LF only
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 22:50:11 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:945cf7f506b2
1 /**
2 * @file kpd_virtual_key_table_mgt.h
3 *
4 * Declarations of the access functions to configuration keypad table.
5 *
6 * @author Laurent Sollier (l-sollier@ti.com)
7 * @version 0.1
8 */
9
10 /*
11 * History:
12 *
13 * Date Author Modification
14 * ----------------------------------------
15 * 10/10/2001 L Sollier Create
16 *
17 *
18 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
19 */
20
21 #ifndef _KPD_VIRTUAL_KEY_TABLE_MGT_H_
22 #define _KPD_VIRTUAL_KEY_TABLE_MGT_H_
23
24 #include "kpd/kpd_api.h"
25 #include "kpd/kpd_scan_functions.h"
26 #include "kpd/kpd_physical_key_def.h"
27
28 #include "rv/rv_general.h"
29
30 /** Definition for the parameter position in the function declared below when
31 * the virtual key in the array is unknown.
32 */
33 #define KPD_POS_NOT_AVAILABLE (-1)
34
35 /**
36 * @name Acces functions to configuration table
37 */
38 /*@{*/
39
40
41 /**
42 * function: kpd_initialize_ascii_table
43 *
44 * This function initialize the ASCII table in order to improve performance.
45 *
46 * @return RV_OK.
47 */
48 T_RV_RET kpd_initialize_ascii_table(void);
49
50
51 /**
52 * function: kpd_get_virtual_key
53 *
54 * This function retrieve the virtual key ID associated to the physical key id and the mode.
55 *
56 *
57 * @param key_id Physical key Id.
58 * @param mode Mode associated.
59 * @return Virtual key Id or KPD_KEY_NULL if the physical key is not mapped.
60 *
61 */
62 T_KPD_VIRTUAL_KEY_ID kpd_get_virtual_key( T_KPD_PHYSICAL_KEY_ID key_id,
63 T_KPD_MODE mode);
64
65 /**
66 * function: kpd_get_ascii_key_value
67 *
68 * This function retrieve the ASCII code associated to the virtual key ID and the mode.
69 *
70 * @param key_id Physical key Id.
71 * @param mode Mode associated : default or alphanumeric
72 * (No verification is done on the value).
73 * @param ascii_code_pp ASCII code (OUT), By default, return value is the empty string "".
74 * @return RV_OK.
75 *
76 */
77 T_RV_RET kpd_get_ascii_key_value(T_KPD_PHYSICAL_KEY_ID key_id,
78 T_KPD_MODE mode,
79 char** ascii_code_pp);
80
81 /**
82 * function: kpd_retrieve_virtual_key_position
83 *
84 * This function retrieve the position in the array of virtual keys according to the mode.
85 *
86 *
87 * @param key_id Virtual key Id.
88 * @param mode Mode in which is searched the virtual key
89 * (No verification is done on the value)
90 * @param position_p Position of the virtual key Id in the array. If the virtual
91 * doesn't exist, the returned value is KPD_POS_NOT_AVAILABLE (OUT)
92 * @return
93 * - RV_OK if operation is successful.
94 * - RV_INVALID_PARAMETER if the virtual key doesn't exist.
95 *
96 */
97 T_RV_RET kpd_retrieve_virtual_key_position( T_KPD_VIRTUAL_KEY_ID key_id,
98 T_KPD_MODE mode,
99 INT8* position_p);
100
101 /**
102 * function: kpd_get_default_keys
103 *
104 * This function retrieve the position in the array of virtual keys according to the mode.
105 *
106 *
107 * @param available_keys_p Table of available keys in default mode.
108 * @return RV_OK.
109 *
110 */
111 T_RV_RET kpd_get_default_keys( T_KPD_VIRTUAL_KEY_TABLE* available_keys_p);
112
113
114 /**
115 * function: kpd_check_key_table
116 *
117 * This function check if the all the keys defined in keys_table are available
118 * in the requested mode.
119 * Note that for facilities, if number of keys are KPD_NB_PHYSICAL_KEYS, the table
120 * is automatically fulfilled with all the virtual keys.
121 *
122 *
123 * @param keys_table_p Table of keys.
124 * @param mode Mode requested.
125 * @return - RV_OK if operation successfull,
126 * - RV_INVALID_PARAMETER if at least one key is not defined in the requested mode.
127 *
128 */
129 T_RV_RET kpd_check_key_table(T_KPD_VIRTUAL_KEY_TABLE* keys_table_p, T_KPD_MODE mode);
130
131 /**
132 * function: kpd_define_new_config
133 *
134 * This function define a link between reference keys (virtual keys in default mode),
135 * and configurable keys. The virtual key Id of the configurable key can be defined
136 * by the user in another part of the source code.
137 *
138 * @param reference_keys_p Table of reference keys.
139 * @param new_keys_p Tabe of keys to define in new mode.
140 * @return RV_OK.
141 *
142 */
143 void kpd_define_new_config(T_KPD_VIRTUAL_KEY_TABLE* reference_keys_p,
144 T_KPD_VIRTUAL_KEY_TABLE* new_keys_p);
145
146 /**
147 * function: kpd_vpm_table_is_valid
148 *
149 * This function check the vpm table. Indeed, the physical keys must be defined
150 * from 0 to KPD_NB_PHYSICAL_KEYS consecutively, and their position in the table
151 * equal to the value. For more explanations, see vpm_table definition.
152 *
153 * @return
154 * - TRUE if the table is valid.
155 * - FALSE if the table is invalid.
156 *
157 */
158 BOOL kpd_vpm_table_is_valid(void);
159
160 /*@}*/
161
162
163 #endif /* #ifndef _KPD_VIRTUAL_KEY_TABLE_MGT_H_ */