comparison src/cs/drivers/drv_app/kpd/kpd_i.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /**
2 * @file kpd_i.h
3 *
4 * Declaration of internal function for keypad driver.
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_I_H_
22 #define _KPD_I_H_
23
24 #include "kpd/kpd_api.h"
25
26 #include "rv/rv_general.h"
27 #include "rvm/rvm_gen.h"
28
29
30 /** Definition of the physical key identification. */
31 typedef INT8 T_KPD_PHYSICAL_KEY_ID;
32
33
34 /** Definition of single notified-mode and multi-notified mode */
35 #define SN_MODE 0
36 #define MN_MODE 1
37
38 /** Definition of the subscriber Id */
39 typedef UINT8 T_SUBSCRIBER_ID;
40
41 /** Definition of structure for */
42 typedef struct { T_SUBSCRIBER_ID subscriber_id;
43 } T_SUBSCRIBER;
44
45 /* Macro definition for sending trace */
46 #define KPD_SEND_TRACE(text,level) rvf_send_trace(text, sizeof(text)-1, NULL_PARAM, level, KPD_USE_ID )
47 #define KPD_SEND_TRACE_PARAM(text,param,level) rvf_send_trace(text, sizeof(text)-1, param, level, KPD_USE_ID )
48
49 /**
50 * @name Internal functions
51 *
52 */
53 /*@{*/
54
55 /**
56 * function: kpd_initialize_keypad_driver
57 *
58 * This function is called when SWE is initialized.
59 *
60 * @return
61 * - RV_OK if operation is successfull
62 * - RV_INTERNAL_ERR if operation cannot be completed
63 */
64 T_RV_RET kpd_initialize_keypad_driver(void);
65
66
67 /**
68 * function: kpd_kill_keypad_driver
69 *
70 * This function is called SWE is "killed".
71 *
72 * @return
73 * - RV_OK if operation is successfull
74 * - RV_INTERNAL_ERR if operation cannot be completed
75 */
76 T_RV_RET kpd_kill_keypad_driver(void);
77
78
79 /**
80 * function: kpd_add_subscriber
81 *
82 * This function reserve an id for a new subscriber.
83 *
84 * @param subscriber_id Subscriber identification value.
85 * @return
86 * - RV_OK if operation is successfull
87 * - RV_INTERNAL_ERR if operation cannot be completed
88 */
89 T_RV_RET kpd_add_subscriber(T_SUBSCRIBER_ID* subscriber_id);
90
91
92 /**
93 * function: kpd_remove_subscriber
94 *
95 * This function free subscriber Id when this one unsubscribe.
96 *
97 * @param subscriber_id Subscriber identification value.
98 * @return
99 * - RV_OK if operation is successfull
100 * - RV_INTERNAL_ERR if operation cannot be completed
101 */
102 T_RV_RET kpd_remove_subscriber(T_SUBSCRIBER_ID subscriber_id);
103
104 /**
105 * function: kpd_subscriber_id_used
106 *
107 * This function check if an Id is used by a subscriber.
108 *
109 * @param subscriber Subscriber structure used by client.
110 * @param subscriber_id Subscriber identification value.
111 * @return
112 * - TRUE if subscriber Id is used
113 * - FALSE else
114 */
115 BOOL kpd_subscriber_id_used(T_KPD_SUBSCRIBER subscriber, T_SUBSCRIBER_ID* subscriber_id);
116
117
118 /**
119 * function: kpd_send_key_event_message
120 *
121 * @param physical_key_pressed_id Physical key pressed Id.
122 * @param state Key state (pressed or released).
123 * @param press_state Pressed key state (first press, long press or repeat press).
124 * @param mode Mode used by the subscriber.
125 * @param return_path Return path used by the subscriber.
126 */
127 void kpd_send_key_event_message(T_KPD_PHYSICAL_KEY_ID physical_key_pressed_id,
128 T_KPD_KEY_STATE state,
129 T_KPD_PRESS_STATE press_state,
130 T_KPD_MODE mode,
131 T_RV_RETURN return_path);
132
133 /**
134 * function: kpd_send_status_message
135 *
136 * This function send staus message for asynchronous process.
137 *
138 * @param operation Concerned operation.
139 * @param status_value Error identification.
140 * @param return_path Return path used to prevent the subscriber of the error.
141 */
142 void kpd_send_status_message(UINT8 operation,
143 UINT8 status_value,
144 T_RV_RETURN return_path);
145
146 /**
147 * function: kpd_is_key_in_sn_mode
148 *
149 * This function check if keypad is in SN mode and if a key is defined by the keypad owner.
150 *
151 * @param physical_key_pressed_id Physical key pressed to check.
152 *
153 * @return - TRUE if keypad is in Single-notified mode and key is defined by the keypad owner,
154 * - FALSE else.
155 *
156 */
157 BOOL kpd_is_key_in_sn_mode(T_KPD_PHYSICAL_KEY_ID physical_key_pressed_id);
158
159
160
161
162 /**
163 * function: kpd_set_keys_in_sn_mode
164 *
165 * This function set .
166 *
167 * @param keys_owner List of keys defined by the keypad owner as keys only
168 * notified to the keypad owner.
169 * @param mode Mode of the keypad owner.
170 *
171 */
172 void kpd_set_keys_in_sn_mode(T_KPD_VIRTUAL_KEY_TABLE* keys_owner,
173 T_KPD_MODE mode);
174
175
176 /**
177 * function: kpd_is_owner_keypad
178 *
179 * This function set the subscriber Id which own the keypad.
180 *
181 * @param subscriber_id Subscriber identification value.
182 *
183 * @return TRUE if the keypad is in SN mode and subscriber_id is the keypad owner,
184 * FALSE else.
185 *
186 */
187 BOOL kpd_is_owner_keypad(T_SUBSCRIBER_ID subscriber_id);
188
189
190 /**
191 * function: kpd_get_keypad_mode
192 *
193 * This function returns the current keypad mode (single or multi notified mode).
194 *
195 * @return Current keypad mode.
196 *
197 */
198 UINT8 kpd_get_keypad_mode(void);
199
200 /**
201 * function: kpd_set_keypad_mode
202 *
203 * This function set a new keypad mode. If new keypad mode equal MN_MODE, list of
204 * notified keys to keypad owner is unset.
205 *
206 * @param mode New mode to set (Values can be SN_MODE or MN_MODE).
207 *
208 * @return None.
209 *
210 */
211 void kpd_set_keypad_mode(UINT8 mode);
212
213 /**
214 * function: kpd_get_owner_keypad_id
215 *
216 * This function returns the owner keypad Id (This value is correct only if keypad mode
217 * is the "Multi-otified" mode).
218 *
219 * @return Owner keypad Id.
220 *
221 */
222 T_SUBSCRIBER_ID kpd_get_owner_keypad_id(void);
223
224 /**
225 * function: kpd_set_owner_keypad_id
226 *
227 * This function set the Id of the keypad owner.
228 *
229 * @param subscriber_id Subscriber Id.
230 *
231 */
232 void kpd_set_owner_keypad_id(T_SUBSCRIBER_ID subscriber_id);
233
234
235
236 /*@}*/
237 #endif /* #ifndef _KPD_I_H_ */