2 * Copyright (C) 2010 NXP Semiconductors
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
18 * =========================================================================== *
\r
21 * \file phHciNfc_RFReaderA.h *
\r
22 * \brief HCI Reader A Management Routines. *
\r
25 * Project: NFC-FRI-1.1 *
\r
27 * $Date: Fri Aug 14 17:01:27 2009 $ *
\r
28 * $Author: ing04880 $ *
\r
29 * $Revision: 1.17 $ *
\r
30 * $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
32 * =========================================================================== *
\r
36 #ifndef PHHCINFC_RFREADERA_H
\r
37 #define PHHCINFC_RFREADERA_H
\r
45 * File: \ref phHciNfc_ReaderA.h
\r
49 #define PHHCINFC_RFREADERA_FILEREVISION "$Revision: 1.17 $" /**< \ingroup grp_file_attributes */
\r
50 #define PHHCINFC_RFREADERA_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 ***************************** Header File Inclusion ****************************
\r
57 #include <phHciNfc_Generic.h>
\r
60 ****************************** Macro Definitions *******************************
\r
63 /* Commands exposed to the upper layer */
\r
64 #define NXP_WRA_CONTINUE_ACTIVATION 0x12U
\r
65 #define NXP_MIFARE_RAW 0x20U
\r
66 #define NXP_MIFARE_CMD 0x21U
\r
67 #define DATA_RATE_MAX_DEFAULT_VALUE 0x00U
\r
69 /* Enable the reader A */
\r
70 #define HCI_READER_A_ENABLE 0x01U
\r
71 #define HCI_READER_A_INFO_SEQ 0x02U
\r
73 #define RDR_A_TIMEOUT_MIN 0x00U
\r
74 #define RDR_A_TIMEOUT_MAX 0x15U
\r
76 ******************** Enumeration and Structure Definition **********************
\r
78 typedef enum phHciNfc_ReaderA_Seq{
\r
79 RDR_A_DATA_RATE_MAX,
\r
85 RDR_A_END_SEQUENCE,
\r
87 } phHciNfc_ReaderA_Seq_t;
\r
89 /* Information structure for the polling loop Gate */
\r
90 typedef struct phHciNfc_ReaderA_Info{
\r
91 /* Current running Sequence of the reader A Management */
\r
92 phHciNfc_ReaderA_Seq_t current_seq;
\r
93 /* Next running Sequence of the reader A Management */
\r
94 phHciNfc_ReaderA_Seq_t next_seq;
\r
95 /* Pointer to the reader A pipe information */
\r
96 phHciNfc_Pipe_Info_t *p_pipe_info;
\r
98 /* Flag to say about the multiple targets */
\r
99 uint8_t multiple_tgts_found;
\r
100 /* Reader A information */
\r
101 phHal_sRemoteDevInformation_t reader_a_info;
\r
102 /* Enable or disable reader gate */
\r
103 uint8_t enable_rdr_a_gate;
\r
104 /* UICC re-activation status */
\r
105 uint8_t uicc_activation;
\r
106 } phHciNfc_ReaderA_Info_t;
\r
109 *********************** Function Prototype Declaration *************************
\r
113 * \brief Allocates the resources of reader A management gate.
\r
115 * This function Allocates the resources of the reader A management
\r
116 * gate Information Structure.
\r
121 phHciNfc_ReaderA_Init_Resources(
\r
122 phHciNfc_sContext_t *psHciContext
\r
126 * \ingroup grp_hci_nfc
\r
128 * The phHciNfc_ReaderA_Get_PipeID function gives the pipe id of the reader A
\r
131 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
132 * context Structure.
\r
133 * \param[in] pHwRef pHwRef is the Information of
\r
134 * the Device Interface Link
\r
136 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
137 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
138 * could not be interpreted properly.
\r
143 phHciNfc_ReaderA_Get_PipeID(
\r
144 phHciNfc_sContext_t *psHciContext,
\r
149 * \ingroup grp_hci_nfc
\r
151 * The phHciNfc_ReaderA_Sequence function executes the sequence of operations, to
\r
152 * get the UID, SAK, ATQA etc.
\r
154 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
155 * context Structure.
\r
156 * \param[in] pHwRef pHwRef is the Information of
\r
157 * the Device Interface Link
\r
159 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
160 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
161 * could not be interpreted properly.
\r
166 phHciNfc_ReaderA_Info_Sequence (
\r
173 * \ingroup grp_hci_nfc
\r
175 * The phHciNfc_ReaderA_App_Data function is to get the application data information.
\r
177 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
178 * context Structure.
\r
179 * \param[in] pHwRef pHwRef is the Information of
\r
180 * the Device Interface Link
\r
182 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
183 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
184 * could not be interpreted properly.
\r
189 phHciNfc_ReaderA_App_Data (
\r
195 * \ingroup grp_hci_nfc
\r
197 * The phHciNfc_ReaderA_Fwi_Sfgt function is to get the frame waiting time
\r
200 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
201 * context Structure.
\r
202 * \param[in] pHwRef pHwRef is the Information of
\r
203 * the Device Interface Link
\r
205 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
206 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
207 * could not be interpreted properly.
\r
212 phHciNfc_ReaderA_Fwi_Sfgt (
\r
218 * \ingroup grp_hci_nfc
\r
220 * The phHciNfc_ReaderA_Update_PipeInfo function updates the pipe_id of the reader A
\r
221 * gate management Structure.
\r
223 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
224 * context Structure.
\r
225 * \param[in] pipeID pipeID of the reader A gate
\r
226 * \param[in] pPipeInfo Update the pipe Information of the reader
\r
229 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
230 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
231 * could not be interpreted properly.
\r
237 phHciNfc_ReaderA_Update_PipeInfo(
\r
238 phHciNfc_sContext_t *psHciContext,
\r
240 phHciNfc_Pipe_Info_t *pPipeInfo
\r
244 * \ingroup grp_hci_nfc
\r
246 * The phHciNfc_Send_ReaderA_Command function executes the command sent by the
\r
247 * upper layer, depending on the commands defined.
\r
249 * \param[in] psContext psContext is the pointer to HCI Layer
\r
250 * context Structure.
\r
251 * \param[in] pHwRef pHwRef is the Information of
\r
252 * the Device Interface Link
\r
253 * \param[in] pipe_id pipeID of the reader A gate
\r
254 * \param[in] cmd command that needs to be sent to the device
\r
255 * \param[in] length information length sent by the caller
\r
256 * \param[in] params information related to the command
\r
258 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
259 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
260 * could not be interpreted properly.
\r
265 phHciNfc_Send_ReaderA_Command(
\r
266 phHciNfc_sContext_t *psContext,
\r
273 * \ingroup grp_hci_nfc
\r
275 * The phHciNfc_ReaderA_Auto_Activate function updates auto activate register
\r
277 * \param[in] psContext psContext is the pointer to HCI Layer
\r
278 * context Structure.
\r
279 * \param[in] pHwRef pHwRef is the Information of
\r
280 * the Device Interface Link
\r
281 * \param[in] activate_enable to enable or disable auto activation
\r
283 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
284 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
285 * could not be interpreted properly.
\r
290 phHciNfc_ReaderA_Auto_Activate(
\r
293 uint8_t activate_enable
\r
297 * \ingroup grp_hci_nfc
\r
299 * The phHciNfc_Send_ReaderA_Command function executes the command sent by the
\r
300 * upper layer, depending on the commands defined.
\r
302 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
303 * context Structure.
\r
304 * \param[in] infotype To enable the reader A gate
\r
305 * \param[in] rdr_a_info reader A gate info
\r
307 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
308 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
309 * could not be interpreted properly.
\r
314 phHciNfc_ReaderA_Update_Info(
\r
315 phHciNfc_sContext_t *psHciContext,
\r
321 * \ingroup grp_hci_nfc
\r
323 * The phHciNfc_ReaderA_Cont_Active function executes NXP_WRA_CONTINUE_ACTIVATION
\r
324 * command to inform the CLF Controller after having received the event
\r
325 * EVT_TARGET_DISCOVERED to continue activation in case activation has
\r
326 * been stopped after successful SAK response. The response to this command, sent
\r
327 * as soon as the activation is finished, indicates the result of the
\r
328 * activation procedure
\r
330 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
331 * context Structure.
\r
332 * \param[in] pHwRef pHwRef is the Information of
\r
333 * the Device Interface Link
\r
334 * \param[in] pipeID pipeID of the reader A gate
\r
336 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
337 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
338 * could not be interpreted properly.
\r
343 phHciNfc_ReaderA_Cont_Activate (
\r
344 phHciNfc_sContext_t *psHciContext,
\r
349 * \ingroup grp_hci_nfc
\r
351 * The phHciNfc_ReaderA_Set_DataRateMax function updates the data rate max value
\r
353 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
\r
354 * context Structure.
\r
355 * \param[in] pipeID pipeID of the reader A gate
\r
356 * \param[in] pPipeInfo Update the pipe Information of the reader
\r
359 * \retval NFCSTATUS_SUCCESS Function execution is successful.
\r
360 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
\r
361 * could not be interpreted properly.
\r
366 phHciNfc_ReaderA_Set_DataRateMax(
\r
369 uint8_t data_rate_value
\r
372 #endif /* #ifndef PHHCINFC_RFREADERA_H */
\r