phNfcConfig.h revision 4c03147f9df22103145e67ce1d7faece051e0bfb
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: Fri Jun 11 16:20:17 2010 $
29* $Author: ing04880 $
30* $Revision: 1.37 $
31* $Aliases: NFC_FRI1.1_WK1023_R35_1 $
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.37 $" /**< \ingroup grp_file_attributes */
51#define PH_NFC_CONFIG_FILEALIASES  "$Aliases: NFC_FRI1.1_WK1023_R35_1 $"     /**< \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           "NXP-NFC1"
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            0x1AU
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     0x5000
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 0
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      0x0EU
327
328
329/**< Macro to Enable the ISO14443-B Feature */
330#define TYPE_B
331
332/**< Macro to Enable the Felica Feature */
333#define TYPE_FELICA
334
335/**< Macro to Enable the JEWEL Feature */
336#define TYPE_JEWEL
337
338/**< Macro to Enable the ISO15693 Feature */
339#define TYPE_ISO15693
340
341/*< Macro to Verify the Poll Parameters Set */
342/* #define ENABLE_VERIFY_PARAM */
343
344/**< Macro to Enable ISO 18092 Protocol compliancy
345 *  SAK to be merged with the TYPE A Card RF Feature :3.1*/
346#define TGT_MERGE_SAK
347
348
349/**< Macro to Configure the default power status
350 * to allow the PN544 to enter into the Standby */
351#define CFG_PWR_STATUS
352
353
354/**< Macro to Enable the SWP Protocol
355 * to detect UICC During Initialisation */
356#define ENABLE_UICC
357
358/**< Macro to Enable the RAW Mode of Transaction
359 * for the ISO-14443-3A Compliant Targets */
360#define ENABLE_MIFARE_RAW
361
362/**< Macro to Enable the HOST List
363 * to allow the UICC Communication */
364#define HOST_WHITELIST
365
366
367/**< Macro to Enable the Card Emulation Feature */
368/* #define HOST_EMULATION */
369
370/**< Macro to Enable the Download Mode Feature */
371//#define FW_DOWNLOAD
372
373/**< Macro to Enable the Firmware Download Timer */
374#define FW_DOWNLOAD_TIMER
375
376/**< Macro to Verify the Firmware Download */
377/* #define FW_DOWNLOAD_VERIFY */
378
379#ifndef FW_DOWNLOAD_VERIFY
380#define NXP_FW_INTEGRITY_CHK
381#endif
382
383#define UICC_CONNECTIVITY_PATCH
384
385/* Work around to Delay the initiator activation */
386/* #define NXP_NFCIP_ACTIVATE_DELAY */
387
388/* Work around to Release the Discovered Target */
389#define SW_RELEASE_TARGET
390
391/* Macro to Allow the HCI Release in any state */
392#define NXP_HCI_SHUTDOWN_OVERRIDE
393
394
395/* Macro to Enable The P2P Transaction Timers */
396#define P2P_TGT_TRANSACT_TIMER
397
398#if (ES_HW_VER == 32)
399/* Macro to Configure the Target Disable Register */
400#define NFCIP_TGT_DISABLE_CFG
401
402#endif
403
404/*< Macro to Disable the Felica Mapping */
405/* #define DISABLE_FELICA_MAPPING */
406
407/*< Macro to Disable the Felica Mapping */
408/* #define DISABLE_JEWEL_MAPPING */
409
410/**< Macro to enable LLC timer */
411#define LLC_TIMER_ENABLE
412
413/**< Macro to enable HCI Response timer */
414/* #define NXP_NFC_HCI_TIMER 1 */
415
416/* A Workaround to Delay and obtain the UICC Status Information */
417/* #define UICC_STATUS_DELAY */
418
419#ifdef UICC_STATUS_DELAY
420#define UICC_STATUS_DELAY_COUNT 0x00100000
421#endif
422
423/**< Macro to delay the LLC RESET response callback,
424    Value is in milli-seconds */
425#define LLC_RESET_DELAY                 10
426
427/* Macro to Enable the workaround for Tuning of
428 * RF for TYPE B and F
429 */
430/* #define SW_TYPE_RF_TUNING_BF */
431
432/* Workaround to update the Active Guard Timeout */
433/* #define MAX_ACTIVATE_TIMEOUT */
434
435/* #define ONE_BYTE_LEN */
436
437#define NFC_RF_NOISE_SW
438
439/**< Define to configure the PMOS Modulation Index value
440  */
441
442#ifndef NFC_DEV_PMOS_MOD_DEFAULT
443/* 0x3F -> 6%, 0x3A -> 10%, 0x3C -> 10%, 0x35 -> 15.8%,  0x28 -> 25.8% */
444#define NFC_DEV_PMOS_MOD_DEFAULT          0x3CU
445#endif
446
447
448#ifndef SW_TYPE_RF_TUNING_BF
449#define SW_TYPE_RF_TUNING_BF              0x80U
450#endif
451
452
453/* Reset the Default values of Host Link Timers */
454/* Macro to Enable the Host Side Link Timeout Configuration
455 * 0x00 ----> Default Pre-defined Configuration;
456 * 0x01 ----> Update only the Host Link Guard Timeout Configuration;
457 * 0x03 ----> Update Both the Host Link Guard Timeout
458              and ACK Timeout Configuration;
459 */
460
461#ifndef HOST_LINK_TIMEOUT
462#define HOST_LINK_TIMEOUT              0x00U
463#endif
464
465
466#ifndef NXP_NFC_LINK_GRD_CFG_DEFAULT
467#define NXP_NFC_LINK_GRD_CFG_DEFAULT   0x0032U
468#endif
469
470#ifndef NXP_NFC_LINK_ACK_CFG_DEFAULT
471#define NXP_NFC_LINK_ACK_CFG_DEFAULT   0x0005U
472#endif
473
474/* Macro to Enable the Interface Character Timeout Configuration
475 * 0x00 ----> Default Pre-defined Configuration;
476 * 0x01 ----> Update the IFC Timeout Default Configuration;
477 */
478
479#ifndef NXP_NFC_IFC_TIMEOUT
480#define NXP_NFC_IFC_TIMEOUT            0x00
481#endif
482
483
484#ifndef NXP_NFC_IFC_CONFIG_DEFAULT
485#define NXP_NFC_IFC_CONFIG_DEFAULT     0x203AU
486#endif
487
488
489
490/*
491 *****************************************************************
492 ***********  MACROS ENABLE EEPROM REGISTER WRITE ****************
493 *****************************************************************
494 */
495
496
497/* Enable this to Disable the WI Notification */
498/* #define DISABLE_WI_NOTIFICATION */
499
500/* Macro to Enable the Configuration of Initiator
501 * speed during Discovery configuration
502 */
503#define INITIATOR_SPEED
504
505
506/**/
507/* #define UICC_SESSION_RESET */
508
509/* Macro to Enable the Configuration of UICC
510 * Timer and Bitrate during Initialisation
511 */
512
513
514
515
516/* -----------------Structures and Enumerations -------------------------*/
517
518
519
520
521/* -----------------Exported Functions----------------------------------*/
522
523
524#endif /*PHNFC_CONFIG_H*/
525
526