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