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.
20 * \brief HAL Configurations
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
26 * Project: NFC-FRI-1.1 / HAL4.0
28 * $Date: Thu Sep 9 14:56:35 2010 $
37 #ifndef PHNFC_CONFIG_H
38 #define PHNFC_CONFIG_H
45 * File: \ref phNfcConfig.h
50 #define PH_NFC_CONFIG_FILEREVISION "$Revision: 1.39 $" /**< \ingroup grp_file_attributes */
51 #define PH_NFC_CONFIG_FILEALIASES "$Aliases: $" /**< \ingroup grp_file_attributes */
55 /* -----------------Include files ---------------------------------------*/
57 #ifdef NFC_CUSTOM_CONFIG_INCLUDE
58 #include<nfc_custom_config.h>
61 /* ---------------- Macros ----------------------------------------------*/
66 *****************************************************************
67 ********************** DEFAULT MACROS **************************
68 *****************************************************************
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,
77 #ifndef NXP_DEFAULT_CLK_REQUEST
78 #define NXP_DEFAULT_CLK_REQUEST 0x00U
81 /**< External Input Clock Setting for the NFC Device,
82 0x00U No Input Clock Required (Use the Xtal),
87 0x05U Custom (Set the Custome Clock Registry),
90 #ifndef NXP_DEFAULT_INPUT_CLK
91 #define NXP_DEFAULT_INPUT_CLK 0x00U
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),
100 #ifndef NXP_UICC_PWR_REQUEST
101 #define NXP_UICC_PWR_REQUEST 0x00U
104 /**< TX LDO Configuration
111 #ifndef NXP_DEFAULT_TX_LDO
112 #define NXP_DEFAULT_TX_LDO 0x00U
115 /**< UICC Bit Rate Configuration
121 #ifndef NXP_UICC_BIT_RATE
122 #define NXP_UICC_BIT_RATE 0x08U
126 /**< Indicates PN544 Power Modes Configuration for the NFC Device,
127 0x00U -> PN544 stays in active bat mode
\r
128 (except when generating RF field)
129 0x01U -> PN544 goes in standby when possible otherwise
\r
130 stays in active bat mode
131 0x02U -> PN544 goes in idle mode as soon as it can
\r
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
\r
134 as soon as it can (otherwise it is in active bat except when
\r
138 #ifndef NXP_SYSTEM_PWR_STATUS
139 #define NXP_SYSTEM_PWR_STATUS 0x01U
142 /**< Default Session ID for Initialisation */
143 #ifndef DEFAULT_SESSION
144 #define DEFAULT_SESSION "android8"
\r
148 /* The Other Integration Configuration Values */
150 /**< Max number of remote devices supported */
152 #ifndef MAX_REMOTE_DEVICES
153 #define MAX_REMOTE_DEVICES 0x0A
\r
156 /**< System Event Notification
159 0x04 External RF Field
160 0x08 Memory Violation
161 0x10 Temperature Overheat
164 #ifndef NXP_SYSTEM_EVT_INFO
165 #define NXP_SYSTEM_EVT_INFO 0x3DU
169 #ifndef NFC_DEV_HWCONF_DEFAULT
170 #define NFC_DEV_HWCONF_DEFAULT 0xBCU
174 #ifndef NXP_ISO_XCHG_TIMEOUT
175 #define NXP_ISO_XCHG_TIMEOUT 0x1AU
178 #ifndef NXP_MIFARE_XCHG_TIMEOUT
179 #define NXP_MIFARE_XCHG_TIMEOUT 0x0BU
\r
182 #ifndef NXP_FELICA_XCHG_TIMEOUT
183 #define NXP_FELICA_XCHG_TIMEOUT 0xFFU
187 #ifndef NXP_NFCIP_PSL_BRS_DEFAULT
188 #define NXP_NFCIP_PSL_BRS_DEFAULT 0x00U
193 /**< ID For Invalid Timer */
194 #ifndef NXP_INVALID_TIMER_ID
195 #define NXP_INVALID_TIMER_ID 0xFFFFFFFFU
198 /**< Presence check interval in milliseconds */
199 #ifndef PRESENCE_CHECK_INTERVAL
200 #define PRESENCE_CHECK_INTERVAL 500U
203 /** Resolution value for the timer, here the
\r
204 timer resolution is 500 milliseconds */
205 #ifndef TIMER_RESOLUTION
206 #define TIMER_RESOLUTION 500U
209 /* Kindly note that the below Timeout values should be
210 * in Multiples of the value provided to TIMER_RESOLUTION
213 /**< Defines guard time out value for LLC timer,
\r
214 1000 is in milliseconds */
215 #ifndef LINK_GUARD_TIMEOUT
216 #define LINK_GUARD_TIMEOUT 1000U
220 /**< Defines connection time out value for LLC timer,
\r
221 1000 is in milliseconds */
222 #ifndef LINK_CONNECTION_TIMEOUT
223 #define LINK_CONNECTION_TIMEOUT 1000U
226 /**< Defines ACK time out value for LLC timer,
\r
227 150 is in milliseconds */
\r
228 #ifndef LINK_ACK_TIMEOUT
\r
229 #define LINK_ACK_TIMEOUT 1U
\r
233 /**< Defines Firmware Download Completion Timeout value ,
234 120000 is in milliseconds */
237 #ifndef NXP_DNLD_COMPLETE_TIMEOUT
238 #define NXP_DNLD_COMPLETE_TIMEOUT 60000U
\r
242 /**< Define to configure the Active Mode Polling Guard Time-out
\r
245 #ifndef DEV_MGMT_ACT_GRD_TO_DEFAULT
246 #define DEV_MGMT_ACT_GRD_TO_DEFAULT 0x20U
249 /**< NFCIP Active Mode Default Configuration (when acting as Target)
255 #ifndef NXP_NFCIP_ACTIVE_DEFAULT
256 #define NXP_NFCIP_ACTIVE_DEFAULT 0x01U
262 #ifndef NXP_NFC_HCI_TIMER
263 #define NXP_NFC_HCI_TIMER 1
264 #define NXP_NFC_HCI_TIMEOUT 6000
269 *****************************************************************
270 DO NOT MODIFY THE BELOW MACROS UNLESS OTHERWISE MENTIONED
271 *****************************************************************
276 #ifndef HOST_CE_A_SAK_DEFAULT
277 #define HOST_CE_A_SAK_DEFAULT 0x20U
280 #ifndef NXP_CE_A_ATQA_HIGH
281 #define NXP_CE_A_ATQA_HIGH 0x00U
284 #ifndef NXP_CE_A_ATQA_LOW
285 #define NXP_CE_A_ATQA_LOW 0x04U
289 #ifndef NXP_UICC_CE_RIGHTS
290 #define NXP_UICC_CE_RIGHTS 0x0FU
293 #ifndef NXP_UICC_RD_RIGHTS
294 #define NXP_UICC_RD_RIGHTS 0x00U
299 *****************************************************************
300 DO NOT DISABLE/ENABLE BELOW MACROS UNLESS OTHERWISE MENTIONED
301 *****************************************************************
307 *****************************************************************
308 *************** FEATURE SPECIFIC MACROS *************************
309 *****************************************************************
314 /**< Macro to Enable SMX Feature During
317 #if !defined(NXP_SMX)
322 #define NXP_HAL_ENABLE_SMX
\r
325 /**< Macro to Enable the Host Session
327 #define ESTABLISH_SESSION
329 /**< Macro to Enable the Peer to Peer Feature */
332 #define DEFAULT_NFCIP_INITIATOR_MODE_SUPPORT 0x3FU
\r
333 #define DEFAULT_NFCIP_TARGET_MODE_SUPPORT 0x0FU
\r
335 /**< Macro to Enable the ISO14443-B Feature */
338 /**< Macro to Enable the Felica Feature */
341 /**< Macro to Enable the JEWEL Feature */
344 /**< Macro to Enable the ISO15693 Feature */
345 #define TYPE_ISO15693
347 /*< Macro to Verify the Poll Parameters Set */
348 /* #define ENABLE_VERIFY_PARAM */
350 /**< Macro to Enable ISO 18092 Protocol compliancy
351 * SAK to be merged with the TYPE A Card RF Feature :3.1*/
352 #define TGT_MERGE_SAK
355 /**< Macro to Configure the default power status
356 * to allow the PN544 to enter into the Standby */
357 #define CFG_PWR_STATUS
360 /**< Macro to Enable the SWP Protocol
361 * to detect UICC During Initialisation */
364 /**< Macro to Enable the RAW Mode of Transaction
365 * for the ISO-14443-3A Compliant Targets */
366 #define ENABLE_MIFARE_RAW
368 /**< Macro to Enable the HOST List
369 * to allow the UICC Communication */
370 #define HOST_WHITELIST
372 /**< Support reconnecting to a different handle on the same tag */
373 #define RECONNECT_SUPPORT
375 /**< Macro to Enable the Card Emulation Feature */
376 /* #define HOST_EMULATION */
378 #define NXP_HAL_VERIFY_EEPROM_CRC 0x01U
380 /**< Macro to Enable the Download Mode Feature */
383 /**< Macro to Enable the Firmware Download Timer */
384 /* 0x01U to use overall timeout */
385 /* 0x02U to use per frame timeout */
386 #define FW_DOWNLOAD_TIMER 0x02U
388 /**< Macro to Verify the Firmware Download */
389 /* #define FW_DOWNLOAD_VERIFY */
391 #ifndef FW_DOWNLOAD_VERIFY
392 #define NXP_FW_INTEGRITY_CHK 1
395 /* To specify the Maximum TX/RX Len */
396 #define NXP_FW_MAX_TX_RX_LEN 0x200
398 #define UICC_CONNECTIVITY_PATCH
400 /* Work around to Delay the initiator activation */
401 /* #define NXP_NFCIP_ACTIVATE_DELAY */
403 /* Work around to Release the Discovered Target */
404 #define SW_RELEASE_TARGET
406 /* Macro to Allow the HCI Release in any state */
407 #define NXP_HCI_SHUTDOWN_OVERRIDE
410 /* Macro to Enable The P2P Transaction Timers */
411 #define P2P_TGT_TRANSACT_TIMER
413 #if (ES_HW_VER == 32)
414 /* Macro to Configure the Target Disable Register */
415 #define NFCIP_TGT_DISABLE_CFG
419 /*< Macro to Disable the Felica Mapping */
420 /* #define DISABLE_FELICA_MAPPING */
422 /*< Macro to Disable the Felica Mapping */
423 /* #define DISABLE_JEWEL_MAPPING */
425 /**< Macro to enable LLC timer */
426 #define LLC_TIMER_ENABLE
428 /**< Macro to enable HCI Response timer */
429 #define NXP_NFC_HCI_TIMER 1
\r
431 /* A Workaround to Delay and obtain the UICC Status Information */
432 /* #define UICC_STATUS_DELAY */
434 #ifdef UICC_STATUS_DELAY
435 #define UICC_STATUS_DELAY_COUNT 0x00100000
438 /**< Macro to delay the LLC RESET response callback,
439 Value is in milli-seconds */
440 #define LLC_RESET_DELAY 10
442 /* Macro to Enable the workaround for Tuning of
443 * RF for TYPE B and F
445 /* #define SW_TYPE_RF_TUNING_BF */
447 /* Workaround to update the Active Guard Timeout */
448 /* #define MAX_ACTIVATE_TIMEOUT */
450 /* #define ONE_BYTE_LEN */
452 #define NFC_RF_NOISE_SW
454 /**< Define to configure the PMOS Modulation Index value
457 #ifndef NFC_DEV_PMOS_MOD_DEFAULT
458 /* 0x3F -> 6%, 0x3A -> 10%, 0x3C -> 10%, 0x35 -> 15.8%, 0x28 -> 25.8% */
459 #define NFC_DEV_PMOS_MOD_DEFAULT 0x3CU
463 #ifndef SW_TYPE_RF_TUNING_BF
464 #define SW_TYPE_RF_TUNING_BF 0x80U
468 /* Reset the Default values of Host Link Timers */
469 /* Macro to Enable the Host Side Link Timeout Configuration
470 * 0x00 ----> Default Pre-defined Configuration;
471 * 0x01 ----> Update only the Host Link Guard Timeout Configuration;
472 * 0x03 ----> Update Both the Host Link Guard Timeout
473 and ACK Timeout Configuration;
476 #ifndef HOST_LINK_TIMEOUT
477 #define HOST_LINK_TIMEOUT 0x00U
481 #ifndef NXP_NFC_LINK_GRD_CFG_DEFAULT
482 #define NXP_NFC_LINK_GRD_CFG_DEFAULT 0x0032U
485 #ifndef NXP_NFC_LINK_ACK_CFG_DEFAULT
486 #define NXP_NFC_LINK_ACK_CFG_DEFAULT 0x0005U
489 /* Macro to Enable the Interface Character Timeout Configuration
490 * 0x00 ----> Default Pre-defined Configuration;
491 * 0x01 ----> Update the IFC Timeout Default Configuration;
494 #ifndef NXP_NFC_IFC_TIMEOUT
495 #define NXP_NFC_IFC_TIMEOUT 0x00
499 #ifndef NXP_NFC_IFC_CONFIG_DEFAULT
500 #define NXP_NFC_IFC_CONFIG_DEFAULT 0x203AU
503 #ifndef NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT
504 #define NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 0x00
508 *****************************************************************
509 *********** MACROS ENABLE EEPROM REGISTER WRITE ****************
510 *****************************************************************
514 /* Enable this to Disable the WI Notification */
515 /* #define DISABLE_WI_NOTIFICATION */
517 /* Macro to Enable the Configuration of Initiator
518 * speed during Discovery configuration
520 #define INITIATOR_SPEED
524 /* #define UICC_SESSION_RESET */
526 /* Macro to Enable the Configuration of UICC
527 * Timer and Bitrate during Initialisation
533 /* -----------------Structures and Enumerations -------------------------*/
538 /* -----------------Exported Functions----------------------------------*/
541 #endif /*PHNFC_CONFIG_H*/