merge with master
[adaptation/devices/nfc-plugin-nxp.git] / src / phHciNfc_ISO15693.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 * \file  phHciNfc_NfcIPMgmt.h                                                 *\r
22 * \brief HCI NFCIP-1 Management Routines.                                    *\r
23 *                                                                             *\r
24 *                                                                             *\r
25 * Project: NFC-FRI-1.1                                                        *\r
26 *                                                                             *\r
27 * $Date: Tue Jun 30 17:09:29 2009 $                                           *\r
28 * $Author: ing04880 $                                                         *\r
29 * $Revision: 1.1 $                                                            *\r
30 * $Aliases: NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,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
31 *                                                                             *\r
32 * =========================================================================== *\r
33 */\r
34 \r
35 #ifndef PHHCINFC_ISO15693_H\r
36 #define PHHCINFC_ISO15693_H\r
37 \r
38 /*@}*/\r
39 \r
40 \r
41 /**\r
42 *  \name HCI\r
43 *\r
44 * File: \ref phHciNfc_ISO15693.h\r
45 *\r
46 */\r
47 /*@{*/\r
48 #define PHHCINFC_ISO15693_FILEREVISION "$Revision: 1.1 $" /**< \ingroup grp_file_attributes */\r
49 #define PHHCINFC_ISO15693_FILEALIASES  "$Aliases: NFC_FRI1.1_WK926_R28_2,NFC_FRI1.1_WK926_R28_3,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,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
50 /*@}*/\r
51 \r
52 /*\r
53 ***************************** Header File Inclusion ****************************\r
54 */\r
55 \r
56 #include <phHciNfc_Generic.h>\r
57 \r
58 /*\r
59 ****************************** Macro Definitions *******************************\r
60 */\r
61 /* Enable the ISO 15693 */\r
62 #define HCI_ISO_15693_ENABLE                    0x01U\r
63 #define HCI_ISO_15693_INFO_SEQ                  0x02U\r
64 \r
65 #define NXP_ISO15693_CMD                        0x20U\r
66 \r
67 \r
68 /*\r
69 ******************** Enumeration and Structure Definition **********************\r
70 */\r
71 \r
72 typedef enum phHciNfc_ISO15693_Seq{\r
73     ISO15693_INVENTORY,\r
74     ISO15693_AFI, \r
75     ISO15693_END_SEQUENCE,\r
76     ISO15693_INVALID_SEQ\r
77 } phHciNfc_ISO15693_Seq_t;\r
78 \r
79 typedef struct phHciNfc_ISO15693_Info{\r
80     phHciNfc_ISO15693_Seq_t         current_seq;\r
81     phHciNfc_ISO15693_Seq_t         next_seq;\r
82     phHciNfc_Pipe_Info_t            *ps_15693_pipe_info;\r
83     uint8_t                         pipe_id;    \r
84     uint8_t                         multiple_tgts_found;\r
85     phHal_sRemoteDevInformation_t   iso15693_info;\r
86     uint8_t                         enable_iso_15693_gate;\r
87 }phHciNfc_ISO15693_Info_t;\r
88 \r
89 \r
90 /*\r
91 *********************** Function Prototype Declaration *************************\r
92 */\r
93 \r
94 /*!\r
95 * \brief Allocates the resources of ISO15693 management gate.\r
96 *\r
97 * This function Allocates the resources of the ISO15693 management\r
98 * gate Information Structure.\r
99\r
100 */\r
101 extern\r
102 NFCSTATUS\r
103 phHciNfc_ISO15693_Init_Resources(\r
104                                   phHciNfc_sContext_t     *psHciContext\r
105                                   );\r
106 \r
107 /**\r
108 * \ingroup grp_hci_nfc\r
109 *\r
110 *   The phHciNfc_ISO15693_Get_PipeID function gives the pipe id of the ISO15693 \r
111 *   gate\r
112 *\r
113 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
114 *                                       context Structure.\r
115 *   \param[in]  pHwRef                  pHwRef is the Information of\r
116 *                                       the Device Interface Link\r
117 *\r
118 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
119 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
120 *                                       could not be interpreted properly.\r
121 *\r
122 */\r
123 extern\r
124 NFCSTATUS\r
125 phHciNfc_ISO15693_Get_PipeID(\r
126                               phHciNfc_sContext_t     *psHciContext,\r
127                               uint8_t                 *ppipe_id\r
128                               );\r
129 \r
130 /**\r
131 * \ingroup grp_hci_nfc\r
132 *\r
133 *  The phHciNfc_ISO15693_Update_PipeInfo function updates the pipe_id of the ISO15693\r
134 *  gate management Structure.\r
135 *\r
136 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
137 *                                      context Structure.\r
138 *  \param[in]  pipeID                  pipeID of the ISO15693 gate\r
139 *  \param[in]  pPipeInfo               Update the pipe Information of the ISO15693 \r
140 *                                      gate\r
141 *\r
142 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
143 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
144 *                                      could not be interpreted properly.\r
145 *\r
146 */\r
147 \r
148 extern\r
149 NFCSTATUS\r
150 phHciNfc_ISO15693_Update_PipeInfo(\r
151                                    phHciNfc_sContext_t     *psHciContext,\r
152                                    uint8_t                 pipeID,\r
153                                    phHciNfc_Pipe_Info_t    *pPipeInfo\r
154                                    );\r
155 \r
156 /**\r
157 * \ingroup grp_hci_nfc\r
158 *\r
159 *   The phHciNfc_ISO15693_Update_Info function stores the data sent by the \r
160 *   upper layer.\r
161 *\r
162 *   \param[in]  psHciContext     psHciContext is the pointer to HCI Layer\r
163 *                                context Structure.\r
164 *   \param[in]  infotype         To enable the ISO 15693 gate\r
165 *   \param[in]  iso_15693_info   ISO 15693 gate info\r
166 *\r
167 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
168 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
169 *                                       could not be interpreted properly.\r
170 *\r
171 */\r
172 extern\r
173 NFCSTATUS\r
174 phHciNfc_ISO15693_Update_Info(\r
175                              phHciNfc_sContext_t        *psHciContext,\r
176                              uint8_t                    infotype,\r
177                              void                       *iso_15693_info\r
178                              );\r
179 \r
180 /**\r
181 * \ingroup grp_hci_nfc\r
182 *\r
183 *   The phHciNfc_ISO15693_Sequence function executes the sequence of operations, to\r
184 *   get the NXP_ISO15693_INVENTORY, NXP_ISO15693_AFI.\r
185 *\r
186 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
187 *                                       context Structure.\r
188 *   \param[in]  pHwRef                  pHwRef is the Information of\r
189 *                                       the Device Interface Link\r
190 *\r
191 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
192 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
193 *                                       could not be interpreted properly.\r
194 *\r
195 */\r
196 extern\r
197 NFCSTATUS\r
198 phHciNfc_ISO15693_Info_Sequence (\r
199                        void             *psHciHandle,\r
200                        void             *pHwRef\r
201                        );\r
202 \r
203 /**\r
204 * \ingroup grp_hci_nfc\r
205 *\r
206 *   The phHciNfc_Send_ISO15693_Command function executes the command sent by the \r
207 *   upper layer, depending on the commands defined.\r
208 *\r
209 *   \param[in]  psContext        psContext is the pointer to HCI Layer\r
210 *                                context Structure.\r
211 *   \param[in]  pHwRef           pHwRef is the Information of\r
212 *                                the Device Interface Link\r
213 *   \param[in]  pipe_id          pipeID of the ISO 15693 gate \r
214 *   \param[in]  cmd              command that needs to be sent to the device\r
215 *\r
216 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
217 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
218 *                                       could not be interpreted properly.\r
219 *\r
220 */\r
221 extern \r
222 NFCSTATUS\r
223 phHciNfc_Send_ISO15693_Command(\r
224                               phHciNfc_sContext_t   *psHciContext,\r
225                               void                  *pHwRef,\r
226                               uint8_t               pipe_id,\r
227                               uint8_t               cmd\r
228                               );\r
229 \r
230 /**\r
231 * \ingroup grp_hci_nfc\r
232 *\r
233 *  The phHciNfc_ISO15693_Set_AFI function updates the AFI value \r
234 *\r
235 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer\r
236 *                                      context Structure.\r
237 *  \param[in]  pipeID                  pipeID of the ISO 15693 gate\r
238 *  \param[in]  pPipeInfo               Update the pipe Information of the ISO  \r
239 *                                      15693 gate\r
240 *\r
241 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.\r
242 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters\r
243 *                                      could not be interpreted properly.\r
244 *\r
245 */\r
246 extern\r
247 NFCSTATUS\r
248 phHciNfc_ISO15693_Set_AFI(\r
249                                void         *psContext,\r
250                                void         *pHwRef,\r
251                                uint8_t      afi_value\r
252                                );\r
253 \r
254 #endif /* #ifndef PHHCINFC_ISO15693_H */\r
255 \r
256 \r