First add
[adaptation/devices/nfc-plugin-nxp.git] / src / phHciNfc_Sequence.h
1 /*\r
2  * Copyright (C) 2010 NXP Semiconductors\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 \r
18 /*!\r
19 * =========================================================================== *\r
20 *                                                                             *\r
21 *                                                                             *\r
22 * \file  phHciNfc_Sequence.h                                                  *\r
23 * \brief State Machine Management for the HCI and the Function Sequence       *\r
24 * for a particular State.                                                     *\r
25 *                                                                             *\r
26 *                                                                             *\r
27 * Project: NFC-FRI-1.1                                                        *\r
28 *                                                                             *\r
29 * $Date: Fri Aug 14 17:01:28 2009 $                                           *\r
30 * $Author: ing04880 $                                                         *\r
31 * $Revision: 1.12 $                                                            * \r
32 * $Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $  \r
33 *                                                                             *\r
34 * =========================================================================== *\r
35 */\r
36 \r
37 /*@{*/\r
38 #ifndef PHHCINFC_SEQUENCE_H\r
39 #define PHHCINFC_SEQUENCE_H\r
40 \r
41 /*@}*/\r
42 \r
43 \r
44 /**\r
45  *  \name HCI\r
46  *\r
47  * File: \ref phHciNfc_Sequence.h\r
48  *\r
49  */\r
50 \r
51 /*@{*/\r
52 #define PHHCINFC_SEQUENCE_FILEREVISION "$Revision: 1.12 $" /**< \ingroup grp_file_attributes */\r
53 #define PHHCINFC_SEQUENCE_FILEALIASES  "$Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $"    /**< \ingroup grp_file_attributes */\r
54 /*@}*/\r
55 \r
56 \r
57 /*\r
58 ################################################################################\r
59 ***************************** Header File Inclusion ****************************\r
60 ################################################################################\r
61 */\r
62 \r
63 #include <phHciNfc_Generic.h>\r
64 \r
65 /*\r
66 ################################################################################\r
67 ****************************** Macro Definitions *******************************\r
68 ################################################################################\r
69 */\r
70 \r
71 /*\r
72 ################################################################################\r
73 ************************* Function Prototype Declaration ***********************\r
74 ################################################################################\r
75 */\r
76 \r
77 \r
78 /**\r
79  * \ingroup grp_hci_nfc\r
80  *\r
81  *  The phHciNfc_FSM_Update function Validates the HCI State to\r
82  *  the next operation ongoing.\r
83  *\r
84  *  \param[in]  psHciContext            psHciContext is the context of\r
85  *                                      the HCI Layer.\r
86  *  \param[in]  state                   state is the state to which the\r
87  *                                      current HCI Layer state is validated.\r
88  *  \param[in]  validate_type           validate the state by the type of the\r
89  *                                      validation required.\r
90  *\r
91  *  \retval NFCSTATUS_SUCCESS           FSM Validated successfully .\r
92  *  \retval NFCSTATUS_INVALID_STATE     The supplied state parameter is invalid.\r
93  *\r
94  */\r
95 \r
96 extern \r
97 NFCSTATUS \r
98 phHciNfc_FSM_Validate(  \r
99                         phHciNfc_sContext_t *psHciContext,  \r
100                         phHciNfc_eState_t state,  \r
101                         uint8_t validate_type\r
102                     );\r
103 \r
104 /**\r
105  * \ingroup grp_hci_nfc\r
106  *\r
107  *  The phHciNfc_FSM_Update function Checks and Updates the HCI State to\r
108  *  the next valid State.\r
109  *\r
110  *  \param[in]  psHciContext            psHciContext is the context of\r
111  *                                      the HCI Layer.\r
112  *  \param[in]  next_state              next_state is the state to which\r
113  *                                      we the HCI Layer.\r
114  *  \param[in]  transition              transiton of the state whether \r
115  *                                      ongoing or complete .\r
116  *\r
117  *  \retval NFCSTATUS_SUCCESS           FSM Updated successfully .\r
118  *  \retval NFCSTATUS_INVALID_STATE     The supplied state parameter is invalid.\r
119  *\r
120  */\r
121 \r
122 extern\r
123 NFCSTATUS\r
124 phHciNfc_FSM_Update(\r
125                         phHciNfc_sContext_t *psHciContext,\r
126                         phHciNfc_eState_t   next_state\r
127                    );\r
128 \r
129 /**\r
130  * \ingroup grp_hci_nfc\r
131  *\r
132  *  The phHciNfc_FSM_Complete function completes the  ongoing state transition \r
133  *  from the current state to the next state.\r
134  *\r
135  *  \param[in]  psHciContext            psHciContext is the context of\r
136  *                                      the HCI Layer.\r
137  *\r
138  *  \retval NFCSTATUS_SUCCESS           FSM Updated successfully .\r
139  *  \retval NFCSTATUS_INVALID_STATE     The supplied state parameter is invalid.\r
140  *\r
141  */\r
142 \r
143 extern\r
144 NFCSTATUS\r
145 phHciNfc_FSM_Complete(\r
146                         phHciNfc_sContext_t *psHciContext\r
147                     );\r
148 \r
149 \r
150 /**\r
151  * \ingroup grp_hci_nfc\r
152  *\r
153  *  The phHciNfc_FSM_Rollback function rolls back to previous valid state \r
154  *  and abort the ongoing state transition. \r
155  *\r
156  *  \param[in]  psHciContext            psHciContext is the context of\r
157  *                                      the HCI Layer.\r
158  *\r
159  *  \retval NONE.\r
160  *\r
161  */\r
162 \r
163 extern\r
164 void\r
165 phHciNfc_FSM_Rollback(\r
166                         phHciNfc_sContext_t *psHciContext\r
167                     );\r
168 \r
169 \r
170 \r
171 /**\r
172  * \ingroup grp_hci_nfc\r
173  *\r
174  *  The phHciNfc_Initialise_Sequence function sequence initialises the \r
175  *  HCI layer and the remote device by performing the operations required\r
176  *  setup the reader and discovery functionality.\r
177  *\r
178  *  \param[in]  psHciContext            psHciContext is the context of\r
179  *                                      the HCI Layer.\r
180  *  \param[in]  pHwRef                  pHwRef is the Information of\r
181  *                                      the Device Interface Link .\r
182  *\r
183  *  \retval NFCSTATUS_SUCCESS           HCI current initialise sequence successful.\r
184  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
185  *                                      could not be interpreted properly.\r
186  *  \retval Other errors                Other related errors\r
187  *\r
188  */\r
189 \r
190 \r
191 extern\r
192 NFCSTATUS\r
193 phHciNfc_Initialise_Sequence(\r
194                                 phHciNfc_sContext_t     *psHciContext,\r
195                                 void                    *pHwRef\r
196                              );\r
197 \r
198 /**\r
199  * \ingroup grp_hci_nfc\r
200  *\r
201  *  The phHciNfc_PollLoop_Sequence function sequence starts the  \r
202  *  discovery sequence of device.\r
203  *\r
204  *  \param[in]  psHciContext            psHciContext is the context of\r
205  *                                      the HCI Layer.\r
206  *  \param[in]  pHwRef                  pHwRef is the Information of\r
207  *                                      the Device Interface Link .\r
208  *\r
209  *  \retval NFCSTATUS_SUCCESS           HCI Discovery Configuration sequence successful.\r
210  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
211  *                                      could not be interpreted properly.\r
212  *  \retval Other errors                Other related errors\r
213  *\r
214  */\r
215 \r
216 extern\r
217 NFCSTATUS\r
218 phHciNfc_PollLoop_Sequence(\r
219                             phHciNfc_sContext_t     *psHciContext,\r
220                             void                    *pHwRef\r
221                          );\r
222 \r
223 \r
224 /**\r
225  * \ingroup grp_hci_nfc\r
226  *\r
227  *  The phHciNfc_EmulationCfg_Sequence function sequence configures the  \r
228  *  device for different types of emulation supported.\r
229  *\r
230  *  \param[in]  psHciContext            psHciContext is the context of\r
231  *                                      the HCI Layer.\r
232  *  \param[in]  pHwRef                  pHwRef is the Information of\r
233  *                                      the Device Interface Link .\r
234  *\r
235  *  \retval NFCSTATUS_SUCCESS           HCI Emulation Configuration \r
236  *                                      sequence successful.\r
237  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
238  *                                      could not be interpreted properly.\r
239  *  \retval Other errors                    Other related errors\r
240  *\r
241  */\r
242 \r
243 extern\r
244 NFCSTATUS\r
245 phHciNfc_EmulationCfg_Sequence(\r
246                            phHciNfc_sContext_t      *psHciContext,\r
247                            void                 *pHwRef\r
248                            );\r
249 \r
250 \r
251 /**\r
252  * \ingroup grp_hci_nfc\r
253  *\r
254  *  The phHciNfc_SmartMx_Mode_Sequence function sequence configures the  \r
255  *  SmartMx device for different modes by enabling and disabling polling.\r
256  *\r
257  *  \param[in]  psHciContext            psHciContext is the context of\r
258  *                                      the HCI Layer.\r
259  *  \param[in]  pHwRef                  pHwRef is the Information of\r
260  *                                      the Device Interface Link .\r
261  *\r
262  *  \retval NFCSTATUS_SUCCESS           HCI SmartMX Mode Configuration \r
263  *                                      sequence successful.\r
264  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
265  *                                      could not be interpreted properly.\r
266  *  \retval Other errors                 Other related errors\r
267  *\r
268  */\r
269 \r
270 extern\r
271 NFCSTATUS\r
272 phHciNfc_SmartMx_Mode_Sequence(\r
273                            phHciNfc_sContext_t      *psHciContext,\r
274                            void                     *pHwRef\r
275                           );\r
276 \r
277 \r
278 /**\r
279  * \ingroup grp_hci_nfc\r
280  *\r
281  *  The phHciNfc_Connect_Sequence function sequence selects the  \r
282  *  discovered target for performing the transaction.\r
283  *\r
284  *  \param[in]  psHciContext            psHciContext is the context of\r
285  *                                      the HCI Layer.\r
286  *  \param[in]  pHwRef                  pHwRef is the Information of\r
287  *                                      the Device Interface Link .\r
288  *\r
289  *  \retval NFCSTATUS_SUCCESS           HCI target selection sequence successful.\r
290  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
291  *                                      could not be interpreted properly.\r
292  *  \retval Other errors                Other related errors\r
293  *\r
294  */\r
295 \r
296 extern\r
297 NFCSTATUS\r
298 phHciNfc_Connect_Sequence(\r
299                             phHciNfc_sContext_t     *psHciContext,\r
300                             void                    *pHwRef\r
301                          );\r
302 \r
303 \r
304 /**\r
305  * \ingroup grp_hci_nfc\r
306  *\r
307  *  The phHciNfc_Disconnect_Sequence function sequence de-selects the  \r
308  *  selected target .\r
309  *\r
310  *  \param[in]  psHciContext            psHciContext is the context of\r
311  *                                      the HCI Layer.\r
312  *  \param[in]  pHwRef                  pHwRef is the Information of\r
313  *                                      the Device Interface Link .\r
314  *\r
315  *  \retval NFCSTATUS_SUCCESS           HCI target de-selection sequence successful.\r
316  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
317  *                                      could not be interpreted properly.\r
318  *  \retval Other errors                Other related errors\r
319  *\r
320  */\r
321 \r
322 extern\r
323 NFCSTATUS\r
324 phHciNfc_Disconnect_Sequence(\r
325                             phHciNfc_sContext_t     *psHciContext,\r
326                             void                    *pHwRef\r
327                          );\r
328 \r
329 /**\r
330  * \ingroup grp_hci_nfc\r
331  *\r
332  *  The phHciNfc_Error_Sequence function sequence notifies the  \r
333  *  error in the HCI sequence to the upper layer .\r
334  *\r
335  *  \param[in]  psHciContext            psHciContext is the context of\r
336  *                                      the HCI Layer.\r
337  *  \param[in]  pHwRef                  pHwRef is the Information of\r
338  *                                      the Device Interface Link .\r
339  *  \param[in]  status                  Notify status information from the \r
340  *                                      HCI layer to the Upper Layer.\r
341  *                                      \r
342  *\r
343  *  \retval NFCSTATUS_SUCCESS           HCI Error sequence Notification successful.\r
344  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
345  *                                      could not be interpreted properly.\r
346  *  \retval Other errors                Other related errors\r
347  *\r
348  */\r
349 extern\r
350 void\r
351 phHciNfc_Error_Sequence(\r
352                                 void            *psContext,\r
353                                 void            *pHwRef,\r
354                                 NFCSTATUS       error_status,\r
355                                 void            *pdata,\r
356                                 uint8_t         length\r
357                         );\r
358 \r
359 \r
360 /**\r
361  * \ingroup grp_hci_nfc\r
362  *\r
363  *  The phHciNfc_Resume_Sequence function sequence resumes the  \r
364  *  previous pending sequence of HCI .\r
365  *\r
366  *  \param[in]  psHciContext            psHciContext is the context of\r
367  *                                      the HCI Layer.\r
368  *  \param[in]  pHwRef                  pHwRef is the Information of\r
369  *                                      the Device Interface Link .\r
370  *\r
371  *  \retval NFCSTATUS_SUCCESS           HCI sequence resume successful.\r
372  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
373  *                                      could not be interpreted properly.\r
374  *  \retval Other errors                Other related errors\r
375  *\r
376  */\r
377 \r
378 extern\r
379 NFCSTATUS\r
380 phHciNfc_Resume_Sequence(\r
381                                 phHciNfc_sContext_t     *psHciContext,\r
382                                 void                    *pHwRef\r
383                           );\r
384 \r
385 \r
386 /**\r
387  * \ingroup grp_hci_nfc\r
388  *\r
389  *  The phHciNfc_Release_Sequence function sequence releases the \r
390  *  HCI layer and the remote device by performing the operations required\r
391  *  release the reader and discovery functionality.\r
392  *\r
393  *  \param[in]  psHciContext            psHciContext is the context of\r
394  *                                      the HCI Layer.\r
395  *  \param[in]  pHwRef                  pHwRef is the Information of\r
396  *                                      the Device Interface Link .\r
397  *\r
398  *  \retval NFCSTATUS_SUCCESS           HCI current release sequence successful.\r
399  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
400  *                                      could not be interpreted properly.\r
401  *  \retval Other errors                Other related errors\r
402  *\r
403  */\r
404 \r
405 \r
406 extern\r
407 NFCSTATUS\r
408 phHciNfc_Release_Sequence(\r
409                             phHciNfc_sContext_t     *psHciContext,\r
410                             void                    *pHwRef\r
411                          );\r
412 \r
413 \r
414 /*\r
415 ################################################################################\r
416 ***************************** Function Definitions *****************************\r
417 ################################################################################\r
418 */\r
419 \r
420 #endif\r
421 \r