nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 2009-2014 Broadcom Corporation |
| 4 | * |
| 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: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 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. |
| 16 | * |
| 17 | ******************************************************************************/ |
| 18 | /****************************************************************************** |
| 19 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 20 | * The original Work has been changed by NXP. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 21 | * |
| 22 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 23 | * you may not use this file except in compliance with the License. |
| 24 | * You may obtain a copy of the License at |
| 25 | * |
| 26 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 27 | * |
| 28 | * Unless required by applicable law or agreed to in writing, software |
| 29 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 30 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 31 | * See the License for the specific language governing permissions and |
| 32 | * limitations under the License. |
| 33 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 34 | * Copyright 2018 NXP |
| 35 | * |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 36 | ******************************************************************************/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 37 | /****************************************************************************** |
| 38 | * |
| 39 | * This file contains the Near Field Communication (NFC) API function |
| 40 | * external definitions. |
| 41 | * |
| 42 | ******************************************************************************/ |
| 43 | |
| 44 | #ifndef NFC_API_H |
| 45 | #define NFC_API_H |
| 46 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 47 | #include "gki.h" |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 48 | #include "nci_defs.h" |
| 49 | #include "nfc_hal_api.h" |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 50 | #include "nfc_target.h" |
| 51 | |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 52 | #include "vendor_cfg.h" |
nxpandroid | 84a71e0 | 2017-08-14 11:58:25 +0530 | [diff] [blame] | 53 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 54 | |
| 55 | #if (NXP_EXTNS == TRUE) |
| 56 | #define NXP_EN_SN100U 1 |
| 57 | #define NXP_ANDROID_VER (9U) /* NXP android version */ |
| 58 | #define NFC_NXP_MW_VERSION_MAJ (0x00) /* MW Major Version */ |
nxf24591 | 37d4e16 | 2018-08-07 10:24:20 +0530 | [diff] [blame] | 59 | #define NFC_NXP_MW_VERSION_MIN (0x0B) /* MW Minor Version */ |
nxf24591 | 674f272 | 2018-08-08 00:56:16 +0530 | [diff] [blame] | 60 | #define NFC_NXP_MW_RC_VERSION (0x00) /* MW Minor Version */ |
nxf24591 | 48793b6 | 2018-06-06 14:40:49 +0530 | [diff] [blame] | 61 | #define NFC_EE_DISC_OP_REMOVE 1 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 62 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 63 | /* NFC application return status codes */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 64 | /* Command succeeded */ |
| 65 | #define NFC_STATUS_OK NCI_STATUS_OK |
| 66 | /* Command is rejected. */ |
| 67 | #define NFC_STATUS_REJECTED NCI_STATUS_REJECTED |
| 68 | /* Message is corrupted */ |
| 69 | #define NFC_STATUS_MSG_CORRUPTED NCI_STATUS_MESSAGE_CORRUPTED |
| 70 | /* buffer full */ |
| 71 | #define NFC_STATUS_BUFFER_FULL NCI_STATUS_BUFFER_FULL |
| 72 | /* failed */ |
| 73 | #define NFC_STATUS_FAILED NCI_STATUS_FAILED |
| 74 | /* not initialized */ |
| 75 | #define NFC_STATUS_NOT_INITIALIZED NCI_STATUS_NOT_INITIALIZED |
| 76 | /* Syntax error */ |
| 77 | #define NFC_STATUS_SYNTAX_ERROR NCI_STATUS_SYNTAX_ERROR |
| 78 | /* Semantic error */ |
| 79 | #define NFC_STATUS_SEMANTIC_ERROR NCI_STATUS_SEMANTIC_ERROR |
| 80 | /* Unknown NCI Group ID */ |
| 81 | #define NFC_STATUS_UNKNOWN_GID NCI_STATUS_UNKNOWN_GID |
| 82 | /* Unknown NCI Opcode */ |
| 83 | #define NFC_STATUS_UNKNOWN_OID NCI_STATUS_UNKNOWN_OID |
| 84 | /* Invalid Parameter */ |
| 85 | #define NFC_STATUS_INVALID_PARAM NCI_STATUS_INVALID_PARAM |
| 86 | /* Message size too big */ |
| 87 | #define NFC_STATUS_MSG_SIZE_TOO_BIG NCI_STATUS_MSG_SIZE_TOO_BIG |
| 88 | /* Already started */ |
| 89 | #define NFC_STATUS_ALREADY_STARTED NCI_STATUS_ALREADY_STARTED |
| 90 | /* Activation Failed */ |
| 91 | #define NFC_STATUS_ACTIVATION_FAILED NCI_STATUS_ACTIVATION_FAILED |
| 92 | /* Tear Down Error */ |
| 93 | #define NFC_STATUS_TEAR_DOWN NCI_STATUS_TEAR_DOWN |
| 94 | /* RF transmission error*/ |
| 95 | #define NFC_STATUS_RF_TRANSMISSION_ERR NCI_STATUS_RF_TRANSMISSION_ERR |
| 96 | /* RF protocol error */ |
| 97 | #define NFC_STATUS_RF_PROTOCOL_ERR NCI_STATUS_RF_PROTOCOL_ERR |
| 98 | /* RF Timeout */ |
| 99 | #define NFC_STATUS_TIMEOUT NCI_STATUS_TIMEOUT |
| 100 | /* EE Intf activate err */ |
| 101 | #define NFC_STATUS_EE_INTF_ACTIVE_FAIL NCI_STATUS_EE_INTF_ACTIVE_FAIL |
| 102 | /* EE transmission error*/ |
| 103 | #define NFC_STATUS_EE_TRANSMISSION_ERR NCI_STATUS_EE_TRANSMISSION_ERR |
| 104 | /* EE protocol error */ |
| 105 | #define NFC_STATUS_EE_PROTOCOL_ERR NCI_STATUS_EE_PROTOCOL_ERR |
| 106 | /* EE Timeout */ |
| 107 | #define NFC_STATUS_EE_TIMEOUT NCI_STATUS_EE_TIMEOUT |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 108 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 109 | /* 0xE0 ~0xFF are proprietary status codes */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 110 | /* Command started successfully */ |
| 111 | #define NFC_STATUS_CMD_STARTED 0xE3 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 112 | /* NFCC Timeout in responding to an NCI command */ |
| 113 | #define NFC_STATUS_HW_TIMEOUT 0xE4 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 114 | /* More (same) event to follow */ |
| 115 | #define NFC_STATUS_CONTINUE 0xE5 |
| 116 | /* API is called to perform illegal function */ |
| 117 | #define NFC_STATUS_REFUSED 0xE6 |
| 118 | /* Wrong format of R-APDU, CC file or NDEF file */ |
| 119 | #define NFC_STATUS_BAD_RESP 0xE7 |
| 120 | /* 7816 Status Word is not command complete(0x9000) */ |
| 121 | #define NFC_STATUS_CMD_NOT_CMPLTD 0xE8 |
| 122 | /* Out of GKI buffers */ |
| 123 | #define NFC_STATUS_NO_BUFFERS 0xE9 |
| 124 | /* Protocol mismatch between API and activated one */ |
| 125 | #define NFC_STATUS_WRONG_PROTOCOL 0xEA |
| 126 | /* Another Tag command is already in progress */ |
| 127 | #define NFC_STATUS_BUSY 0xEB |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 128 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 129 | /* Link Loss */ |
| 130 | #define NFC_STATUS_LINK_LOSS 0xFC |
| 131 | /* data len exceeds MIU */ |
| 132 | #define NFC_STATUS_BAD_LENGTH 0xFD |
| 133 | /* invalid handle */ |
| 134 | #define NFC_STATUS_BAD_HANDLE 0xFE |
| 135 | /* congested */ |
| 136 | #define NFC_STATUS_CONGESTED 0xFF |
| 137 | typedef uint8_t tNFC_STATUS; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 138 | |
nxpandroid | 25862ca | 2015-11-06 18:43:02 +0530 | [diff] [blame] | 139 | #if (NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 140 | #define NFC_NFCC_INIT_MAX_RETRY 2 |
| 141 | #define NFC_NORMAL_BOOT_MODE 0 |
| 142 | #define NFC_FAST_BOOT_MODE 1 |
| 143 | #define NFC_OSU_BOOT_MODE 2 |
| 144 | #define UICC1_HOST ((unsigned char)0x02) |
| 145 | #define UICC2_HOST ((unsigned char)0x81) |
| 146 | #define DH_HOST ((unsigned char)0x00) |
| 147 | #define ESE_HOST ((unsigned char)0xC0) |
| 148 | #define NXP_FEATURE_ENABLED \ |
| 149 | ((unsigned char)0x01) /* flag to indicate NXP feature is enabled*/ |
| 150 | #define NXP_FEATURE_DISABLED \ |
| 151 | ((unsigned char)0x00) /* flag to indicate NXP feature is enabled*/ |
nxpandroid | 47796b5 | 2017-04-07 15:40:53 +0530 | [diff] [blame] | 152 | #define NXP_NFC_PARAM_SWP_SESSIONID_INT2 ((unsigned char)0xEB) |
| 153 | #define NXP_NFC_PARAM_SWP_SESSION_ID_LEN 8 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 154 | #define NXP_NFC_PROP_MAX_CMD_BUF_SIZE ((unsigned char)0x40) |
| 155 | #define NXP_NFC_SET_MSB(x) (x |= 0x80) |
| 156 | #define NXP_NFC_RESET_MSB(x) (x &= 0x7F) |
nxpandroid | b708f58 | 2017-09-13 16:02:41 +0530 | [diff] [blame] | 157 | #define NXP_NFC_ESE_CONN_PIPE_STATUS ((unsigned char)0x22) |
| 158 | #define NXP_NFC_ESE_APDU_PIPE_STATUS ((unsigned char)0x23) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 159 | /********************************************** |
| 160 | * NFC Config Parameter IDs defined by NXP NFC |
| 161 | **********************************************/ |
| 162 | #define NXP_NFC_SET_CONFIG_PARAM_EXT \ |
| 163 | ((unsigned char)0xA0) /* NXP NFC set config extension ID*/ |
| 164 | #define NXP_NFC_PARAM_ID_SWP1 \ |
| 165 | ((unsigned char)0xEC) /* SWP1 parameter ID \ |
| 166 | UICC*/ |
| 167 | #define NXP_NFC_PARAM_ID_SWP2 \ |
| 168 | ((unsigned char)0xED) /* SWP1 parameter ID ESE \ |
| 169 | */ |
| 170 | #define NXP_NFC_PARAM_ID_SWP1A \ |
| 171 | ((unsigned char)0xD4) /* SWP1 parameter ID UICC2 */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 172 | |
| 173 | #define NXP_NFC_PARAM_ID_SWPUICC3 \ |
| 174 | ((unsigned char)0xDC) /* SWP1 parameter ID UICC3 */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 175 | #define NXP_NFC_PARAM_ID_NDEF_NFCEE \ |
| 176 | ((unsigned char)0x95) /* SWP1 parameter ID NDEF NFCEE */ |
| 177 | #define NXP_NFC_PARAM_ID_RF_PARAM_UICC \ |
| 178 | ((unsigned char)0xEF) /* UICC CE RF parameter */ |
| 179 | #define NXP_NFC_PARAM_ID_RF_PARAM_ESE \ |
| 180 | ((unsigned char)0xF0) /* ESE RF parameter */ |
| 181 | #define NXP_NFC_PARAM_ID_NFCC_RF_CONFIG \ |
| 182 | ((unsigned char)0x9B) /* NFCC RF config parameter*/ |
| 183 | #define NXP_NFC_EMVCO_PCD_COLLISION_DETECTED \ |
| 184 | ((unsigned char)0xE4) /* Core generic error for EMVCO collision detected */ |
| 185 | #define NXP_NFC_PARAM_ID_RF_PARAM_UICC2 \ |
| 186 | ((unsigned char)0xE8) /* UICC2 CE RF parameter */ |
| 187 | #define NXP_NFC_PARAM_SWP_SESSIONID_INT2 \ |
| 188 | ((unsigned char)0xEB) /* param for retrieveing HCI session ID for ESE */ |
| 189 | #define NXP_NFC_PARAM_SWP_SESSIONID_INT1 \ |
| 190 | ((unsigned char)0xEA) /* param for retrieveing HCI session ID for UICC */ |
| 191 | #define NXP_NFC_PARAM_SWP_SESSIONID_INT1A \ |
| 192 | ((unsigned char)0x1E) /* param for retrieveing HCI session ID for UICC2 */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 193 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 194 | /********************************************** |
| 195 | * NFC Config Parameter IDs defined by NCI |
| 196 | **********************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 197 | #define NFC_PMID_TOTAL_DURATION NCI_PARAM_ID_TOTAL_DURATION |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 198 | #define NFC_PMID_PF_RC NCI_PARAM_ID_PF_RC |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 199 | #define NFC_PMID_ATR_REQ_GEN_BYTES NCI_PARAM_ID_ATR_REQ_GEN_BYTES |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 200 | #define NFC_PMID_LA_HIST_BY NCI_PARAM_ID_LA_HIST_BY |
| 201 | #define NFC_PMID_LA_NFCID1 NCI_PARAM_ID_LA_NFCID1 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 202 | #define NFC_PMID_LA_BIT_FRAME_SDD NCI_PARAM_ID_LA_BIT_FRAME_SDD |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 203 | #define NFC_PMID_LA_PLATFORM_CONFIG NCI_PARAM_ID_LA_PLATFORM_CONFIG |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 204 | #define NFC_PMID_LA_SEL_INFO NCI_PARAM_ID_LA_SEL_INFO |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 205 | #define NFC_PMID_LB_SENSB_INFO NCI_PARAM_ID_LB_SENSB_INFO |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 206 | #define NFC_PMID_LB_H_INFO NCI_PARAM_ID_LB_H_INFO_RSP |
| 207 | #define NFC_PMID_LB_NFCID0 NCI_PARAM_ID_LB_NFCID0 |
| 208 | #define NFC_PMID_LB_APPDATA NCI_PARAM_ID_LB_APPDATA |
| 209 | #define NFC_PMID_LB_SFGI NCI_PARAM_ID_LB_SFGI |
| 210 | #define NFC_PMID_LB_ADC_FO NCI_PARAM_ID_LB_ADC_FO |
| 211 | #define NFC_PMID_LF_T3T_ID1 NCI_PARAM_ID_LF_T3T_ID1 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 212 | #define NFC_PMID_LF_PROTOCOL NCI_PARAM_ID_LF_PROTOCOL |
| 213 | #define NFC_PMID_LF_T3T_PMM NCI_PARAM_ID_LF_T3T_PMM |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 214 | #define NFC_PMID_LF_T3T_FLAGS2 NCI_PARAM_ID_LF_T3T_FLAGS2 |
| 215 | #define NFC_PMID_FWI NCI_PARAM_ID_FWI |
| 216 | #define NFC_PMID_LF_CON_BITR_F NCI_PARAM_ID_LF_CON_BITR_F |
| 217 | #define NFC_PMID_WT NCI_PARAM_ID_WT |
| 218 | #define NFC_PMID_ATR_RES_GEN_BYTES NCI_PARAM_ID_ATR_RES_GEN_BYTES |
| 219 | #define NFC_PMID_ATR_RSP_CONFIG NCI_PARAM_ID_ATR_RSP_CONFIG |
| 220 | #define NFC_PMID_RF_FIELD_INFO NCI_PARAM_ID_RF_FIELD_INFO |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 221 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 222 | /* Technology based routing */ |
| 223 | #define NFC_ROUTE_TAG_TECH NCI_ROUTE_TAG_TECH |
| 224 | /* Protocol based routing */ |
| 225 | #define NFC_ROUTE_TAG_PROTO NCI_ROUTE_TAG_PROTO |
| 226 | #define NFC_ROUTE_TAG_AID NCI_ROUTE_TAG_AID /* AID routing */ |
Suraj Uday Kotharkar | 6f7757b | 2018-05-10 15:58:29 +0530 | [diff] [blame] | 227 | #define NFC_ROUTE_TAG_SYSCODE NCI_ROUTE_TAG_SYSCODE /* System Code routing*/ |
Suraj Uday Kotharkar | 11ae20f | 2018-07-20 23:29:36 +0530 | [diff] [blame] | 228 | #if (NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 229 | /* tag, len, 2 byte value for technology/protocol based routing */ |
Suraj Uday Kotharkar | 11ae20f | 2018-07-20 23:29:36 +0530 | [diff] [blame] | 230 | #define NFC_ROUTE_TAG_APDU NCI_ROUTE_TAG_APDU /* APDU routing*/ |
| 231 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 232 | /* For routing */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 233 | #define NFC_DH_ID NCI_DH_ID /* for DH */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 234 | /* To identify the loopback test */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 235 | /* use a proprietary range */ |
| 236 | #define NFC_TEST_ID NCI_TEST_ID |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 237 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 238 | #define NFC_TL_SIZE 2 |
| 239 | #define NFC_SAVED_CMD_SIZE 2 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 240 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 241 | typedef tNCI_DISCOVER_MAPS tNFC_DISCOVER_MAPS; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 242 | typedef tNCI_DISCOVER_PARAMS tNFC_DISCOVER_PARAMS; |
| 243 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 244 | /* all NFC Manager Callback functions have prototype like void (cback) (uint8_t |
| 245 | * event, void *p_data) |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 246 | * tNFC_DATA_CBACK uses connection id as the first parameter; range 0x00-0x0F. |
| 247 | * tNFC_DISCOVER_CBACK uses tNFC_DISCOVER_EVT; range 0x4000 ~ |
| 248 | * tNFC_RESPONSE_CBACK uses tNFC_RESPONSE_EVT; range 0x5000 ~ |
| 249 | */ |
| 250 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 251 | #define NFC_FIRST_DEVT 0x4000 |
| 252 | #define NFC_FIRST_REVT 0x5000 |
| 253 | #define NFC_FIRST_CEVT 0x6000 |
| 254 | #define NFC_FIRST_TEVT 0x8000 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 255 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 256 | /* the events reported on tNFC_RESPONSE_CBACK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 257 | enum { |
| 258 | NFC_ENABLE_REVT = NFC_FIRST_REVT, /* 0 Enable event */ |
| 259 | NFC_DISABLE_REVT, /* 1 Disable event */ |
| 260 | NFC_SET_CONFIG_REVT, /* 2 Set Config Response */ |
| 261 | NFC_GET_CONFIG_REVT, /* 3 Get Config Response */ |
| 262 | NFC_NFCEE_DISCOVER_REVT, /* 4 Discover NFCEE response */ |
| 263 | NFC_NFCEE_INFO_REVT, /* 5 Discover NFCEE Notification */ |
| 264 | NFC_NFCEE_MODE_SET_REVT, /* 6 NFCEE Mode Set response */ |
| 265 | NFC_RF_FIELD_REVT, /* 7 RF Field information */ |
| 266 | NFC_EE_ACTION_REVT, /* 8 EE Action notification */ |
| 267 | NFC_EE_DISCOVER_REQ_REVT, /* 9 EE Discover Req notification */ |
| 268 | NFC_SET_ROUTING_REVT, /* 10 Configure Routing response */ |
| 269 | NFC_GET_ROUTING_REVT, /* 11 Retrieve Routing response */ |
| 270 | NFC_RF_COMM_PARAMS_UPDATE_REVT, /* 12 RF Communication Param Update */ |
| 271 | NFC_GEN_ERROR_REVT, /* 13 generic error notification */ |
| 272 | NFC_NFCC_RESTART_REVT, /* 14 NFCC has been re-initialized */ |
| 273 | NFC_NFCC_TIMEOUT_REVT, /* 15 NFCC is not responding */ |
| 274 | NFC_NFCC_TRANSPORT_ERR_REVT, /* 16 NCI Tranport error */ |
| 275 | NFC_NFCC_POWER_OFF_REVT, /* 17 NFCC turned off */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 276 | NFC_SET_POWER_SUB_STATE_REVT, /* 18 Set power sub state response */ |
| 277 | NFC_NFCEE_PL_CONTROL_REVT, /* NFCEE Power/Link Ctrl response*/ |
| 278 | NFC_NFCEE_STATUS_REVT /* NFCEE Status Notification */ |
| 279 | /* First vendor-specific rsp event */ |
nxpandroid | 65a0260 | 2017-01-13 19:13:19 +0530 | [diff] [blame] | 280 | #if (NXP_EXTNS == TRUE) |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 281 | ,NFC_NFCEE_MODE_SET_INFO /* NFCEE Mode Set Notification event*/ |
nxpandroid | 65a0260 | 2017-01-13 19:13:19 +0530 | [diff] [blame] | 282 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 283 | }; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 284 | typedef uint16_t tNFC_RESPONSE_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 285 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 286 | enum { |
| 287 | NFC_CONN_CREATE_CEVT = NFC_FIRST_CEVT, /* 0 Conn Create Response */ |
| 288 | NFC_CONN_CLOSE_CEVT, /* 1 Conn Close Response */ |
| 289 | NFC_DEACTIVATE_CEVT, /* 2 Deactivate response/notificatn*/ |
| 290 | NFC_DATA_CEVT, /* 3 Data */ |
| 291 | NFC_ERROR_CEVT, /* 4 generic or interface error */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 292 | NFC_DATA_START_CEVT /* 5 received the first fragment on RF link */ |
nxpandroid | 25862ca | 2015-11-06 18:43:02 +0530 | [diff] [blame] | 293 | #if (NXP_EXTNS == TRUE) |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 294 | ,NFC_RF_WTX_CEVT, /* 6 received rf wtx */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 295 | NFC_RF_TRANSMISSION_ERROR, /* 7 CE Error events */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 296 | NFC_HCI_RESTART_TIMER |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 297 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 298 | }; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 299 | typedef uint16_t tNFC_CONN_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 300 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 301 | #define NFC_NFCC_INFO_LEN 4 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 302 | #ifndef NFC_NFCC_MAX_NUM_VS_INTERFACE |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 303 | #define NFC_NFCC_MAX_NUM_VS_INTERFACE 5 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 304 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 305 | typedef struct { |
| 306 | tNFC_STATUS status; /* The event status. */ |
| 307 | uint8_t nci_version; /* the NCI version of NFCC */ |
| 308 | uint8_t max_conn; /* max number of connections by NFCC*/ |
| 309 | uint32_t nci_features; /* the NCI features of NFCC */ |
| 310 | uint16_t nci_interfaces; /* the NCI interfaces of NFCC */ |
| 311 | uint16_t max_ce_table; /* the max routing table size */ |
| 312 | uint16_t max_param_size; /* Max Size for Large Parameters */ |
| 313 | uint8_t manufacture_id; /* the Manufacture ID for NFCC */ |
| 314 | uint8_t nfcc_info[NFC_NFCC_INFO_LEN]; /* the Manufacture Info for NFCC */ |
| 315 | uint8_t vs_interface |
| 316 | [NFC_NFCC_MAX_NUM_VS_INTERFACE]; /* the NCI VS interfaces of NFCC */ |
| 317 | uint8_t hci_packet_size; /*HCI payload size*/ |
| 318 | uint8_t hci_conn_credits; /*max number of HCI credits*/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 319 | uint16_t max_nfc_v_size; /* maximum frame size for NFC-V*/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 320 | } tNFC_ENABLE_REVT; |
| 321 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 322 | #define NFC_MAX_NUM_IDS 125 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 323 | /* the data type associated with NFC_SET_CONFIG_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 324 | typedef struct { |
| 325 | tNFC_STATUS status; /* The event status. */ |
| 326 | uint8_t num_param_id; /* Number of rejected NCI Param ID */ |
| 327 | uint8_t param_ids[NFC_MAX_NUM_IDS]; /* NCI Param ID */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 328 | } tNFC_SET_CONFIG_REVT; |
| 329 | |
| 330 | /* the data type associated with NFC_GET_CONFIG_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 331 | typedef struct { |
| 332 | tNFC_STATUS status; /* The event status. */ |
| 333 | uint16_t tlv_size; /* The length of TLV */ |
| 334 | uint8_t* p_param_tlvs; /* TLV */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 335 | } tNFC_GET_CONFIG_REVT; |
| 336 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 337 | #if (NXP_EXTNS == TRUE) |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 338 | typedef struct { |
| 339 | tNFC_STATUS status; |
| 340 | uint8_t nfcee_id; |
| 341 | } tNFC_NFCEE_MODE_SET_INFO; |
| 342 | |
| 343 | typedef struct { |
| 344 | tNFC_STATUS status; /* The event status.*/ |
| 345 | uint8_t nfcee_id; /* NFCEE ID */ |
| 346 | } tNFC_NFCEE_EE_PWR_LNK_REVT; |
| 347 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 348 | /* This data type is for FW Version */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 349 | typedef struct { |
| 350 | uint8_t rom_code_version; /* ROM code Version */ |
| 351 | uint8_t major_version; /* Major Version */ |
| 352 | uint8_t minor_version; /* Minor Version */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 353 | } tNFC_FW_VERSION; |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 354 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 355 | |
| 356 | /* the data type associated with NFC_NFCEE_DISCOVER_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 357 | typedef struct { |
| 358 | tNFC_STATUS status; /* The event status. */ |
| 359 | uint8_t num_nfcee; /* The number of NFCEE */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 360 | } tNFC_NFCEE_DISCOVER_REVT; |
| 361 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 362 | #define NFC_NFCEE_INTERFACE_APDU NCI_NFCEE_INTERFACE_APDU |
| 363 | #define NFC_NFCEE_INTERFACE_HCI_ACCESS NCI_NFCEE_INTERFACE_HCI_ACCESS |
| 364 | #define NFC_NFCEE_INTERFACE_T3T NCI_NFCEE_INTERFACE_T3T |
| 365 | #define NFC_NFCEE_INTERFACE_TRANSPARENT NCI_NFCEE_INTERFACE_TRANSPARENT |
| 366 | #define NFC_NFCEE_INTERFACE_PROPRIETARY NCI_NFCEE_INTERFACE_PROPRIETARY |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 367 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 368 | #define NFC_NFCEE_TAG_HW_ID NCI_NFCEE_TAG_HW_ID |
| 369 | #define NFC_NFCEE_TAG_ATR_BYTES NCI_NFCEE_TAG_ATR_BYTES |
| 370 | #define NFC_NFCEE_TAG_T3T_INFO NCI_NFCEE_TAG_T3T_INFO |
| 371 | #define NFC_NFCEE_TAG_HCI_HOST_ID NCI_NFCEE_TAG_HCI_HOST_ID |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 372 | typedef uint8_t tNFC_NFCEE_TAG; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 373 | /* additional NFCEE Info */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 374 | typedef struct { |
| 375 | tNFC_NFCEE_TAG tag; |
| 376 | uint8_t len; |
| 377 | uint8_t info[NFC_MAX_EE_INFO]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 378 | } tNFC_NFCEE_TLV; |
| 379 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 380 | #if (NXP_EXTNS == TRUE) |
nxpandroid | e5fc6c9 | 2017-09-13 13:17:46 +0530 | [diff] [blame] | 381 | #define NFC_NFCEE_STS_UNRECOVERABLE_ERROR NCI_NFCEE_STS_UNRECOVERABLE_ERROR |
| 382 | #define NFC_NFCEE_STS_INIT_STARTED NCI_NFCEE_STS_INIT_STARTED |
| 383 | #define NFC_NFCEE_STS_INIT_COMPLETED NCI_NFCEE_STS_INIT_COMPLETED |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 384 | #endif |
nxpandroid | e5fc6c9 | 2017-09-13 13:17:46 +0530 | [diff] [blame] | 385 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 386 | /* NFCEE connected and inactive */ |
| 387 | #define NFC_NFCEE_STATUS_INACTIVE NCI_NFCEE_STS_CONN_INACTIVE |
| 388 | /* NFCEE connected and active */ |
| 389 | #define NFC_NFCEE_STATUS_ACTIVE NCI_NFCEE_STS_CONN_ACTIVE |
| 390 | /* NFCEE removed */ |
| 391 | #define NFC_NFCEE_STATUS_REMOVED NCI_NFCEE_STS_REMOVED |
nxpandroid | e5fc6c9 | 2017-09-13 13:17:46 +0530 | [diff] [blame] | 392 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 393 | /* the data type associated with NFC_NFCEE_INFO_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 394 | typedef struct { |
| 395 | tNFC_STATUS status; /* The event status - place holder */ |
| 396 | uint8_t nfcee_id; /* NFCEE ID */ |
| 397 | uint8_t ee_status; /* The NFCEE status. */ |
| 398 | uint8_t num_interface; /* number of NFCEE interfaces */ |
| 399 | uint8_t ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE interface */ |
| 400 | uint8_t num_tlvs; /* number of TLVs */ |
| 401 | tNFC_NFCEE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* The TLVs associated with NFCEE */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 402 | bool nfcee_power_ctrl; /* 1, if NFCC has control of NFCEE Power Supply */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 403 | } tNFC_NFCEE_INFO_REVT; |
| 404 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 405 | #define NFC_MODE_ACTIVATE NCI_NFCEE_MD_ACTIVATE |
| 406 | #define NFC_MODE_DEACTIVATE NCI_NFCEE_MD_DEACTIVATE |
| 407 | typedef uint8_t tNFC_NFCEE_MODE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 408 | /* the data type associated with NFC_NFCEE_MODE_SET_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 409 | typedef struct { |
| 410 | tNFC_STATUS status; /* The event status.*/ |
| 411 | uint8_t nfcee_id; /* NFCEE ID */ |
| 412 | tNFC_NFCEE_MODE mode; /* NFCEE mode */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 413 | } tNFC_NFCEE_MODE_SET_REVT; |
| 414 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 415 | #if (APPL_DTA_MODE == TRUE) |
| 416 | /* This data type is for FW Version */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 417 | typedef struct { |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 418 | uint8_t rom_code_version; /* ROM code Version */ |
| 419 | uint8_t major_version; /* Major Version */ |
| 420 | uint8_t minor_version; /* Minor Version */ |
| 421 | } tNFC_FW_VERSION; |
| 422 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 423 | #define NFC_MAX_AID_LEN NCI_MAX_AID_LEN /* 16 */ |
Suraj Uday Kotharkar | 11ae20f | 2018-07-20 23:29:36 +0530 | [diff] [blame] | 424 | #if (NXP_EXTNS == TRUE) |
| 425 | #define NFC_MIN_APDU_DATA_LEN NCI_MIN_APDU_DATA_LEN |
| 426 | #define NFC_MIN_APDU_MASK_LEN NCI_MIN_APDU_MASK_LEN |
| 427 | #define NFC_MAX_APDU_DATA_LEN NCI_MAX_APDU_DATA_LEN |
| 428 | #define NFC_MAX_APDU_MASK_LEN NCI_MAX_APDU_MASK_LEN |
| 429 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 430 | /* the data type associated with NFC_CE_GET_ROUTING_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 431 | typedef struct { |
| 432 | tNFC_STATUS status; /* The event status */ |
| 433 | uint8_t nfcee_id; /* NFCEE ID */ |
| 434 | uint8_t num_tlvs; /* number of TLVs */ |
| 435 | uint8_t tlv_size; /* the total len of all TLVs */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 436 | uint8_t param_tlvs[NFC_MAX_EE_TLV_SIZE]; /* the TLVs */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 437 | } tNFC_GET_ROUTING_REVT; |
| 438 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 439 | /* the data type associated with NFC_CONN_CREATE_CEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 440 | typedef struct { |
| 441 | tNFC_STATUS status; /* The event status */ |
| 442 | uint8_t dest_type; /* the destination type */ |
| 443 | uint8_t id; /* NFCEE ID or RF Discovery ID */ |
| 444 | uint8_t buff_size; /* The max buffer size */ |
| 445 | uint8_t num_buffs; /* The number of buffers */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 446 | } tNFC_CONN_CREATE_CEVT; |
| 447 | |
| 448 | /* the data type associated with NFC_CONN_CLOSE_CEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 449 | typedef struct { |
| 450 | tNFC_STATUS status; /* The event status */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 451 | } tNFC_CONN_CLOSE_CEVT; |
| 452 | |
| 453 | /* the data type associated with NFC_DATA_CEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 454 | typedef struct { |
| 455 | tNFC_STATUS status; /* The event status */ |
| 456 | NFC_HDR* p_data; /* The received Data */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 457 | } tNFC_DATA_CEVT; |
| 458 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 459 | /* the data type associated with NFC_NFCEE_PL_CONTROL_REVT */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 460 | typedef struct { |
| 461 | tNFC_STATUS status; /* The event status */ |
| 462 | uint8_t nfcee_id; /* NFCEE ID */ |
| 463 | tNCI_NFCEE_PL_CONFIG pl_control; /* Power/Link Control command */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 464 | } tNFC_NFCEE_PL_CONTROL_REVT; |
| 465 | |
| 466 | /* the data type associated with NFC_NFCEE_STATUS_REVT */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 467 | typedef struct { |
| 468 | tNFC_STATUS status; /* The event status */ |
| 469 | uint8_t nfcee_id; /* NFCEE ID */ |
| 470 | tNCI_EE_NTF_STATUS nfcee_status; /* NFCEE status */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 471 | } tNFC_NFCEE_STATUS_REVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 472 | /* RF Field Status */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 473 | typedef uint8_t tNFC_RF_STS; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 474 | |
| 475 | /* RF Field Technologies */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 476 | #define NFC_RF_TECHNOLOGY_A NCI_RF_TECHNOLOGY_A |
| 477 | #define NFC_RF_TECHNOLOGY_B NCI_RF_TECHNOLOGY_B |
| 478 | #define NFC_RF_TECHNOLOGY_F NCI_RF_TECHNOLOGY_F |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 479 | typedef uint8_t tNFC_RF_TECH; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 480 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 481 | extern uint8_t NFC_GetNCIVersion(); |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 482 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 483 | /* Supported Protocols */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 484 | #define NFC_PROTOCOL_UNKNOWN NCI_PROTOCOL_UNKNOWN /* Unknown */ |
| 485 | /* Type1Tag - NFC-A */ |
| 486 | #define NFC_PROTOCOL_T1T NCI_PROTOCOL_T1T |
| 487 | /* Type2Tag - NFC-A */ |
| 488 | #define NFC_PROTOCOL_T2T NCI_PROTOCOL_T2T |
| 489 | /* Type3Tag - NFC-F */ |
| 490 | #define NFC_PROTOCOL_T3T NCI_PROTOCOL_T3T |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 491 | /* Type5Tag - NFC-V/ISO15693*/ |
| 492 | #define NFC_PROTOCOL_T5T NFC_PROTOCOL_T5T_(NFC_GetNCIVersion()) |
| 493 | #define NFC_PROTOCOL_T5T_(x) \ |
| 494 | (((x) == NCI_VERSION_2_0) ? NCI_PROTOCOL_T5T : NCI_PROTOCOL_15693) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 495 | /* Type 4A,4B - NFC-A or NFC-B */ |
| 496 | #define NFC_PROTOCOL_ISO_DEP NCI_PROTOCOL_ISO_DEP |
| 497 | /* NFCDEP/LLCP - NFC-A or NFC-F */ |
| 498 | #define NFC_PROTOCOL_NFC_DEP NCI_PROTOCOL_NFC_DEP |
| 499 | #define NFC_PROTOCOL_MIFARE NCI_PROTOCOL_MIFARE |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 500 | #define NFC_PROTOCOL_ISO15693 NCI_PROTOCOL_15693 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 501 | #define NFC_PROTOCOL_B_PRIME NCI_PROTOCOL_B_PRIME |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 502 | #define NFC_PROTOCOL_KOVIO NCI_PROTOCOL_KOVIO |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 503 | |
| 504 | #if (NXP_EXTNS == TRUE) |
| 505 | #define NFC_PROTOCOL_ISO7816 NCI_PROTOCOL_ISO7816 |
| 506 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 507 | typedef uint8_t tNFC_PROTOCOL; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 508 | |
| 509 | /* Discovery Types/Detected Technology and Mode */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 510 | #define NFC_DISCOVERY_TYPE_POLL_A NCI_DISCOVERY_TYPE_POLL_A |
| 511 | #define NFC_DISCOVERY_TYPE_POLL_B NCI_DISCOVERY_TYPE_POLL_B |
| 512 | #define NFC_DISCOVERY_TYPE_POLL_F NCI_DISCOVERY_TYPE_POLL_F |
| 513 | #define NFC_DISCOVERY_TYPE_POLL_A_ACTIVE NCI_DISCOVERY_TYPE_POLL_A_ACTIVE |
| 514 | #define NFC_DISCOVERY_TYPE_POLL_F_ACTIVE NCI_DISCOVERY_TYPE_POLL_F_ACTIVE |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 515 | #define NFC_DISCOVERY_TYPE_POLL_ACTIVE NCI_DISCOVERY_TYPE_POLL_ACTIVE |
| 516 | #define NFC_DISCOVERY_TYPE_POLL_V NCI_DISCOVERY_TYPE_POLL_V |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 517 | #define NFC_DISCOVERY_TYPE_POLL_B_PRIME NCI_DISCOVERY_TYPE_POLL_B_PRIME |
| 518 | #define NFC_DISCOVERY_TYPE_POLL_KOVIO NCI_DISCOVERY_TYPE_POLL_KOVIO |
| 519 | #define NFC_DISCOVERY_TYPE_LISTEN_A NCI_DISCOVERY_TYPE_LISTEN_A |
| 520 | #define NFC_DISCOVERY_TYPE_LISTEN_B NCI_DISCOVERY_TYPE_LISTEN_B |
| 521 | #define NFC_DISCOVERY_TYPE_LISTEN_F NCI_DISCOVERY_TYPE_LISTEN_F |
| 522 | #define NFC_DISCOVERY_TYPE_LISTEN_A_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE |
| 523 | #define NFC_DISCOVERY_TYPE_LISTEN_F_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 524 | #define NFC_DISCOVERY_TYPE_LISTEN_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_ACTIVE |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 525 | #define NFC_DISCOVERY_TYPE_LISTEN_ISO15693 NCI_DISCOVERY_TYPE_LISTEN_ISO15693 |
| 526 | #define NFC_DISCOVERY_TYPE_LISTEN_B_PRIME NCI_DISCOVERY_TYPE_LISTEN_B_PRIME |
| 527 | typedef uint8_t tNFC_DISCOVERY_TYPE; |
| 528 | typedef uint8_t tNFC_RF_TECH_N_MODE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 529 | |
| 530 | /* Select Response codes */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 531 | #define NFC_SEL_RES_NFC_FORUM_T2T 0x00 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 532 | |
| 533 | /* Bit Rates */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 534 | #define NFC_BIT_RATE_212 NCI_BIT_RATE_212 /* 212 kbit/s */ |
| 535 | #define NFC_BIT_RATE_424 NCI_BIT_RATE_424 /* 424 kbit/s */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 536 | typedef uint8_t tNFC_BIT_RATE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 537 | |
| 538 | /********************************************** |
| 539 | * Interface Types |
| 540 | **********************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 541 | #define NFC_INTERFACE_EE_DIRECT_RF NCI_INTERFACE_EE_DIRECT_RF |
| 542 | #define NFC_INTERFACE_FRAME NCI_INTERFACE_FRAME |
| 543 | #define NFC_INTERFACE_ISO_DEP NCI_INTERFACE_ISO_DEP |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 544 | #define NFC_INTERFACE_NFC_DEP NCI_INTERFACE_NFC_DEP |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 545 | #define NFC_INTERFACE_MIFARE NCI_INTERFACE_VS_MIFARE |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 546 | typedef tNCI_INTF_TYPE tNFC_INTF_TYPE; |
| 547 | |
| 548 | /********************************************** |
| 549 | * Deactivation Type |
| 550 | **********************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 551 | #define NFC_DEACTIVATE_TYPE_IDLE NCI_DEACTIVATE_TYPE_IDLE |
| 552 | #define NFC_DEACTIVATE_TYPE_SLEEP NCI_DEACTIVATE_TYPE_SLEEP |
| 553 | #define NFC_DEACTIVATE_TYPE_SLEEP_AF NCI_DEACTIVATE_TYPE_SLEEP_AF |
| 554 | #define NFC_DEACTIVATE_TYPE_DISCOVERY NCI_DEACTIVATE_TYPE_DISCOVERY |
| 555 | typedef uint8_t tNFC_DEACT_TYPE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 556 | |
| 557 | /********************************************** |
| 558 | * Deactivation Reasons |
| 559 | **********************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 560 | #define NFC_DEACTIVATE_REASON_DH_REQ_FAILED NCI_DEACTIVATE_REASON_DH_REQ_FAILED |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 561 | typedef uint8_t tNFC_DEACT_REASON; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 562 | |
| 563 | /* the data type associated with NFC_RF_FIELD_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 564 | typedef struct { |
| 565 | tNFC_STATUS status; /* The event status - place holder. */ |
| 566 | tNFC_RF_STS rf_field; /* RF Field Status */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 567 | } tNFC_RF_FIELD_REVT; |
| 568 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 569 | #define NFC_MAX_APP_DATA_LEN 40 |
| 570 | typedef struct { |
| 571 | uint8_t len_aid; /* length of application id */ |
| 572 | uint8_t aid[NFC_MAX_AID_LEN]; /* application id */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 573 | } tNFC_AID; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 574 | typedef struct { |
| 575 | uint8_t len_aid; /* length of application id */ |
| 576 | uint8_t aid[NFC_MAX_AID_LEN]; /* application id */ |
| 577 | uint8_t len_data; /* len of application data */ |
| 578 | uint8_t data[NFC_MAX_APP_DATA_LEN]; /* application data */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 579 | } tNFC_APP_INIT; |
| 580 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 581 | /* ISO 7816-4 SELECT command */ |
| 582 | #define NFC_EE_TRIG_SELECT NCI_EE_TRIG_7816_SELECT |
| 583 | /* RF Protocol changed */ |
| 584 | #define NFC_EE_TRIG_RF_PROTOCOL NCI_EE_TRIG_RF_PROTOCOL |
| 585 | /* RF Technology changed */ |
| 586 | #define NFC_EE_TRIG_RF_TECHNOLOGY NCI_EE_TRIG_RF_TECHNOLOGY |
| 587 | /* Application initiation */ |
| 588 | #define NFC_EE_TRIG_APP_INIT NCI_EE_TRIG_APP_INIT |
| 589 | typedef uint8_t tNFC_EE_TRIGGER; |
| 590 | typedef struct { |
| 591 | tNFC_EE_TRIGGER trigger; /* the trigger of this event */ |
| 592 | union { |
| 593 | tNFC_PROTOCOL protocol; |
| 594 | tNFC_RF_TECH technology; |
| 595 | tNFC_AID aid; |
| 596 | tNFC_APP_INIT app_init; |
| 597 | } param; /* Discovery Type specific parameters */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 598 | } tNFC_ACTION_DATA; |
| 599 | |
| 600 | /* the data type associated with NFC_EE_ACTION_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 601 | typedef struct { |
| 602 | tNFC_STATUS status; /* The event status - place holder */ |
| 603 | uint8_t nfcee_id; /* NFCEE ID */ |
| 604 | tNFC_ACTION_DATA act_data; /* data associated /w the action */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 605 | } tNFC_EE_ACTION_REVT; |
| 606 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 607 | #define NFC_EE_DISC_OP_ADD 0 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 608 | typedef uint8_t tNFC_EE_DISC_OP; |
| 609 | typedef struct { |
| 610 | tNFC_EE_DISC_OP op; /* add or remove this entry */ |
| 611 | uint8_t nfcee_id; /* NFCEE ID */ |
| 612 | tNFC_RF_TECH_N_MODE tech_n_mode; /* Discovery Technology and Mode */ |
| 613 | tNFC_PROTOCOL protocol; /* NFC protocol */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 614 | } tNFC_EE_DISCOVER_INFO; |
| 615 | |
| 616 | #ifndef NFC_MAX_EE_DISC_ENTRIES |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 617 | #define NFC_MAX_EE_DISC_ENTRIES 6 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 618 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 619 | /* T, L, V(NFCEE ID, TechnMode, Protocol) */ |
| 620 | #define NFC_EE_DISCOVER_ENTRY_LEN 5 |
| 621 | #define NFC_EE_DISCOVER_INFO_LEN 3 /* NFCEE ID, TechnMode, Protocol */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 622 | /* the data type associated with NFC_EE_DISCOVER_REQ_REVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 623 | typedef struct { |
| 624 | tNFC_STATUS status; /* The event status - place holder */ |
| 625 | uint8_t num_info; /* number of entries in info[] */ |
| 626 | tNFC_EE_DISCOVER_INFO |
| 627 | info[NFC_MAX_EE_DISC_ENTRIES]; /* discovery request from NFCEE */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 628 | } tNFC_EE_DISCOVER_REQ_REVT; |
| 629 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 630 | typedef union { |
| 631 | tNFC_STATUS status; /* The event status. */ |
| 632 | tNFC_ENABLE_REVT enable; |
| 633 | tNFC_SET_CONFIG_REVT set_config; |
| 634 | tNFC_GET_CONFIG_REVT get_config; |
| 635 | tNFC_NFCEE_DISCOVER_REVT nfcee_discover; |
| 636 | tNFC_NFCEE_INFO_REVT nfcee_info; |
| 637 | tNFC_NFCEE_MODE_SET_REVT mode_set; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 638 | tNFC_NFCEE_PL_CONTROL_REVT pl_control; |
| 639 | tNFC_NFCEE_STATUS_REVT nfcee_status; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 640 | tNFC_RF_FIELD_REVT rf_field; |
| 641 | tNFC_STATUS cfg_routing; |
| 642 | tNFC_GET_ROUTING_REVT get_routing; |
| 643 | tNFC_EE_ACTION_REVT ee_action; |
| 644 | tNFC_EE_DISCOVER_REQ_REVT ee_discover_req; |
| 645 | void* p_vs_evt_data; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 646 | } tNFC_RESPONSE; |
| 647 | |
| 648 | /************************************* |
| 649 | ** RESPONSE Callback Functions |
| 650 | **************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 651 | typedef void(tNFC_RESPONSE_CBACK)(tNFC_RESPONSE_EVT event, |
| 652 | tNFC_RESPONSE* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 653 | |
| 654 | /* The events reported on tNFC_VS_CBACK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 655 | /* The event is (NCI_RSP_BIT|oid) for response and (NCI_NTF_BIT|oid) for |
| 656 | * notification*/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 657 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 658 | typedef uint8_t tNFC_VS_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 659 | |
| 660 | /************************************* |
| 661 | ** Proprietary (Vendor Specific) Callback Functions |
| 662 | **************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 663 | typedef void(tNFC_VS_CBACK)(tNFC_VS_EVT event, uint16_t data_len, |
| 664 | uint8_t* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 665 | |
| 666 | /* the events reported on tNFC_DISCOVER_CBACK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 667 | enum { |
| 668 | NFC_START_DEVT = NFC_FIRST_DEVT, /* Status of NFC_DiscoveryStart */ |
| 669 | NFC_MAP_DEVT, /* Status of NFC_DiscoveryMap */ |
| 670 | NFC_RESULT_DEVT, /* The responses from remote device */ |
| 671 | NFC_SELECT_DEVT, /* Status of NFC_DiscoverySelect */ |
| 672 | NFC_ACTIVATE_DEVT, /* RF interface is activated */ |
| 673 | NFC_DEACTIVATE_DEVT /* Status of RF deactivation */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 674 | }; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 675 | typedef uint16_t tNFC_DISCOVER_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 676 | |
| 677 | /* the data type associated with NFC_START_DEVT */ |
| 678 | typedef tNFC_STATUS tNFC_START_DEVT; |
| 679 | |
| 680 | typedef tNCI_RF_PA_PARAMS tNFC_RF_PA_PARAMS; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 681 | #define NFC_MAX_SENSB_RES_LEN NCI_MAX_SENSB_RES_LEN |
| 682 | #define NFC_NFCID0_MAX_LEN 4 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 683 | typedef struct { |
| 684 | uint8_t sensb_res_len; /* Length of SENSB_RES Response (Byte 2 - Byte 12 or |
| 685 | 13) Available after Technology Detection */ |
| 686 | uint8_t sensb_res[NFC_MAX_SENSB_RES_LEN]; /* SENSB_RES Response (ATQ) */ |
| 687 | uint8_t nfcid0[NFC_NFCID0_MAX_LEN]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 688 | } tNFC_RF_PB_PARAMS; |
| 689 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 690 | #define NFC_MAX_SENSF_RES_LEN NCI_MAX_SENSF_RES_LEN |
| 691 | #define NFC_NFCID2_LEN NCI_NFCID2_LEN |
| 692 | typedef struct { |
| 693 | uint8_t bit_rate; /* NFC_BIT_RATE_212 or NFC_BIT_RATE_424 */ |
| 694 | uint8_t sensf_res_len; /* Length of SENSF_RES Response (Byte 2 - Byte 17 or |
| 695 | 19) Available after Technology Detection */ |
| 696 | uint8_t sensf_res[NFC_MAX_SENSF_RES_LEN]; /* SENSB_RES Response */ |
| 697 | uint8_t nfcid2[NFC_NFCID2_LEN]; /* NFCID2 generated by the Local NFCC for |
| 698 | NFC-DEP Protocol.Available for Frame |
| 699 | Interface */ |
| 700 | uint8_t mrti_check; |
| 701 | uint8_t mrti_update; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 702 | } tNFC_RF_PF_PARAMS; |
| 703 | |
| 704 | typedef tNCI_RF_LF_PARAMS tNFC_RF_LF_PARAMS; |
| 705 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 706 | #define NFC_ISO15693_UID_LEN 8 |
| 707 | typedef struct { |
| 708 | uint8_t flag; |
| 709 | uint8_t dsfid; |
| 710 | uint8_t uid[NFC_ISO15693_UID_LEN]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 711 | } tNFC_RF_PISO15693_PARAMS; |
| 712 | |
| 713 | #ifndef NFC_KOVIO_MAX_LEN |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 714 | #define NFC_KOVIO_MAX_LEN 32 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 715 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 716 | typedef struct { |
| 717 | uint8_t uid_len; |
| 718 | uint8_t uid[NFC_KOVIO_MAX_LEN]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 719 | } tNFC_RF_PKOVIO_PARAMS; |
| 720 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 721 | typedef tNCI_RF_ACM_P_PARAMS tNFC_RF_ACM_P_PARAMS; |
| 722 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 723 | typedef union { |
| 724 | tNFC_RF_PA_PARAMS pa; |
| 725 | tNFC_RF_PB_PARAMS pb; |
| 726 | tNFC_RF_PF_PARAMS pf; |
| 727 | tNFC_RF_LF_PARAMS lf; |
| 728 | tNFC_RF_PISO15693_PARAMS pi93; |
| 729 | tNFC_RF_PKOVIO_PARAMS pk; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 730 | tNFC_RF_ACM_P_PARAMS acm_p; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 731 | } tNFC_RF_TECH_PARAMU; |
| 732 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 733 | typedef struct { |
| 734 | tNFC_DISCOVERY_TYPE mode; |
| 735 | tNFC_RF_TECH_PARAMU param; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 736 | } tNFC_RF_TECH_PARAMS; |
| 737 | |
| 738 | /* the data type associated with NFC_RESULT_DEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 739 | typedef struct { |
| 740 | tNFC_STATUS status; /* The event status - place holder. */ |
| 741 | uint8_t rf_disc_id; /* RF Discovery ID */ |
| 742 | uint8_t protocol; /* supported protocol */ |
| 743 | tNFC_RF_TECH_PARAMS rf_tech_param; /* RF technology parameters */ |
| 744 | uint8_t more; /* 0: last, 1: last (limit), 2: more */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 745 | } tNFC_RESULT_DEVT; |
| 746 | |
| 747 | /* the data type associated with NFC_SELECT_DEVT */ |
| 748 | typedef tNFC_STATUS tNFC_SELECT_DEVT; |
| 749 | |
| 750 | /* the data type associated with NFC_STOP_DEVT */ |
| 751 | typedef tNFC_STATUS tNFC_STOP_DEVT; |
| 752 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 753 | #define NFC_MAX_ATS_LEN NCI_MAX_ATS_LEN |
| 754 | #define NFC_MAX_HIS_BYTES_LEN NCI_MAX_HIS_BYTES_LEN |
| 755 | #define NFC_MAX_GEN_BYTES_LEN NCI_MAX_GEN_BYTES_LEN |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 756 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 757 | typedef struct { |
| 758 | uint8_t ats_res_len; /* Length of ATS RES */ |
| 759 | uint8_t ats_res[NFC_MAX_ATS_LEN]; /* ATS RES */ |
| 760 | bool nad_used; /* NAD is used or not */ |
| 761 | uint8_t fwi; /* Frame Waiting time Integer */ |
| 762 | uint8_t sfgi; /* Start-up Frame Guard time Integer*/ |
| 763 | uint8_t his_byte_len; /* len of historical bytes */ |
| 764 | uint8_t his_byte[NFC_MAX_HIS_BYTES_LEN]; /* historical bytes */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 765 | } tNFC_INTF_PA_ISO_DEP; |
| 766 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 767 | typedef struct { uint8_t rats; /* RATS */ } tNFC_INTF_LA_ISO_DEP; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 768 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 769 | typedef struct { |
| 770 | uint8_t atr_res_len; /* Length of ATR_RES */ |
| 771 | uint8_t atr_res[NFC_MAX_ATS_LEN]; /* ATR_RES (Byte 3 - Byte 17+n) */ |
| 772 | uint8_t max_payload_size; /* 64, 128, 192 or 254 */ |
| 773 | uint8_t gen_bytes_len; /* len of general bytes */ |
| 774 | uint8_t gen_bytes[NFC_MAX_GEN_BYTES_LEN]; /* general bytes */ |
| 775 | uint8_t |
| 776 | waiting_time; /* WT -> Response Waiting Time RWT = (256 x 16/fC) x 2WT */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 777 | } tNFC_INTF_PA_NFC_DEP; |
| 778 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 779 | /* Note: keep tNFC_INTF_PA_NFC_DEP data member in the same order as |
| 780 | * tNFC_INTF_LA_NFC_DEP */ |
| 781 | typedef struct { |
| 782 | uint8_t atr_req_len; /* Length of ATR_REQ */ |
| 783 | uint8_t atr_req[NFC_MAX_ATS_LEN]; /* ATR_REQ (Byte 3 - Byte 18+n) */ |
| 784 | uint8_t max_payload_size; /* 64, 128, 192 or 254 */ |
| 785 | uint8_t gen_bytes_len; /* len of general bytes */ |
| 786 | uint8_t gen_bytes[NFC_MAX_GEN_BYTES_LEN]; /* general bytes */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 787 | } tNFC_INTF_LA_NFC_DEP; |
| 788 | typedef tNFC_INTF_LA_NFC_DEP tNFC_INTF_LF_NFC_DEP; |
| 789 | typedef tNFC_INTF_PA_NFC_DEP tNFC_INTF_PF_NFC_DEP; |
| 790 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 791 | #define NFC_MAX_ATTRIB_LEN NCI_MAX_ATTRIB_LEN |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 792 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 793 | typedef struct { |
| 794 | uint8_t attrib_res_len; /* Length of ATTRIB RES */ |
| 795 | uint8_t attrib_res[NFC_MAX_ATTRIB_LEN]; /* ATTRIB RES */ |
| 796 | uint8_t hi_info_len; /* len of Higher layer Info */ |
| 797 | uint8_t hi_info[NFC_MAX_GEN_BYTES_LEN]; /* Higher layer Info */ |
| 798 | uint8_t mbli; /* Maximum buffer length. */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 799 | } tNFC_INTF_PB_ISO_DEP; |
| 800 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 801 | typedef struct { |
| 802 | uint8_t attrib_req_len; /* Length of ATTRIB REQ */ |
| 803 | uint8_t attrib_req[NFC_MAX_ATTRIB_LEN]; /* ATTRIB REQ (Byte 2 - 10+k)*/ |
| 804 | uint8_t hi_info_len; /* len of Higher layer Info */ |
| 805 | uint8_t hi_info[NFC_MAX_GEN_BYTES_LEN]; /* Higher layer Info */ |
| 806 | uint8_t nfcid0[NFC_NFCID0_MAX_LEN]; /* NFCID0 */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 807 | } tNFC_INTF_LB_ISO_DEP; |
| 808 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 809 | #ifndef NFC_MAX_RAW_PARAMS |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 810 | #define NFC_MAX_RAW_PARAMS 16 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 811 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 812 | #define NFC_MAX_RAW_PARAMS 16 |
| 813 | typedef struct { |
| 814 | uint8_t param_len; |
| 815 | uint8_t param[NFC_MAX_RAW_PARAMS]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 816 | } tNFC_INTF_FRAME; |
| 817 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 818 | typedef struct { |
| 819 | tNFC_INTF_TYPE type; /* Interface Type 1 Byte See Table 67 */ |
| 820 | union { |
| 821 | tNFC_INTF_LA_ISO_DEP la_iso; |
| 822 | tNFC_INTF_PA_ISO_DEP pa_iso; |
| 823 | tNFC_INTF_LB_ISO_DEP lb_iso; |
| 824 | tNFC_INTF_PB_ISO_DEP pb_iso; |
| 825 | tNFC_INTF_LA_NFC_DEP la_nfc; |
| 826 | tNFC_INTF_PA_NFC_DEP pa_nfc; |
| 827 | tNFC_INTF_LF_NFC_DEP lf_nfc; |
| 828 | tNFC_INTF_PF_NFC_DEP pf_nfc; |
| 829 | tNFC_INTF_FRAME frame; |
| 830 | } intf_param; /* Activation Parameters 0 - n Bytes */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 831 | } tNFC_INTF_PARAMS; |
| 832 | |
| 833 | /* the data type associated with NFC_ACTIVATE_DEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 834 | typedef struct { |
| 835 | uint8_t rf_disc_id; /* RF Discovery ID */ |
| 836 | tNFC_PROTOCOL protocol; /* supported protocol */ |
| 837 | tNFC_RF_TECH_PARAMS rf_tech_param; /* RF technology parameters */ |
| 838 | tNFC_DISCOVERY_TYPE data_mode; /* for future Data Exchange */ |
| 839 | tNFC_BIT_RATE tx_bitrate; /* Data Exchange Tx Bitrate */ |
| 840 | tNFC_BIT_RATE rx_bitrate; /* Data Exchange Rx Bitrate */ |
| 841 | tNFC_INTF_PARAMS intf_param; /* interface type and params*/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 842 | } tNFC_ACTIVATE_DEVT; |
| 843 | |
| 844 | /* the data type associated with NFC_DEACTIVATE_DEVT and NFC_DEACTIVATE_CEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 845 | typedef struct { |
| 846 | tNFC_STATUS status; /* The event status. */ |
| 847 | tNFC_DEACT_TYPE type; /* De-activate type */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 848 | bool is_ntf; /* TRUE, if deactivate notif*/ |
| 849 | tNFC_DEACT_REASON reason; /* De-activate reason */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 850 | } tNFC_DEACTIVATE_DEVT; |
| 851 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 852 | typedef union { |
| 853 | tNFC_STATUS status; /* The event status. */ |
| 854 | tNFC_START_DEVT start; |
| 855 | tNFC_RESULT_DEVT result; |
| 856 | tNFC_SELECT_DEVT select; |
| 857 | tNFC_STOP_DEVT stop; |
| 858 | tNFC_ACTIVATE_DEVT activate; |
| 859 | tNFC_DEACTIVATE_DEVT deactivate; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 860 | } tNFC_DISCOVER; |
| 861 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 862 | typedef struct { |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 863 | bool include_rf_tech_mode; /* TRUE if including RF Tech and Mode update */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 864 | tNFC_RF_TECH_N_MODE rf_tech_n_mode; /* RF tech and mode */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 865 | bool include_tx_bit_rate; /* TRUE if including Tx bit rate update */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 866 | tNFC_BIT_RATE tx_bit_rate; /* Transmit Bit Rate */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 867 | bool include_rx_bit_rate; /* TRUE if including Rx bit rate update */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 868 | tNFC_BIT_RATE rx_bit_rate; /* Receive Bit Rate */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 869 | bool include_nfc_b_config; /* TRUE if including NFC-B data exchange config */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 870 | uint8_t min_tr0; /* Minimun TR0 */ |
| 871 | uint8_t min_tr1; /* Minimun TR1 */ |
| 872 | uint8_t suppression_eos; /* Suppression of EoS */ |
| 873 | uint8_t suppression_sos; /* Suppression of SoS */ |
| 874 | uint8_t min_tr2; /* Minimun TR1 */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 875 | } tNFC_RF_COMM_PARAMS; |
| 876 | |
| 877 | /************************************* |
| 878 | ** DISCOVER Callback Functions |
| 879 | **************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 880 | typedef void(tNFC_DISCOVER_CBACK)(tNFC_DISCOVER_EVT event, |
| 881 | tNFC_DISCOVER* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 882 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 883 | typedef uint16_t tNFC_TEST_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 884 | |
| 885 | /* the data type associated with NFC_LOOPBACK_TEVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 886 | typedef struct { |
| 887 | tNFC_STATUS status; /* The event status. */ |
| 888 | NFC_HDR* p_data; /* The loop back data from NFCC */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 889 | } tNFC_LOOPBACK_TEVT; |
| 890 | |
| 891 | /* the data type associated with NFC_RF_CONTROL_TEVT */ |
| 892 | typedef tNFC_STATUS tNFC_RF_CONTROL_TEVT; |
| 893 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 894 | typedef union { |
| 895 | tNFC_STATUS status; /* The event status. */ |
| 896 | tNFC_LOOPBACK_TEVT loop_back; |
| 897 | tNFC_RF_CONTROL_TEVT rf_control; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 898 | } tNFC_TEST; |
| 899 | |
| 900 | /************************************* |
| 901 | ** TEST Callback Functions |
| 902 | **************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 903 | typedef void(tNFC_TEST_CBACK)(tNFC_TEST_EVT event, tNFC_TEST* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 904 | |
| 905 | typedef tNFC_DEACTIVATE_DEVT tNFC_DEACTIVATE_CEVT; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 906 | typedef union { |
| 907 | tNFC_STATUS status; /* The event status. */ |
| 908 | tNFC_CONN_CREATE_CEVT conn_create; |
| 909 | tNFC_CONN_CLOSE_CEVT conn_close; |
| 910 | tNFC_DEACTIVATE_CEVT deactivate; |
| 911 | tNFC_DATA_CEVT data; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 912 | } tNFC_CONN; |
| 913 | |
| 914 | /************************************* |
| 915 | ** Data Callback Functions |
| 916 | **************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 917 | typedef void(tNFC_CONN_CBACK)(uint8_t conn_id, tNFC_CONN_EVT event, |
| 918 | tNFC_CONN* p_data); |
| 919 | #define NFC_MAX_CONN_ID 15 |
| 920 | #define NFC_ILLEGAL_CONN_ID 0xFF |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 921 | /* the static connection ID for RF traffic */ |
| 922 | #define NFC_RF_CONN_ID 0 |
| 923 | /* the static connection ID for HCI transport */ |
Suraj Uday Kotharkar | 71fc580 | 2018-06-01 16:57:34 +0530 | [diff] [blame] | 924 | #define NFC_HCI_CONN_ID 1 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 925 | #if (NXP_EXTNS == TRUE) |
| 926 | #define NFC_NFCEE_CONN_ID 0x03 /* the connection ID for NFCEE */ |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 927 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 928 | |
| 929 | /***************************************************************************** |
| 930 | ** EXTERNAL FUNCTION DECLARATIONS |
| 931 | *****************************************************************************/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 932 | |
| 933 | /******************************************************************************* |
| 934 | ** |
| 935 | ** Function NFC_Enable |
| 936 | ** |
| 937 | ** Description This function enables NFC. Prior to calling NFC_Enable: |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 938 | ** - the NFCC must be powered up, and ready to receive |
| 939 | ** commands. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 940 | ** - GKI must be enabled |
| 941 | ** - NFC_TASK must be started |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 942 | ** - NCIT_TASK must be started (if using dedicated NCI |
| 943 | ** transport) |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 944 | ** |
| 945 | ** This function opens the NCI transport (if applicable), |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 946 | ** resets the NFC controller, and initializes the NFC |
| 947 | ** subsystems. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 948 | ** |
| 949 | ** When the NFC startup procedure is completed, an |
| 950 | ** NFC_ENABLE_REVT is returned to the application using the |
| 951 | ** tNFC_RESPONSE_CBACK. |
| 952 | ** |
| 953 | ** Returns tNFC_STATUS |
| 954 | ** |
| 955 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 956 | extern tNFC_STATUS NFC_Enable(tNFC_RESPONSE_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 957 | |
| 958 | /******************************************************************************* |
| 959 | ** |
| 960 | ** Function NFC_Disable |
| 961 | ** |
| 962 | ** Description This function performs clean up routines for shutting down |
| 963 | ** NFC and closes the NCI transport (if using dedicated NCI |
| 964 | ** transport). |
| 965 | ** |
| 966 | ** When the NFC shutdown procedure is completed, an |
| 967 | ** NFC_DISABLED_REVT is returned to the application using the |
| 968 | ** tNFC_RESPONSE_CBACK. |
| 969 | ** |
| 970 | ** Returns nothing |
| 971 | ** |
| 972 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 973 | extern void NFC_Disable(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 974 | |
| 975 | /******************************************************************************* |
| 976 | ** |
| 977 | ** Function NFC_Init |
| 978 | ** |
| 979 | ** Description This function initializes control blocks for NFC |
| 980 | ** |
| 981 | ** Returns nothing |
| 982 | ** |
| 983 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 984 | extern void NFC_Init(tHAL_NFC_ENTRY* p_hal_entry_tbl); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 985 | |
| 986 | /******************************************************************************* |
| 987 | ** |
| 988 | ** Function NFC_GetLmrtSize |
| 989 | ** |
| 990 | ** Description Called by application wto query the Listen Mode Routing |
| 991 | ** Table size supported by NFCC |
| 992 | ** |
| 993 | ** Returns Listen Mode Routing Table size |
| 994 | ** |
| 995 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 996 | extern uint16_t NFC_GetLmrtSize(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 997 | |
| 998 | /******************************************************************************* |
| 999 | ** |
| 1000 | ** Function NFC_SetConfig |
| 1001 | ** |
| 1002 | ** Description This function is called to send the configuration parameter |
| 1003 | ** TLV to NFCC. The response from NFCC is reported by |
| 1004 | ** tNFC_RESPONSE_CBACK as NFC_SET_CONFIG_REVT. |
| 1005 | ** |
| 1006 | ** Parameters tlv_size - the length of p_param_tlvs. |
| 1007 | ** p_param_tlvs - the parameter ID/Len/Value list |
| 1008 | ** |
| 1009 | ** Returns tNFC_STATUS |
| 1010 | ** |
| 1011 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1012 | extern tNFC_STATUS NFC_SetConfig(uint8_t tlv_size, uint8_t* p_param_tlvs); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1013 | |
| 1014 | /******************************************************************************* |
| 1015 | ** |
| 1016 | ** Function NFC_GetConfig |
| 1017 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1018 | ** Description This function is called to retrieve the parameter TLV from |
| 1019 | ** NFCC. The response from NFCC is reported by |
| 1020 | ** tNFC_RESPONSE_CBACK as NFC_GET_CONFIG_REVT. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1021 | ** |
| 1022 | ** Parameters num_ids - the number of parameter IDs |
| 1023 | ** p_param_ids - the parameter ID list. |
| 1024 | ** |
| 1025 | ** Returns tNFC_STATUS |
| 1026 | ** |
| 1027 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1028 | extern tNFC_STATUS NFC_GetConfig(uint8_t num_ids, uint8_t* p_param_ids); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1029 | |
| 1030 | /******************************************************************************* |
| 1031 | ** |
| 1032 | ** Function NFC_NfceeDiscover |
| 1033 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1034 | ** Description This function is called to enable or disable NFCEE |
| 1035 | ** Discovery. The response from NFCC is reported by |
| 1036 | ** tNFC_RESPONSE_CBACK as NFC_NFCEE_DISCOVER_REVT. |
| 1037 | ** The notification from NFCC is reported by |
| 1038 | ** tNFC_RESPONSE_CBACK as NFC_NFCEE_INFO_REVT. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1039 | ** |
| 1040 | ** Parameters discover - 1 to enable discover, 0 to disable. |
| 1041 | ** |
| 1042 | ** Returns tNFC_STATUS |
| 1043 | ** |
| 1044 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1045 | extern tNFC_STATUS NFC_NfceeDiscover(bool discover); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1046 | |
| 1047 | /******************************************************************************* |
| 1048 | ** |
| 1049 | ** Function NFC_NfceeModeSet |
| 1050 | ** |
| 1051 | ** Description This function is called to activate or de-activate an NFCEE |
| 1052 | ** connected to the NFCC. |
| 1053 | ** The response from NFCC is reported by tNFC_RESPONSE_CBACK |
| 1054 | ** as NFC_NFCEE_MODE_SET_REVT. |
| 1055 | ** |
| 1056 | ** Parameters nfcee_id - the NFCEE to activate or de-activate. |
| 1057 | ** mode - 0 to activate NFCEE, 1 to de-activate. |
| 1058 | ** |
| 1059 | ** Returns tNFC_STATUS |
| 1060 | ** |
| 1061 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1062 | extern tNFC_STATUS NFC_NfceeModeSet(uint8_t nfcee_id, tNFC_NFCEE_MODE mode); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1063 | /******************************************************************************* |
| 1064 | ** |
| 1065 | ** Function NFC_DiscoveryMap |
| 1066 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1067 | ** Description This function is called to set the discovery interface |
| 1068 | ** mapping. The response from NFCC is reported by |
| 1069 | ** tNFC_DISCOVER_CBACK as. NFC_MAP_DEVT. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1070 | ** |
| 1071 | ** Parameters num - the number of items in p_params. |
| 1072 | ** p_maps - the discovery interface mappings |
| 1073 | ** p_cback - the discovery callback function |
| 1074 | ** |
| 1075 | ** Returns tNFC_STATUS |
| 1076 | ** |
| 1077 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1078 | extern tNFC_STATUS NFC_DiscoveryMap(uint8_t num, tNFC_DISCOVER_MAPS* p_maps, |
| 1079 | tNFC_DISCOVER_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1080 | |
| 1081 | /******************************************************************************* |
| 1082 | ** |
| 1083 | ** Function NFC_DiscoveryStart |
| 1084 | ** |
| 1085 | ** Description This function is called to start Polling and/or Listening. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1086 | ** The response from NFCC is reported by tNFC_DISCOVER_CBACK |
| 1087 | ** as NFC_START_DEVT. The notification from NFCC is reported by |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1088 | ** tNFC_DISCOVER_CBACK as NFC_RESULT_DEVT. |
| 1089 | ** |
| 1090 | ** Parameters num_params - the number of items in p_params. |
| 1091 | ** p_params - the discovery parameters |
| 1092 | ** p_cback - the discovery callback function |
| 1093 | ** |
| 1094 | ** Returns tNFC_STATUS |
| 1095 | ** |
| 1096 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1097 | extern tNFC_STATUS NFC_DiscoveryStart(uint8_t num_params, |
| 1098 | tNFC_DISCOVER_PARAMS* p_params, |
| 1099 | tNFC_DISCOVER_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1100 | |
| 1101 | /******************************************************************************* |
| 1102 | ** |
| 1103 | ** Function NFC_DiscoverySelect |
| 1104 | ** |
| 1105 | ** Description If tNFC_DISCOVER_CBACK reports status=NFC_MULTIPLE_PROT, |
| 1106 | ** the application needs to use this function to select the |
| 1107 | ** the logical endpoint to continue. The response from NFCC is |
| 1108 | ** reported by tNFC_DISCOVER_CBACK as NFC_SELECT_DEVT. |
| 1109 | ** |
| 1110 | ** Parameters rf_disc_id - The ID identifies the remote device. |
| 1111 | ** protocol - the logical endpoint on the remote devide |
| 1112 | ** rf_interface - the RF interface to communicate with NFCC |
| 1113 | ** |
| 1114 | ** Returns tNFC_STATUS |
| 1115 | ** |
| 1116 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1117 | extern tNFC_STATUS NFC_DiscoverySelect(uint8_t rf_disc_id, uint8_t protocol, |
| 1118 | uint8_t rf_interface); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1119 | |
| 1120 | /******************************************************************************* |
| 1121 | ** |
| 1122 | ** Function NFC_ConnCreate |
| 1123 | ** |
| 1124 | ** Description This function is called to create a logical connection with |
| 1125 | ** NFCC for data exchange. |
| 1126 | ** The response from NFCC is reported in tNFC_CONN_CBACK |
| 1127 | ** as NFC_CONN_CREATE_CEVT. |
| 1128 | ** |
| 1129 | ** Parameters dest_type - the destination type |
| 1130 | ** id - the NFCEE ID or RF Discovery ID . |
| 1131 | ** protocol - the protocol |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1132 | ** p_cback - the data callback function to receive data from |
| 1133 | ** NFCC |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1134 | ** |
| 1135 | ** Returns tNFC_STATUS |
| 1136 | ** |
| 1137 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1138 | extern tNFC_STATUS NFC_ConnCreate(uint8_t dest_type, uint8_t id, |
| 1139 | uint8_t protocol, tNFC_CONN_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1140 | |
| 1141 | /******************************************************************************* |
| 1142 | ** |
| 1143 | ** Function NFC_ConnClose |
| 1144 | ** |
| 1145 | ** Description This function is called to close a logical connection with |
| 1146 | ** NFCC. |
| 1147 | ** The response from NFCC is reported in tNFC_CONN_CBACK |
| 1148 | ** as NFC_CONN_CLOSE_CEVT. |
| 1149 | ** |
| 1150 | ** Parameters conn_id - the connection id. |
| 1151 | ** |
| 1152 | ** Returns tNFC_STATUS |
| 1153 | ** |
| 1154 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1155 | extern tNFC_STATUS NFC_ConnClose(uint8_t conn_id); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1156 | |
| 1157 | /******************************************************************************* |
| 1158 | ** |
| 1159 | ** Function NFC_SetStaticRfCback |
| 1160 | ** |
| 1161 | ** Description This function is called to update the data callback function |
| 1162 | ** to receive the data for the given connection id. |
| 1163 | ** |
| 1164 | ** Parameters p_cback - the connection callback function |
| 1165 | ** |
| 1166 | ** Returns Nothing |
| 1167 | ** |
| 1168 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1169 | extern void NFC_SetStaticRfCback(tNFC_CONN_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1170 | |
| 1171 | /******************************************************************************* |
| 1172 | ** |
| 1173 | ** Function NFC_SetReassemblyFlag |
| 1174 | ** |
| 1175 | ** Description This function is called to set if nfc will reassemble |
| 1176 | ** nci packet as much as its buffer can hold or it should not |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1177 | ** reassemble but forward the fragmented nci packet to layer |
| 1178 | ** above. If nci data pkt is fragmented, nfc may send multiple |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1179 | ** NFC_DATA_CEVT with status NFC_STATUS_CONTINUE before sending |
| 1180 | ** NFC_DATA_CEVT with status NFC_STATUS_OK based on reassembly |
| 1181 | ** configuration and reassembly buffer size |
| 1182 | ** |
| 1183 | ** Parameters reassembly - flag to indicate if nfc may reassemble or not |
| 1184 | ** |
| 1185 | ** Returns Nothing |
| 1186 | ** |
| 1187 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1188 | extern void NFC_SetReassemblyFlag(bool reassembly); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1189 | |
| 1190 | /******************************************************************************* |
| 1191 | ** |
| 1192 | ** Function NFC_SendData |
| 1193 | ** |
| 1194 | ** Description This function is called to send the given data packet |
| 1195 | ** to the connection identified by the given connection id. |
| 1196 | ** |
| 1197 | ** Parameters conn_id - the connection id. |
| 1198 | ** p_data - the data packet |
| 1199 | ** |
| 1200 | ** Returns tNFC_STATUS |
| 1201 | ** |
| 1202 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1203 | extern tNFC_STATUS NFC_SendData(uint8_t conn_id, NFC_HDR* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1204 | |
| 1205 | /******************************************************************************* |
| 1206 | ** |
| 1207 | ** Function NFC_FlushData |
| 1208 | ** |
| 1209 | ** Description This function is called to discard the tx data queue of |
| 1210 | ** the given connection id. |
| 1211 | ** |
| 1212 | ** Parameters conn_id - the connection id. |
| 1213 | ** |
| 1214 | ** Returns tNFC_STATUS |
| 1215 | ** |
| 1216 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1217 | extern tNFC_STATUS NFC_FlushData(uint8_t conn_id); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1218 | |
| 1219 | /******************************************************************************* |
| 1220 | ** |
| 1221 | ** Function NFC_Deactivate |
| 1222 | ** |
| 1223 | ** Description This function is called to stop the discovery process or |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1224 | ** put the listen device in sleep mode or terminate the NFC |
| 1225 | ** link. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1226 | ** |
| 1227 | ** The response from NFCC is reported by tNFC_DISCOVER_CBACK |
| 1228 | ** as NFC_DEACTIVATE_DEVT. |
| 1229 | ** |
| 1230 | ** Parameters deactivate_type - NFC_DEACTIVATE_TYPE_IDLE, to IDLE mode. |
| 1231 | ** NFC_DEACTIVATE_TYPE_SLEEP to SLEEP mode. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1232 | ** NFC_DEACTIVATE_TYPE_SLEEP_AF to SLEEP_AF |
| 1233 | ** mode. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1234 | ** |
| 1235 | ** Returns tNFC_STATUS |
| 1236 | ** |
| 1237 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1238 | extern tNFC_STATUS NFC_Deactivate(tNFC_DEACT_TYPE deactivate_type); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1239 | |
| 1240 | /******************************************************************************* |
| 1241 | ** |
| 1242 | ** Function NFC_UpdateRFCommParams |
| 1243 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1244 | ** Description This function is called to update RF Communication |
| 1245 | ** parameters once the Frame RF Interface has been activated. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1246 | ** |
| 1247 | ** The response from NFCC is reported by tNFC_RESPONSE_CBACK |
| 1248 | ** as NFC_RF_COMM_PARAMS_UPDATE_REVT. |
| 1249 | ** |
| 1250 | ** Returns tNFC_STATUS |
| 1251 | ** |
| 1252 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1253 | extern tNFC_STATUS NFC_UpdateRFCommParams(tNFC_RF_COMM_PARAMS* p_params); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1254 | |
| 1255 | /******************************************************************************* |
| 1256 | ** |
| 1257 | ** Function NFC_SetPowerOffSleep |
| 1258 | ** |
| 1259 | ** Description This function closes/opens transport and turns off/on NFCC. |
| 1260 | ** |
| 1261 | ** Returns tNFC_STATUS |
| 1262 | ** |
| 1263 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1264 | extern tNFC_STATUS NFC_SetPowerOffSleep(bool enable); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1265 | |
| 1266 | /******************************************************************************* |
| 1267 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1268 | ** Function NFC_SetPowerSubState |
| 1269 | ** |
| 1270 | ** Description This function is called to send the power sub state(screen |
| 1271 | ** state) to NFCC. The response from NFCC is reported by |
| 1272 | ** tNFC_RESPONSE_CBACK as NFC_SET_POWER_STATE_REVT. |
| 1273 | ** |
| 1274 | ** Parameters scree_state |
| 1275 | ** |
| 1276 | ** Returns tNFC_STATUS |
| 1277 | ** |
| 1278 | *******************************************************************************/ |
| 1279 | extern tNFC_STATUS NFC_SetPowerSubState(uint8_t screen_state); |
| 1280 | |
| 1281 | /******************************************************************************* |
| 1282 | ** |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1283 | ** Function NFC_PowerCycleNFCC |
| 1284 | ** |
| 1285 | ** Description This function turns off and then on NFCC. |
| 1286 | ** |
| 1287 | ** Returns tNFC_STATUS |
| 1288 | ** |
| 1289 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1290 | extern tNFC_STATUS NFC_PowerCycleNFCC(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1291 | |
| 1292 | /******************************************************************************* |
| 1293 | ** |
| 1294 | ** Function NFC_SetRouting |
| 1295 | ** |
| 1296 | ** Description This function is called to configure the CE routing table. |
| 1297 | ** The response from NFCC is reported by tNFC_RESPONSE_CBACK |
| 1298 | ** as NFC_SET_ROUTING_REVT. |
| 1299 | ** |
| 1300 | ** Parameters |
| 1301 | ** |
| 1302 | ** Returns tNFC_STATUS |
| 1303 | ** |
| 1304 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1305 | extern tNFC_STATUS NFC_SetRouting(bool more, uint8_t num_tlv, uint8_t tlv_size, |
| 1306 | uint8_t* p_param_tlvs); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1307 | |
| 1308 | /******************************************************************************* |
| 1309 | ** |
| 1310 | ** Function NFC_GetRouting |
| 1311 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1312 | ** Description This function is called to retrieve the CE routing table |
| 1313 | ** from NFCC. The response from NFCC is reported by |
| 1314 | ** tNFC_RESPONSE_CBACK as NFC_GET_ROUTING_REVT. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1315 | ** |
| 1316 | ** Returns tNFC_STATUS |
| 1317 | ** |
| 1318 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1319 | extern tNFC_STATUS NFC_GetRouting(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1320 | |
| 1321 | /******************************************************************************* |
| 1322 | ** |
| 1323 | ** Function NFC_RegVSCback |
| 1324 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1325 | ** Description This function is called to register or de-register a |
| 1326 | ** callback function to receive Proprietary NCI response and |
| 1327 | ** notification events. |
| 1328 | ** The maximum number of callback functions allowed is |
| 1329 | ** NFC_NUM_VS_CBACKS |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1330 | ** |
| 1331 | ** Returns tNFC_STATUS |
| 1332 | ** |
| 1333 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1334 | extern tNFC_STATUS NFC_RegVSCback(bool is_register, tNFC_VS_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1335 | |
| 1336 | /******************************************************************************* |
| 1337 | ** |
| 1338 | ** Function NFC_SendVsCommand |
| 1339 | ** |
| 1340 | ** Description This function is called to send the given vendor specific |
| 1341 | ** command to NFCC. The response from NFCC is reported to the |
| 1342 | ** given tNFC_VS_CBACK as (oid). |
| 1343 | ** |
| 1344 | ** Parameters oid - The opcode of the VS command. |
| 1345 | ** p_data - The parameters for the VS command |
| 1346 | ** |
| 1347 | ** Returns tNFC_STATUS |
| 1348 | ** |
| 1349 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1350 | extern tNFC_STATUS NFC_SendVsCommand(uint8_t oid, NFC_HDR* p_data, |
| 1351 | tNFC_VS_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1352 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1353 | /******************************************************************************* |
| 1354 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1355 | ** Function NFC_SendRawVsCommand |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1356 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1357 | ** Description This function is called to send the given raw command to |
| 1358 | ** NFCC. The response from NFCC is reported to the given |
| 1359 | ** tNFC_VS_CBACK. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1360 | ** |
| 1361 | ** Parameters p_data - The command buffer |
| 1362 | ** |
| 1363 | ** Returns tNFC_STATUS |
| 1364 | ** |
| 1365 | *******************************************************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1366 | extern tNFC_STATUS NFC_SendRawVsCommand(NFC_HDR* p_data, |
| 1367 | tNFC_VS_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1368 | |
| 1369 | /******************************************************************************* |
| 1370 | ** |
| 1371 | ** Function NFC_TestLoopback |
| 1372 | ** |
| 1373 | ** Description This function is called to send the given data packet |
| 1374 | ** to NFCC for loopback test. |
| 1375 | ** When loopback data is received from NFCC, tNFC_TEST_CBACK . |
| 1376 | ** reports a NFC_LOOPBACK_TEVT. |
| 1377 | ** |
| 1378 | ** Parameters p_data - the data packet |
| 1379 | ** |
| 1380 | ** Returns tNFC_STATUS |
| 1381 | ** |
| 1382 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1383 | extern tNFC_STATUS NFC_TestLoopback(NFC_HDR* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1384 | |
| 1385 | /******************************************************************************* |
| 1386 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1387 | ** Function NFC_ISODEPNakPresCheck |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1388 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1389 | ** Description This function is called to send the ISO DEP nak presence |
| 1390 | ** check cmd to check that the remote end point in RF field. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1391 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1392 | ** Returns tNFC_STATUS |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1393 | ** |
| 1394 | *******************************************************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1395 | extern tNFC_STATUS NFC_ISODEPNakPresCheck(); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1396 | |
Soma | 8f4735d | 2018-06-19 14:24:00 +0530 | [diff] [blame] | 1397 | #if (NXP_EXTNS == TRUE) |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1398 | /******************************************************************************* |
| 1399 | ** |
| 1400 | ** Function nfc_ncif_getFWVersion |
| 1401 | ** |
| 1402 | ** Description This function sets the trace level for NFC. If called with |
| 1403 | ** a value of 0xFF, it simply returns the current trace level. |
| 1404 | ** |
| 1405 | ** Returns The new or current trace level |
| 1406 | ** |
| 1407 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1408 | extern tNFC_FW_VERSION nfc_ncif_getFWVersion(); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1409 | #endif |
| 1410 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1411 | /******************************************************************************* |
| 1412 | ** |
| 1413 | ** Function NFC_NfceePLConfig |
| 1414 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1415 | ** Description This function is called to set the Power and Link Control |
| 1416 | ** to an NFCEE connected to the NFCC. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1417 | ** The response from NFCC is reported by tNFC_RESPONSE_CBACK |
| 1418 | ** as NFC_NFCEE_PL_CONTROL_REVT. |
| 1419 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1420 | ** Parameters nfcee_id - the NFCEE to activate or de-activate. |
| 1421 | ** pl_config - |
| 1422 | ** NFCEE_PL_CONFIG_NFCC_DECIDES -NFCC decides (default) |
| 1423 | ** NFCEE_PL_CONFIG_PWR_ALWAYS_ON -NFCEE power supply always on |
| 1424 | ** NFCEE_PL_CONFIG_LNK_ON_WHEN_PWR_ON - |
| 1425 | ** communication link is always active |
| 1426 | ** when NFCEE is powered on |
| 1427 | ** NFCEE_PL_CONFIG_PWR_LNK_ALWAYS_ON - |
| 1428 | ** power supply and communication |
| 1429 | ** link are always on |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1430 | ** Returns tNFC_STATUS |
| 1431 | ** |
| 1432 | *******************************************************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1433 | extern tNFC_STATUS NFC_NfceePLConfig(uint8_t nfcee_id, |
| 1434 | tNCI_NFCEE_PL_CONFIG pl_config); |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1435 | |
| 1436 | /******************************************************************************* |
| 1437 | ** |
| 1438 | ** Function NFC_SetStaticHciCback |
| 1439 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1440 | ** Description This function to update the data callback function |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1441 | ** to receive the data for the static Hci connection id. |
| 1442 | ** |
| 1443 | ** Parameters p_cback - the connection callback function |
| 1444 | ** |
| 1445 | ** Returns Nothing |
| 1446 | ** |
| 1447 | *******************************************************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1448 | extern void NFC_SetStaticHciCback(tNFC_CONN_CBACK* p_cback); |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1449 | |
| 1450 | /******************************************************************************* |
| 1451 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1452 | ** Function NFC_GetStatusName |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1453 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1454 | ** Description This function returns the status name. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1455 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1456 | ** NOTE conditionally compiled to save memory. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1457 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1458 | ** Returns pointer to the name |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1459 | ** |
| 1460 | *******************************************************************************/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1461 | extern std::string NFC_GetStatusName(tNFC_STATUS status); |
ubuntu | 279b7f5 | 2017-09-27 19:01:25 +0530 | [diff] [blame] | 1462 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1463 | #endif /* NFC_API_H */ |