comparison src/cs/drivers/drv_app/kpd/kpd_process_internal_msg.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_process_internal_msg.h
3 *
4 * Declaration of internal function for keypad driver.
5 * These functions process internal messages received by the keypad task.
6 *
7 * @author Laurent Sollier (l-sollier@ti.com)
8 * @version 0.1
9 */
10
11 /*
12 * History:
13 *
14 * Date Author Modification
15 * ----------------------------------------
16 * 10/10/2001 L Sollier Create
17 *
18 *
19 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
20 */
21
22 #ifndef _KPD_PROCESS_INTERNAL_MSG_H_
23 #define _KPD_PROCESS_INTERNAL_MSG_H_
24
25 #include "kpd/kpd_api.h"
26
27 #include "rv/rv_general.h"
28 #include "rvm/rvm_gen.h"
29
30 /**
31 * @name Internal functions
32 *
33 */
34 /*@{*/
35
36
37 /**
38 * function: kpd_subscribe_i
39 *
40 * This function is called by the client before any use of the keypad driver services
41 * It is called only once.
42 *
43 * @param subscriber_id Subscriber identification value.
44 * @param mode Mode used by the keypad client.
45 * @param notified_keys_p Define all the keys the client want to be notified.
46 * @param return_path Return path for key pressed.
47 * @return RV_OK.
48 */
49 T_RV_RET kpd_subscribe_i(T_SUBSCRIBER_ID subscriber_id,
50 T_KPD_MODE mode,
51 T_KPD_VIRTUAL_KEY_TABLE* notified_keys_p,
52 T_RV_RETURN return_path);
53
54 /**
55 * function: kpd_unsubscribe_i
56 *
57 * This function unsubscribes a client from the keypad driver.
58 *
59 * @param subscriber_id Subscriber identification value.
60 * @return RV_OK.
61 */
62 T_RV_RET kpd_unsubscribe_i( T_SUBSCRIBER_ID subscriber_id);
63
64 /**
65 * function: kpd_define_key_notification_i
66 *
67 * This function defines time repetition for a set of keys.
68 * By default, all the keys are defined as KPD_RELEASE_NOTIF.
69 *
70 * @param subscriber_id Subscriber identification value.
71 * @param repeat_key_table_p Set of keys which must be repeated.
72 * @param notif_level Define what kind of notification is set for all the keys.
73 * @param long_press_time Time in milliseconds before long press time notification.
74 * @param repeat_time Time in millliseconds for key repetition. If repeat_time = 0,
75 * keys defined by parameter keys are not repeated.
76 * @return RV_OK.
77 */
78 T_RV_RET kpd_define_key_notification_i(T_SUBSCRIBER_ID subscriber_id,
79 T_KPD_VIRTUAL_KEY_TABLE* repeat_key_table_p,
80 T_KPD_NOTIF_LEVEL notif_level,
81 UINT16 long_press_time,
82 UINT16 repeat_time);
83
84 /**
85 * function: kpd_change_mode_i
86 *
87 * This function changes the mode for the specific client.
88 *
89 * @param subscriber_id Subscriber identification value.
90 * @param notified_keys_p Define all the keys the client want to be notified in the new mode.
91 * @param new_mode New mode in which the client want to switch.
92 * @return RV_OK.
93 */
94 T_RV_RET kpd_change_mode_i(T_SUBSCRIBER_ID subscriber_id,
95 T_KPD_VIRTUAL_KEY_TABLE* notified_keys_p,
96 T_KPD_MODE new_mode);
97
98 /**
99 * function: kpd_own_keypad_i
100 *
101 * This function allows the latest subscriber being the only client to be notified by action
102 * on keypad (less CPU time used).
103 * After this call, the keypad is in the "single notified" state.
104 * This action is cancelled when:
105 * - The function is called with parameter is_keypad_owner to FALSE,
106 * - The subscriber (which own the keypad) unsubscribe from keypad.
107 *
108 * Note that keypad is in the "multi notified" state if there is no subscriber (particularly
109 * at the keypad initialisation).
110 *
111 * @param subscriber_id Subscriber identification value.
112 * @param is_keypad_owner_p Define the state to change.
113 * TRUE: keypad pass in "single notified" state
114 * FALSE: keypad pass in "multi notified" state
115 * @param keys_owner Set of keys only notified to the subscriber that call this function.
116 * This is mandatory a subset of the keys defined at subscription.
117 * @return RV_OK.
118 */
119 T_RV_RET kpd_own_keypad_i(T_SUBSCRIBER_ID subscriber_id,
120 BOOL is_keypad_owner,
121 T_KPD_VIRTUAL_KEY_TABLE* keys_owner_p);
122
123 /**
124 * function: kpd_set_key_config_i
125 *
126 * This function allows setting dynamically a configuration for new or existing virtual keys.
127 * The two tables define a mapping between each entry (new_keys[1] is mapped with reference_keys[1],
128 * new_keys[2] is mapped with reference_keys[2], ...).
129 * The call of this function doesn't change the mode of the client.
130 *
131 * @param subscriber_id Subscriber identification value.
132 * @param reference_keys_p Set of keys available on keypad in default mode.
133 * @param new_keys_p Set of keys which must map with the reference keys.
134 * @return RV_OK.
135 */
136 T_RV_RET kpd_set_key_config_i(T_SUBSCRIBER_ID subscriber_id,
137 T_KPD_VIRTUAL_KEY_TABLE* reference_keys_p,
138 T_KPD_VIRTUAL_KEY_TABLE* new_keys_p);
139
140 /**
141 * function: kpd_get_available_keys_i
142 *
143 * This function allows knowing all the available keys in default mode.
144 *
145 * @param available_keys_p Set of keys available on keypad in default mode. The structure
146 * must be declared by the caller, and is filled by the function (OUT).
147 * @return RV_OK.
148 */
149 T_RV_RET kpd_get_available_keys_i( T_KPD_VIRTUAL_KEY_TABLE* available_keys_p);
150
151 /**
152 * function: kpd_get_ascii_key_code_i
153 *
154 * This function return associated ASCII value to defined key.
155 *
156 * @param key Key identification value.
157 * @param mode Mode in which is defined the link between "key" and "ascii code".
158 * @param ascii_code Associated ASCII code to parameter "key" (OUT).
159 * @return RV_OK.
160 */
161 T_RV_RET kpd_get_ascii_key_code_i(T_KPD_VIRTUAL_KEY_ID key,
162 T_KPD_MODE mode,
163 UBYTE** ascii_code);
164
165
166 /**
167 * function: kpd_process_key_pressed_i
168 *
169 * This function process a key pressed.
170 *
171 * @param physical_key_pressed_id Physical key pressed.
172 */
173 void kpd_process_key_pressed_i(T_KPD_PHYSICAL_KEY_ID physical_key_pressed_id);
174
175
176 /**
177 * function: kpd_process_key_pressed_sn_mode_i
178 *
179 * This function process a key pressed when the keypad is in Single-notified mode,
180 * and if the key is in the table defined by the keypad owner (see function kpd_own_keypad).
181 *
182 * @param physical_key_pressed_id Physical key pressed.
183 */
184 void kpd_process_key_pressed_sn_mode_i(T_KPD_PHYSICAL_KEY_ID physical_key_pressed_id);
185
186
187
188 /**
189 * function: kpd_wait_for_key_release
190 *
191 * This function wait that key is released to unmask interrupt.
192 * This function is usefull when limits memory size is reached,
193 * to be sure that all messages could be sent to all the subscribers
194 *
195 */
196 void kpd_wait_for_key_release(void);
197
198
199 /*@}*/
200 #endif /* #ifndef _KPD_PROCESS_INTERNAL_MSG_H_ */