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_Felica.h *
22 * \brief HCI Felica Management Routines. *
25 * Project: NFC-FRI-1.1 *
27 * $Date: Fri Jun 5 12:10:53 2009 $ *
28 * $Author: ing02260 $ *
30 * $Aliases: NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,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 $ *
32 * =========================================================================== *
35 #ifndef PHHCINFC_FELICA_H
36 #define PHHCINFC_FELICA_H
44 * File: \ref phHciNfc_Felica.h
48 #define PHHCINFC_FELICA_FILEREVISION "$Revision: 1.3 $" /**< \ingroup grp_file_attributes */
49 #define PHHCINFC_FELICA_FILEALIASES "$Aliases: NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,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 */
53 ***************************** Header File Inclusion ****************************
56 #include <phHciNfc_Generic.h>
59 ****************************** Macro Definitions *******************************
62 /* Commands exposed to the upper layer */
64 /* Enable the Felica */
65 #define HCI_FELICA_ENABLE 0x01U
66 #define HCI_FELICA_INFO_SEQ 0x02U
68 /* Felica read write commands */
69 #define NXP_FELICA_RAW 0x20U
70 #define NXP_FELICA_CMD 0x21U
73 ******************** Enumeration and Structure Definition **********************
75 typedef enum phHciNfc_Felica_Seq{
81 } phHciNfc_Felica_Seq_t;
83 /* Information structure for the Felica Gate */
84 typedef struct phHciNfc_Felica_Info{
85 /* Current running Sequence of the Felica Management */
86 phHciNfc_Felica_Seq_t current_seq;
87 /* Next running Sequence of the Felica Management */
88 phHciNfc_Felica_Seq_t next_seq;
89 /* Pointer to the Felica pipe information */
90 phHciNfc_Pipe_Info_t *p_pipe_info;
92 /* Flag to say about the multiple targets */
93 uint8_t multiple_tgts_found;
94 /* Felica information */
95 phHal_sRemoteDevInformation_t felica_info;
96 /* Enable or disable reader gate */
97 uint8_t enable_felica_gate;
98 /* UICC re-activation status */
99 uint8_t uicc_activation;
100 } phHciNfc_Felica_Info_t;
103 *********************** Function Prototype Declaration *************************
107 * \brief Allocates the resources of Felica management gate.
109 * This function Allocates the resources of the Felica management
110 * gate Information Structure.
115 phHciNfc_Felica_Init_Resources(
116 phHciNfc_sContext_t *psHciContext
120 * \ingroup grp_hci_nfc
122 * The phHciNfc_Felica_Get_PipeID function gives the pipe id of the Felica
125 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
127 * \param[in] pHwRef pHwRef is the Information of
128 * the Device Interface Link
130 * \retval NFCSTATUS_SUCCESS Function execution is successful.
131 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
132 * could not be interpreted properly.
137 phHciNfc_Felica_Get_PipeID(
138 phHciNfc_sContext_t *psHciContext,
144 * \ingroup grp_hci_nfc
146 * The phHciNfc_Felica_Update_PipeInfo function updates the pipe_id of the Felica
147 * gate management Structure.
149 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
151 * \param[in] pipeID pipeID of the Felica gate
152 * \param[in] pPipeInfo Update the pipe Information of the reader
155 * \retval NFCSTATUS_SUCCESS Function execution is successful.
156 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
157 * could not be interpreted properly.
163 phHciNfc_Felica_Update_PipeInfo(
164 phHciNfc_sContext_t *psHciContext,
166 phHciNfc_Pipe_Info_t *pPipeInfo
170 * \ingroup grp_hci_nfc
172 * The phHciNfc_ReaderA_Update_Info function updated the felica gate info.
174 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
176 * \param[in] infotype To enable the felica gate
177 * \param[in] fel_info felica gate info
179 * \retval NFCSTATUS_SUCCESS Function execution is successful.
180 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
181 * could not be interpreted properly.
185 phHciNfc_Felica_Update_Info(
186 phHciNfc_sContext_t *psHciContext,
192 * \ingroup grp_hci_nfc
194 * The phHciNfc_Felica_Info_Sequence function executes the sequence of operations, to
195 * get the SYSTEM CODE, IDM, PPM.
197 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
199 * \param[in] pHwRef pHwRef is the Information of
200 * the Device Interface Link
202 * \retval NFCSTATUS_SUCCESS Function execution is successful.
203 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
204 * could not be interpreted properly.
209 phHciNfc_Felica_Info_Sequence (
215 * \ingroup grp_hci_nfc
217 * The phHciNfc_Felica_Request_Mode function is to know about the felica tag is
218 * in the field or not
220 * \param[in] psHciContext psHciContext is the pointer to HCI Layer
222 * \param[in] pHwRef pHwRef is the Information of
223 * the Device Interface Link
225 * \retval NFCSTATUS_SUCCESS Function execution is successful.
226 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
227 * could not be interpreted properly.
232 phHciNfc_Felica_Request_Mode(
233 phHciNfc_sContext_t *psHciContext,
237 * \ingroup grp_hci_nfc
239 * The phHciNfc_Send_Felica_Command function executes the command sent by the
240 * upper layer, depending on the commands defined.
242 * \param[in] psContext psContext is the pointer to HCI Layer
244 * \param[in] pHwRef pHwRef is the Information of
245 * the Device Interface Link
246 * \param[in] pipe_id pipeID of the Felica gate
247 * \param[in] cmd command that needs to be sent to the device
248 * \param[in] length information length sent by the caller
249 * \param[in] params information related to the command
251 * \retval NFCSTATUS_SUCCESS Function execution is successful.
252 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
253 * could not be interpreted properly.
257 phHciNfc_Send_Felica_Command(
258 phHciNfc_sContext_t *psContext,
264 #endif /* #ifndef PHHCINFC_FELICA_H */