2 * Copyright (C) 2010 NXP Semiconductors
3 * Copyright (C) 2012 Samsung Elevtronics Co., Ltd
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * \brief HAL Configurations
24 * \note This is the configuration header file of the HAL 4.0.All configurable parameters of the HAL 4.0
25 * are provided in this file
27 * Project: NFC-FRI-1.1 / HAL4.0
29 * $Date: Thu Sep 9 14:56:35 2010 $
38 #ifndef PHNFC_CONFIG_H
39 #define PHNFC_CONFIG_H
46 * File: \ref phNfcConfig.h
51 #define PH_NFC_CONFIG_FILEREVISION "$Revision: 1.39 $" /**< \ingroup grp_file_attributes */
52 #define PH_NFC_CONFIG_FILEALIASES "$Aliases: $" /**< \ingroup grp_file_attributes */
56 /* -----------------Include files ---------------------------------------*/
58 #ifdef NFC_CUSTOM_CONFIG_INCLUDE
59 #include<nfc_custom_config.h>
62 /* ---------------- Macros ----------------------------------------------*/
67 *****************************************************************
68 ********************** DEFAULT MACROS **************************
69 *****************************************************************
73 /**< External Clock Request Configuration for the NFC Device,
74 0x00U No Clock Request,
75 0x01U Clock Request through CLKREQ pin (GPIO pin 2),
76 0x02U Clock Request through NXP_EVT_CLK_REQUEST Event,
78 #ifndef NXP_DEFAULT_CLK_REQUEST
79 #define NXP_DEFAULT_CLK_REQUEST 0x00U
82 /**< External Input Clock Setting for the NFC Device,
83 0x00U No Input Clock Required (Use the Xtal),
88 0x05U Custom (Set the Custome Clock Registry),
91 #ifndef NXP_DEFAULT_INPUT_CLK
92 #define NXP_DEFAULT_INPUT_CLK 0x00U
95 /**< UICC Power Request configuration for the NFC Device,
96 0x00U No Power Request,
97 0x01U Power Request through CLKREQ pin (GPIO pin 2),
98 0x02U Power Request through PWR_REQUEST (GPIO Pin 3),
101 #ifndef NXP_UICC_PWR_REQUEST
102 #define NXP_UICC_PWR_REQUEST 0x00U
105 /**< TX LDO Configuration
112 #ifndef NXP_DEFAULT_TX_LDO
113 #define NXP_DEFAULT_TX_LDO 0x00U
116 /**< UICC Bit Rate Configuration
122 #ifndef NXP_UICC_BIT_RATE
123 #define NXP_UICC_BIT_RATE 0x08U
127 /**< Indicates PN544 Power Modes Configuration for the NFC Device,
128 0x00U -> PN544 stays in active bat mode
129 (except when generating RF field)
130 0x01U -> PN544 goes in standby when possible otherwise
131 stays in active bat mode
132 0x02U -> PN544 goes in idle mode as soon as it can
133 (otherwise it is in active bat except when generating RF field)
134 0x03U -> PN544 goes in standby when possible otherwise goes in idle mode
135 as soon as it can (otherwise it is in active bat except when
139 #ifndef NXP_SYSTEM_PWR_STATUS
140 #define NXP_SYSTEM_PWR_STATUS 0x01U
143 /**< Default Session ID for Initialisation */
144 #ifndef DEFAULT_SESSION
145 #define DEFAULT_SESSION "android8"
\r
149 /* The Other Integration Configuration Values */
151 /**< Max number of remote devices supported */
153 #ifndef MAX_REMOTE_DEVICES
154 #define MAX_REMOTE_DEVICES 0x0A
157 /**< System Event Notification
160 0x04 External RF Field
161 0x08 Memory Violation
162 0x10 Temperature Overheat
165 #ifndef NXP_SYSTEM_EVT_INFO
166 #define NXP_SYSTEM_EVT_INFO 0x3DU
170 #ifndef NFC_DEV_HWCONF_DEFAULT
171 #define NFC_DEV_HWCONF_DEFAULT 0xBCU
175 #ifndef NXP_ISO_XCHG_TIMEOUT
176 #define NXP_ISO_XCHG_TIMEOUT 0x1AU
179 #ifndef NXP_MIFARE_XCHG_TIMEOUT
180 #define NXP_MIFARE_XCHG_TIMEOUT 0x03U
183 #ifndef NXP_FELICA_XCHG_TIMEOUT
184 #define NXP_FELICA_XCHG_TIMEOUT 0xFFU
188 #ifndef NXP_NFCIP_PSL_BRS_DEFAULT
189 #define NXP_NFCIP_PSL_BRS_DEFAULT 0x00U
194 /**< ID For Invalid Timer */
195 #ifndef NXP_INVALID_TIMER_ID
196 #define NXP_INVALID_TIMER_ID 0xFFFFFFFFU
199 /**< Presence check interval in milliseconds */
200 #ifndef PRESENCE_CHECK_INTERVAL
201 #define PRESENCE_CHECK_INTERVAL 500U
204 /** Resolution value for the timer, here the
205 timer resolution is 500 milliseconds */
206 #ifndef TIMER_RESOLUTION
207 #define TIMER_RESOLUTION 500U
210 /* Kindly note that the below Timeout values should be
211 * in Multiples of the value provided to TIMER_RESOLUTION
214 /**< Defines guard time out value for LLC timer,
215 1000 is in milliseconds */
216 #ifndef LINK_GUARD_TIMEOUT
217 #define LINK_GUARD_TIMEOUT 1000U
221 /**< Defines connection time out value for LLC timer,
222 1000 is in milliseconds */
223 #ifndef LINK_CONNECTION_TIMEOUT
224 #define LINK_CONNECTION_TIMEOUT 1000U
228 /**< Defines Firmware Download Completion Timeout value ,
229 120000 is in milliseconds */
232 #ifndef NXP_DNLD_COMPLETE_TIMEOUT
233 #define NXP_DNLD_COMPLETE_TIMEOUT 120000U
237 /**< Define to configure the Active Mode Polling Guard Time-out
240 #ifndef DEV_MGMT_ACT_GRD_TO_DEFAULT
241 #define DEV_MGMT_ACT_GRD_TO_DEFAULT 0x20U
244 /**< NFCIP Active Mode Default Configuration (when acting as Target)
250 #ifndef NXP_NFCIP_ACTIVE_DEFAULT
251 #define NXP_NFCIP_ACTIVE_DEFAULT 0x01U
257 #ifndef NXP_NFC_HCI_TIMER
258 #define NXP_NFC_HCI_TIMER 1
259 #define NXP_NFC_HCI_TIMEOUT 6000
264 *****************************************************************
265 DO NOT MODIFY THE BELOW MACROS UNLESS OTHERWISE MENTIONED
266 *****************************************************************
271 #ifndef HOST_CE_A_SAK_DEFAULT
272 #define HOST_CE_A_SAK_DEFAULT 0x20U
275 #ifndef NXP_CE_A_ATQA_HIGH
276 #define NXP_CE_A_ATQA_HIGH 0x00U
279 #ifndef NXP_CE_A_ATQA_LOW
280 #define NXP_CE_A_ATQA_LOW 0x04U
284 #ifndef NXP_UICC_CE_RIGHTS
285 #define NXP_UICC_CE_RIGHTS 0x0FU
288 #ifndef NXP_UICC_RD_RIGHTS
289 #define NXP_UICC_RD_RIGHTS 0x00U
294 *****************************************************************
295 DO NOT DISABLE/ENABLE BELOW MACROS UNLESS OTHERWISE MENTIONED
296 *****************************************************************
302 *****************************************************************
303 *************** FEATURE SPECIFIC MACROS *************************
304 *****************************************************************
309 /**< Macro to Enable SMX Feature During
312 #if !defined(NXP_SMX)
317 #define NXP_HAL_ENABLE_SMX
320 /**< Macro to Enable the Host Session
322 #define ESTABLISH_SESSION
324 /**< Macro to Enable the Peer to Peer Feature */
327 #define DEFAULT_NFCIP_INITIATOR_MODE_SUPPORT 0x3FU
\r
328 #define DEFAULT_NFCIP_TARGET_MODE_SUPPORT 0x0FU
\r
330 /**< Macro to Enable the ISO14443-B Feature */
333 /**< Macro to Enable the Felica Feature */
336 /**< Macro to Enable the JEWEL Feature */
339 /**< Macro to Enable the ISO15693 Feature */
340 #define TYPE_ISO15693
342 /*< Macro to Verify the Poll Parameters Set */
343 /* #define ENABLE_VERIFY_PARAM */
345 /**< Macro to Enable ISO 18092 Protocol compliancy
346 * SAK to be merged with the TYPE A Card RF Feature :3.1*/
347 #define TGT_MERGE_SAK
350 /**< Macro to Configure the default power status
351 * to allow the PN544 to enter into the Standby */
352 #define CFG_PWR_STATUS
355 /**< Macro to Enable the SWP Protocol
356 * to detect UICC During Initialisation */
359 /**< Macro to Enable the RAW Mode of Transaction
360 * for the ISO-14443-3A Compliant Targets */
361 #define ENABLE_MIFARE_RAW
363 /**< Macro to Enable the HOST List
364 * to allow the UICC Communication */
365 #define HOST_WHITELIST
367 /**< Support reconnecting to a different handle on the same tag */
368 #define RECONNECT_SUPPORT
370 /**< Macro to Enable the Card Emulation Feature */
371 /* #define HOST_EMULATION */
373 #define NXP_HAL_VERIFY_EEPROM_CRC 0x01U
375 /**< Macro to Enable the Download Mode Feature */
378 /**< Macro to Enable the Firmware Download Timer */
379 /* 0x01U to use overall timeout */
380 /* 0x02U to use per frame timeout */
381 #define FW_DOWNLOAD_TIMER 0x02U
383 /**< Macro to Verify the Firmware Download */
384 /* #define FW_DOWNLOAD_VERIFY */
386 #ifndef FW_DOWNLOAD_VERIFY
387 #define NXP_FW_INTEGRITY_CHK 1
390 /* To specify the Maximum TX/RX Len */
391 #define NXP_FW_MAX_TX_RX_LEN 0x200
393 #define UICC_CONNECTIVITY_PATCH
395 /* Work around to Delay the initiator activation */
396 /* #define NXP_NFCIP_ACTIVATE_DELAY */
398 /* Work around to Release the Discovered Target */
399 #define SW_RELEASE_TARGET
401 /* Macro to Allow the HCI Release in any state */
402 #define NXP_HCI_SHUTDOWN_OVERRIDE
405 /* Macro to Enable The P2P Transaction Timers */
406 #define P2P_TGT_TRANSACT_TIMER
408 #if (ES_HW_VER == 32)
409 /* Macro to Configure the Target Disable Register */
410 #define NFCIP_TGT_DISABLE_CFG
414 /*< Macro to Disable the Felica Mapping */
415 /* #define DISABLE_FELICA_MAPPING */
417 /*< Macro to Disable the Felica Mapping */
418 /* #define DISABLE_JEWEL_MAPPING */
420 /**< Macro to enable LLC timer */
421 #define LLC_TIMER_ENABLE
423 /**< Macro to enable HCI Response timer */
424 /* #define NXP_NFC_HCI_TIMER 1 */
426 /* A Workaround to Delay and obtain the UICC Status Information */
427 /* #define UICC_STATUS_DELAY */
429 #ifdef UICC_STATUS_DELAY
430 #define UICC_STATUS_DELAY_COUNT 0x00100000
433 /**< Macro to delay the LLC RESET response callback,
434 Value is in milli-seconds */
435 #define LLC_RESET_DELAY 10
437 /* Macro to Enable the workaround for Tuning of
438 * RF for TYPE B and F
440 /* #define SW_TYPE_RF_TUNING_BF */
442 /* Workaround to update the Active Guard Timeout */
443 /* #define MAX_ACTIVATE_TIMEOUT */
445 /* #define ONE_BYTE_LEN */
447 #define NFC_RF_NOISE_SW
449 /**< Define to configure the PMOS Modulation Index value
452 #ifndef NFC_DEV_PMOS_MOD_DEFAULT
453 /* 0x3F -> 6%, 0x3A -> 10%, 0x3C -> 10%, 0x35 -> 15.8%, 0x28 -> 25.8% */
454 #define NFC_DEV_PMOS_MOD_DEFAULT 0x3CU
458 #ifndef SW_TYPE_RF_TUNING_BF
459 #define SW_TYPE_RF_TUNING_BF 0x80U
463 /* Reset the Default values of Host Link Timers */
464 /* Macro to Enable the Host Side Link Timeout Configuration
465 * 0x00 ----> Default Pre-defined Configuration;
466 * 0x01 ----> Update only the Host Link Guard Timeout Configuration;
467 * 0x03 ----> Update Both the Host Link Guard Timeout
468 and ACK Timeout Configuration;
471 #ifndef HOST_LINK_TIMEOUT
472 #define HOST_LINK_TIMEOUT 0x00U
476 #ifndef NXP_NFC_LINK_GRD_CFG_DEFAULT
477 #define NXP_NFC_LINK_GRD_CFG_DEFAULT 0x0032U
480 #ifndef NXP_NFC_LINK_ACK_CFG_DEFAULT
481 #define NXP_NFC_LINK_ACK_CFG_DEFAULT 0x0005U
484 /* Macro to Enable the Interface Character Timeout Configuration
485 * 0x00 ----> Default Pre-defined Configuration;
486 * 0x01 ----> Update the IFC Timeout Default Configuration;
489 #ifndef NXP_NFC_IFC_TIMEOUT
490 #define NXP_NFC_IFC_TIMEOUT 0x00
494 #ifndef NXP_NFC_IFC_CONFIG_DEFAULT
495 #define NXP_NFC_IFC_CONFIG_DEFAULT 0x203AU
498 #ifndef NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT
499 #define NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 0x00
503 *****************************************************************
504 *********** MACROS ENABLE EEPROM REGISTER WRITE ****************
505 *****************************************************************
509 /* Enable this to Disable the WI Notification */
510 /* #define DISABLE_WI_NOTIFICATION */
512 /* Macro to Enable the Configuration of Initiator
513 * speed during Discovery configuration
515 #define INITIATOR_SPEED
519 /* #define UICC_SESSION_RESET */
521 /* Macro to Enable the Configuration of UICC
522 * Timer and Bitrate during Initialisation
528 /* -----------------Structures and Enumerations -------------------------*/
533 /* -----------------Exported Functions----------------------------------*/
536 #endif /*PHNFC_CONFIG_H*/