phNfcConfig.h revision 325757574e3fdca117f89c84d6db1766d8160b2a
1/*
2 * Copyright (C) 2010 NXP Semiconductors
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18/**
19* \file phNfcConfig.h
20* \brief HAL Configurations
21*
22*
23* \note This is the configuration header file of the HAL 4.0.All configurable parameters of the HAL 4.0
24*       are provided in this file
25*
26* Project: NFC-FRI-1.1 / HAL4.0
27*
28* $Date: Thu Sep  9 14:56:35 2010 $
29* $Author: ing04880 $
30* $Revision: 1.39 $
31* $Aliases:  $
32*
33*/
34
35
36/*@{*/
37#ifndef PHNFC_CONFIG_H
38#define PHNFC_CONFIG_H
39/*@}*/
40
41
42/**
43*  \name Hal
44*
45* File: \ref phNfcConfig.h
46*
47*/
48
49/*@{*/
50#define PH_NFC_CONFIG_FILEREVISION "$Revision: 1.39 $" /**< \ingroup grp_file_attributes */
51#define PH_NFC_CONFIG_FILEALIASES  "$Aliases:  $"     /**< \ingroup grp_file_attributes */
52/*@}*/
53
54
55/* -----------------Include files ---------------------------------------*/
56
57#ifdef NFC_CUSTOM_CONFIG_INCLUDE
58#include<nfc_custom_config.h>
59#endif
60
61/* ---------------- Macros ----------------------------------------------*/
62
63
64
65/*
66 *****************************************************************
67 **********************  DEFAULT MACROS **************************
68 *****************************************************************
69 */
70
71
72/**<  External Clock Request Configuration for the NFC Device,
73      0x00U     No Clock Request,
74      0x01U     Clock Request through CLKREQ pin (GPIO pin 2),
75      0x02U     Clock Request through NXP_EVT_CLK_REQUEST Event,
76      */
77#ifndef NXP_DEFAULT_CLK_REQUEST
78#define NXP_DEFAULT_CLK_REQUEST         0x00U
79#endif
80
81/**<  External Input Clock Setting for the NFC Device,
82      0x00U     No Input Clock Required (Use the Xtal),
83      0x01U     13 MHZ,
84      0x02U     19.2 MHZ,
85      0x03U     26 MHZ,
86      0x04U     38.4 MHZ,
87      0x05U     Custom (Set the Custome Clock Registry),
88      */
89
90#ifndef NXP_DEFAULT_INPUT_CLK
91#define NXP_DEFAULT_INPUT_CLK           0x00U
92#endif
93
94/**<  UICC Power Request configuration for the NFC Device,
95      0x00U     No Power Request,
96      0x01U     Power Request through CLKREQ pin (GPIO pin 2),
97      0x02U     Power Request through PWR_REQUEST (GPIO Pin 3),
98      */
99
100#ifndef NXP_UICC_PWR_REQUEST
101#define NXP_UICC_PWR_REQUEST            0x00U
102#endif
103
104/**<  TX LDO Configuration
105       0x00     00b     3.0 V,
106       0x01     01b     3.0 V,
107       0x02     10b     2.7 V,
108       0x03     11b     3.3 V,
109      */
110
111#ifndef NXP_DEFAULT_TX_LDO
112#define NXP_DEFAULT_TX_LDO              0x00U
113#endif
114
115/**<  UICC Bit Rate Configuration
116       0x02     212Kbits/Sec
117       0x04     424Kbits/Sec
118       0x08     828Kbits/Sec
119 */
120
121#ifndef NXP_UICC_BIT_RATE
122#define NXP_UICC_BIT_RATE               0x08U
123#endif
124
125
126/**<  Indicates PN544 Power Modes Configuration for the NFC Device,
127      0x00U -> PN544 stays in active bat mode
128               (except when generating RF field)
129      0x01U -> PN544 goes in standby when possible otherwise
130               stays in active bat mode
131      0x02U -> PN544 goes in idle mode as soon as it can
132               (otherwise it is in active bat except when generating RF field)
133      0x03U -> PN544 goes in standby when possible otherwise goes in idle mode
134               as soon as it can (otherwise it is in active bat except when
135               generating RF field)
136      */
137
138#ifndef NXP_SYSTEM_PWR_STATUS
139#define NXP_SYSTEM_PWR_STATUS           0x01U
140#endif
141
142/**< Default Session ID for Initialisation */
143#ifndef DEFAULT_SESSION
144#define DEFAULT_SESSION           "android5"
145#endif
146
147
148/* The Other Integration Configuration Values */
149
150/**< Max number of remote devices supported */
151
152#ifndef MAX_REMOTE_DEVICES
153#define MAX_REMOTE_DEVICES        0x0A
154#endif
155
156/**<  System Event Notification
157       0x01     Overcurrent
158       0x02     PMUVCC Switch
159       0x04     External RF Field
160       0x08     Memory Violation
161       0x10     Temperature Overheat
162 */
163
164#ifndef NXP_SYSTEM_EVT_INFO
165#define NXP_SYSTEM_EVT_INFO             0x3DU
166#endif
167
168
169#ifndef NFC_DEV_HWCONF_DEFAULT
170#define NFC_DEV_HWCONF_DEFAULT          0xBCU
171#endif
172
173
174#ifndef NXP_ISO_XCHG_TIMEOUT
175#define NXP_ISO_XCHG_TIMEOUT            0x1EU
176#endif
177
178#ifndef NXP_MIFARE_XCHG_TIMEOUT
179#define NXP_MIFARE_XCHG_TIMEOUT         0x03U
180#endif
181
182#ifndef NXP_FELICA_XCHG_TIMEOUT
183#define NXP_FELICA_XCHG_TIMEOUT         0xFFU
184#endif
185
186
187#ifndef NXP_NFCIP_PSL_BRS_DEFAULT
188#define NXP_NFCIP_PSL_BRS_DEFAULT       0x00U
189#endif
190
191
192
193/**< ID For Invalid Timer */
194#ifndef NXP_INVALID_TIMER_ID
195#define NXP_INVALID_TIMER_ID              0xFFFFFFFFU
196#endif
197
198/**< Presence check interval in milliseconds */
199#ifndef PRESENCE_CHECK_INTERVAL
200#define PRESENCE_CHECK_INTERVAL   500U
201#endif
202
203/** Resolution value for the timer, here the
204    timer resolution is 500 milliseconds */
205#ifndef TIMER_RESOLUTION
206#define TIMER_RESOLUTION                500U
207#endif
208
209/* Kindly note that the below Timeout values should be
210 * in Multiples of the value provided to TIMER_RESOLUTION
211 */
212
213/**< Defines guard time out value for LLC timer,
214    1000 is in milliseconds */
215#ifndef LINK_GUARD_TIMEOUT
216#define LINK_GUARD_TIMEOUT              1000U
217#endif
218
219
220/**< Defines connection time out value for LLC timer,
221    1000 is in milliseconds */
222#ifndef LINK_CONNECTION_TIMEOUT
223#define LINK_CONNECTION_TIMEOUT         1000U
224#endif
225
226
227/**< Defines Firmware Download Completion Timeout value ,
228    120000 is in milliseconds */
229
230
231#ifndef NXP_DNLD_COMPLETE_TIMEOUT
232#define NXP_DNLD_COMPLETE_TIMEOUT         120000U
233#endif
234
235
236/**< Define to configure the Active Mode Polling Guard Time-out
237  */
238
239#ifndef DEV_MGMT_ACT_GRD_TO_DEFAULT
240#define DEV_MGMT_ACT_GRD_TO_DEFAULT       0x20U
241#endif
242
243/**<  NFCIP Active Mode Configuration
244       0x01     106 kbps
245       0x02     212 kbps
246       0x04     424 kbps
247 */
248
249#ifndef NXP_NFCIP_ACTIVE_DEFAULT
250#define NXP_NFCIP_ACTIVE_DEFAULT        0x01U
251#endif
252
253
254
255
256#ifndef NXP_NFC_HCI_TIMER
257#define NXP_NFC_HCI_TIMER       0
258#define NXP_NFC_HCI_TIMEOUT     6000
259#endif
260
261
262/*
263 *****************************************************************
264  DO NOT MODIFY THE BELOW MACROS UNLESS OTHERWISE MENTIONED
265 *****************************************************************
266 */
267
268
269
270#ifndef HOST_CE_A_SAK_DEFAULT
271#define HOST_CE_A_SAK_DEFAULT           0x20U
272#endif
273
274#ifndef NXP_CE_A_ATQA_HIGH
275#define NXP_CE_A_ATQA_HIGH              0x00U
276#endif
277
278#ifndef NXP_CE_A_ATQA_LOW
279#define NXP_CE_A_ATQA_LOW               0x04U
280#endif
281
282
283#ifndef NXP_UICC_CE_RIGHTS
284#define NXP_UICC_CE_RIGHTS              0x0FU
285#endif
286
287#ifndef NXP_UICC_RD_RIGHTS
288#define NXP_UICC_RD_RIGHTS              0x00U
289#endif
290
291
292/*
293 *****************************************************************
294  DO NOT DISABLE/ENABLE BELOW MACROS UNLESS OTHERWISE MENTIONED
295 *****************************************************************
296 */
297
298#define ES_HW_VER   32
299
300/*
301 *****************************************************************
302 *************** FEATURE SPECIFIC MACROS *************************
303 *****************************************************************
304 */
305
306
307
308/**< Macro to Enable SMX Feature During
309 * Initialisation */
310
311#if !defined(NXP_SMX)
312#define NXP_SMX 1
313#endif
314
315#if (NXP_SMX == 1)
316#define NXP_HAL_ENABLE_SMX
317#endif
318
319/**< Macro to Enable the Host Session
320 * Initialisation */
321#define ESTABLISH_SESSION
322
323/**< Macro to Enable the Peer to Peer Feature */
324#define ENABLE_P2P
325
326#define DEFAULT_NFCIP_MODE_SUPPORT      0x0FU
327
328/**< Macro to Enable the ISO14443-B Feature */
329#define TYPE_B
330
331/**< Macro to Enable the Felica Feature */
332#define TYPE_FELICA
333
334/**< Macro to Enable the JEWEL Feature */
335#define TYPE_JEWEL
336
337/**< Macro to Enable the ISO15693 Feature */
338#define TYPE_ISO15693
339
340/*< Macro to Verify the Poll Parameters Set */
341/* #define ENABLE_VERIFY_PARAM */
342
343/**< Macro to Enable ISO 18092 Protocol compliancy
344 *  SAK to be merged with the TYPE A Card RF Feature :3.1*/
345#define TGT_MERGE_SAK
346
347
348/**< Macro to Configure the default power status
349 * to allow the PN544 to enter into the Standby */
350#define CFG_PWR_STATUS
351
352
353/**< Macro to Enable the SWP Protocol
354 * to detect UICC During Initialisation */
355#define ENABLE_UICC
356
357/**< Macro to Enable the RAW Mode of Transaction
358 * for the ISO-14443-3A Compliant Targets */
359#define ENABLE_MIFARE_RAW
360
361/**< Macro to Enable the HOST List
362 * to allow the UICC Communication */
363#define HOST_WHITELIST
364
365/**< Support reconnecting to a different handle on the same tag */
366#define RECONNECT_SUPPORT
367
368/**< Macro to Enable the Card Emulation Feature */
369/* #define HOST_EMULATION */
370
371/**< Macro to Enable the Download Mode Feature */
372#define FW_DOWNLOAD
373
374/**< Macro to Enable the Firmware Download Timer */
375#define FW_DOWNLOAD_TIMER
376
377/**< Macro to Verify the Firmware Download */
378/* #define FW_DOWNLOAD_VERIFY */
379
380#ifndef FW_DOWNLOAD_VERIFY
381#define NXP_FW_INTEGRITY_CHK    1
382#endif
383
384#define UICC_CONNECTIVITY_PATCH
385
386/* Work around to Delay the initiator activation */
387/* #define NXP_NFCIP_ACTIVATE_DELAY */
388
389/* Work around to Release the Discovered Target */
390#define SW_RELEASE_TARGET
391
392/* Macro to Allow the HCI Release in any state */
393#define NXP_HCI_SHUTDOWN_OVERRIDE
394
395
396/* Macro to Enable The P2P Transaction Timers */
397#define P2P_TGT_TRANSACT_TIMER
398
399#if (ES_HW_VER == 32)
400/* Macro to Configure the Target Disable Register */
401#define NFCIP_TGT_DISABLE_CFG
402
403#endif
404
405/*< Macro to Disable the Felica Mapping */
406/* #define DISABLE_FELICA_MAPPING */
407
408/*< Macro to Disable the Felica Mapping */
409/* #define DISABLE_JEWEL_MAPPING */
410
411/**< Macro to enable LLC timer */
412#define LLC_TIMER_ENABLE
413
414/**< Macro to enable HCI Response timer */
415#define NXP_NFC_HCI_TIMER 1
416
417/* A Workaround to Delay and obtain the UICC Status Information */
418/* #define UICC_STATUS_DELAY */
419
420#ifdef UICC_STATUS_DELAY
421#define UICC_STATUS_DELAY_COUNT 0x00100000
422#endif
423
424/**< Macro to delay the LLC RESET response callback,
425    Value is in milli-seconds */
426#define LLC_RESET_DELAY                 10
427
428/* Macro to Enable the workaround for Tuning of
429 * RF for TYPE B and F
430 */
431/* #define SW_TYPE_RF_TUNING_BF */
432
433/* Workaround to update the Active Guard Timeout */
434/* #define MAX_ACTIVATE_TIMEOUT */
435
436/* #define ONE_BYTE_LEN */
437
438#define NFC_RF_NOISE_SW
439
440/**< Define to configure the PMOS Modulation Index value
441  */
442
443#ifndef NFC_DEV_PMOS_MOD_DEFAULT
444/* 0x3F -> 6%, 0x3A -> 10%, 0x3C -> 10%, 0x35 -> 15.8%,  0x28 -> 25.8% */
445#define NFC_DEV_PMOS_MOD_DEFAULT          0x3CU
446#endif
447
448
449#ifndef SW_TYPE_RF_TUNING_BF
450#define SW_TYPE_RF_TUNING_BF              0x80U
451#endif
452
453
454/* Reset the Default values of Host Link Timers */
455/* Macro to Enable the Host Side Link Timeout Configuration
456 * 0x00 ----> Default Pre-defined Configuration;
457 * 0x01 ----> Update only the Host Link Guard Timeout Configuration;
458 * 0x03 ----> Update Both the Host Link Guard Timeout
459              and ACK Timeout Configuration;
460 */
461
462#ifndef HOST_LINK_TIMEOUT
463#define HOST_LINK_TIMEOUT              0x00U
464#endif
465
466
467#ifndef NXP_NFC_LINK_GRD_CFG_DEFAULT
468#define NXP_NFC_LINK_GRD_CFG_DEFAULT   0x0032U
469#endif
470
471#ifndef NXP_NFC_LINK_ACK_CFG_DEFAULT
472#define NXP_NFC_LINK_ACK_CFG_DEFAULT   0x0005U
473#endif
474
475/* Macro to Enable the Interface Character Timeout Configuration
476 * 0x00 ----> Default Pre-defined Configuration;
477 * 0x01 ----> Update the IFC Timeout Default Configuration;
478 */
479
480#ifndef NXP_NFC_IFC_TIMEOUT
481#define NXP_NFC_IFC_TIMEOUT            0x00
482#endif
483
484
485#ifndef NXP_NFC_IFC_CONFIG_DEFAULT
486#define NXP_NFC_IFC_CONFIG_DEFAULT     0x203AU
487#endif
488
489#ifndef NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT
490#define NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 0x00
491#endif
492
493/*
494 *****************************************************************
495 ***********  MACROS ENABLE EEPROM REGISTER WRITE ****************
496 *****************************************************************
497 */
498
499
500/* Enable this to Disable the WI Notification */
501/* #define DISABLE_WI_NOTIFICATION */
502
503/* Macro to Enable the Configuration of Initiator
504 * speed during Discovery configuration
505 */
506#define INITIATOR_SPEED
507
508
509/**/
510/* #define UICC_SESSION_RESET */
511
512/* Macro to Enable the Configuration of UICC
513 * Timer and Bitrate during Initialisation
514 */
515
516
517
518
519/* -----------------Structures and Enumerations -------------------------*/
520
521
522
523
524/* -----------------Exported Functions----------------------------------*/
525
526
527#endif /*PHNFC_CONFIG_H*/
528
529