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 "android8" 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 Default Configuration (when acting as Target) 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_INITIATOR_MODE_SUPPORT 0x3FU 327 #define DEFAULT_NFCIP_TARGET_MODE_SUPPORT 0x0FU 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 /**< Support reconnecting to a different handle on the same tag */ 367 #define RECONNECT_SUPPORT 368 369 /**< Macro to Enable the Card Emulation Feature */ 370 /* #define HOST_EMULATION */ 371 372 #define NXP_HAL_VERIFY_EEPROM_CRC 0x01U 373 374 /**< Macro to Enable the Download Mode Feature */ 375 #define FW_DOWNLOAD 376 377 /**< Macro to Enable the Firmware Download Timer */ 378 /* 0x01U to use overall timeout */ 379 /* 0x02U to use per frame timeout */ 380 #define FW_DOWNLOAD_TIMER 0x02U 381 382 /**< Macro to Verify the Firmware Download */ 383 /* #define FW_DOWNLOAD_VERIFY */ 384 385 #ifndef FW_DOWNLOAD_VERIFY 386 #define NXP_FW_INTEGRITY_CHK 1 387 #endif 388 389 /* To specify the Maximum TX/RX Len */ 390 #define NXP_FW_MAX_TX_RX_LEN 0x200 391 392 #define UICC_CONNECTIVITY_PATCH 393 394 /* Work around to Delay the initiator activation */ 395 /* #define NXP_NFCIP_ACTIVATE_DELAY */ 396 397 /* Work around to Release the Discovered Target */ 398 #define SW_RELEASE_TARGET 399 400 /* Macro to Allow the HCI Release in any state */ 401 #define NXP_HCI_SHUTDOWN_OVERRIDE 402 403 404 /* Macro to Enable The P2P Transaction Timers */ 405 #define P2P_TGT_TRANSACT_TIMER 406 407 #if (ES_HW_VER == 32) 408 /* Macro to Configure the Target Disable Register */ 409 #define NFCIP_TGT_DISABLE_CFG 410 411 #endif 412 413 /*< Macro to Disable the Felica Mapping */ 414 /* #define DISABLE_FELICA_MAPPING */ 415 416 /*< Macro to Disable the Felica Mapping */ 417 /* #define DISABLE_JEWEL_MAPPING */ 418 419 /**< Macro to enable LLC timer */ 420 #define LLC_TIMER_ENABLE 421 422 /**< Macro to enable HCI Response timer */ 423 #define NXP_NFC_HCI_TIMER 1 424 425 /* A Workaround to Delay and obtain the UICC Status Information */ 426 /* #define UICC_STATUS_DELAY */ 427 428 #ifdef UICC_STATUS_DELAY 429 #define UICC_STATUS_DELAY_COUNT 0x00100000 430 #endif 431 432 /**< Macro to delay the LLC RESET response callback, 433 Value is in milli-seconds */ 434 #define LLC_RESET_DELAY 10 435 436 /* Macro to Enable the workaround for Tuning of 437 * RF for TYPE B and F 438 */ 439 /* #define SW_TYPE_RF_TUNING_BF */ 440 441 /* Workaround to update the Active Guard Timeout */ 442 /* #define MAX_ACTIVATE_TIMEOUT */ 443 444 /* #define ONE_BYTE_LEN */ 445 446 #define NFC_RF_NOISE_SW 447 448 /**< Define to configure the PMOS Modulation Index value 449 */ 450 451 #ifndef NFC_DEV_PMOS_MOD_DEFAULT 452 /* 0x3F -> 6%, 0x3A -> 10%, 0x3C -> 10%, 0x35 -> 15.8%, 0x28 -> 25.8% */ 453 #define NFC_DEV_PMOS_MOD_DEFAULT 0x3CU 454 #endif 455 456 457 #ifndef SW_TYPE_RF_TUNING_BF 458 #define SW_TYPE_RF_TUNING_BF 0x80U 459 #endif 460 461 462 /* Reset the Default values of Host Link Timers */ 463 /* Macro to Enable the Host Side Link Timeout Configuration 464 * 0x00 ----> Default Pre-defined Configuration; 465 * 0x01 ----> Update only the Host Link Guard Timeout Configuration; 466 * 0x03 ----> Update Both the Host Link Guard Timeout 467 and ACK Timeout Configuration; 468 */ 469 470 #ifndef HOST_LINK_TIMEOUT 471 #define HOST_LINK_TIMEOUT 0x00U 472 #endif 473 474 475 #ifndef NXP_NFC_LINK_GRD_CFG_DEFAULT 476 #define NXP_NFC_LINK_GRD_CFG_DEFAULT 0x0032U 477 #endif 478 479 #ifndef NXP_NFC_LINK_ACK_CFG_DEFAULT 480 #define NXP_NFC_LINK_ACK_CFG_DEFAULT 0x0005U 481 #endif 482 483 /* Macro to Enable the Interface Character Timeout Configuration 484 * 0x00 ----> Default Pre-defined Configuration; 485 * 0x01 ----> Update the IFC Timeout Default Configuration; 486 */ 487 488 #ifndef NXP_NFC_IFC_TIMEOUT 489 #define NXP_NFC_IFC_TIMEOUT 0x00 490 #endif 491 492 493 #ifndef NXP_NFC_IFC_CONFIG_DEFAULT 494 #define NXP_NFC_IFC_CONFIG_DEFAULT 0x203AU 495 #endif 496 497 #ifndef NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 498 #define NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 0x00 499 #endif 500 501 /* 502 ***************************************************************** 503 *********** MACROS ENABLE EEPROM REGISTER WRITE **************** 504 ***************************************************************** 505 */ 506 507 508 /* Enable this to Disable the WI Notification */ 509 /* #define DISABLE_WI_NOTIFICATION */ 510 511 /* Macro to Enable the Configuration of Initiator 512 * speed during Discovery configuration 513 */ 514 #define INITIATOR_SPEED 515 516 517 /**/ 518 /* #define UICC_SESSION_RESET */ 519 520 /* Macro to Enable the Configuration of UICC 521 * Timer and Bitrate during Initialisation 522 */ 523 524 525 526 527 /* -----------------Structures and Enumerations -------------------------*/ 528 529 530 531 532 /* -----------------Exported Functions----------------------------------*/ 533 534 535 #endif /*PHNFC_CONFIG_H*/ 536 537