1 /******************************************************************************
2  *
3  *  Copyright (C) 2010-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 /******************************************************************************
20  *
21  *  NFA reader/writer API functions
22  *
23  ******************************************************************************/
24 #ifndef NFA_RW_API_H
25 #define NFA_RW_API_H
26 
27 #include "nfa_api.h"
28 #include "nfc_target.h"
29 
30 /*****************************************************************************
31 **  Constants and data types
32 *****************************************************************************/
33 enum {
34   NFA_RW_PRES_CHK_DEFAULT,        /* The default behavior             */
35   NFA_RW_PRES_CHK_I_BLOCK,        /* Empty I Block                    */
36   NFA_RW_PRES_CHK_ISO_DEP_NAK = 5 /* presence check command ISO-DEP
37                                  NAK as per NCI2.0                */
38 };
39 typedef uint8_t tNFA_RW_PRES_CHK_OPTION;
40 
41 /*****************************************************************************
42 **  NFA T3T Constants and definitions
43 *****************************************************************************/
44 
45 /* Block descriptor. (For non-NDEF read/write */
46 typedef struct {
47   uint16_t service_code; /* Service code for the block   */
48   uint16_t block_number; /* Block number.                */
49 } tNFA_T3T_BLOCK_DESC;
50 
51 /*****************************************************************************
52 **  External Function Declarations
53 *****************************************************************************/
54 
55 /*******************************************************************************
56 **
57 ** Function         NFA_RwDetectNDef
58 **
59 ** Description      Perform the NDEF detection procedure  using the appropriate
60 **                  method for the currently activated tag.
61 **
62 **                  Upon successful completion of NDEF detection, a
63 **                  NFA_NDEF_DETECT_EVT will be sent, to notify the application
64 **                  of the NDEF attributes (NDEF total memory size, current
65 **                  size, etc.).
66 **
67 **                  It is not mandatory to call this function -  NFA_RwReadNDef
68 **                  and NFA_RwWriteNDef will perform NDEF detection internally
69 **                  if not performed already. This API may be called to get a
70 **                  tag's NDEF size before issuing a write-request.
71 **
72 ** Returns:
73 **                  NFA_STATUS_OK if successfully initiated
74 **                  NFC_STATUS_REFUSED if tag does not support NDEF
75 **                  NFA_STATUS_FAILED otherwise
76 **
77 *******************************************************************************/
78 extern tNFA_STATUS NFA_RwDetectNDef(void);
79 
80 /*******************************************************************************
81 **
82 ** Function         NFA_RwReadNDef
83 **
84 ** Description      Read NDEF message from tag. This function will internally
85 **                  perform the NDEF detection procedure (if not performed
86 **                  previously), and read the NDEF tag data using the
87 **                  appropriate method for the currently activated tag.
88 **
89 **                  Upon successful completion of NDEF detection (if performed),
90 **                  a NFA_NDEF_DETECT_EVT will be sent, to notify the
91 **                  application of the NDEF attributes (NDEF total memory size,
92 **                  current size, etc.).
93 **
94 **                  Upon receiving the NDEF message, the message will be sent to
95 **                  the handler registered with NFA_RegisterNDefTypeHandler or
96 **                  NFA_RequestExclusiveRfControl (if exclusive RF mode is
97 **                  active)
98 **
99 **
100 ** Returns:
101 **                  NFA_STATUS_OK if successfully initiated
102 **                  NFC_STATUS_REFUSED if tag does not support NDEF
103 **                  NFC_STATUS_NOT_INITIALIZED if NULL NDEF was detected on the
104 **                  tag
105 **                  NFA_STATUS_FAILED otherwise
106 **
107 *******************************************************************************/
108 extern tNFA_STATUS NFA_RwReadNDef(void);
109 
110 /*******************************************************************************
111 **
112 ** Function         NFA_RwWriteNDef
113 **
114 ** Description      Write NDEF data to the activated tag. This function will
115 **                  internally perform NDEF detection if necessary, and write
116 **                  the NDEF tag data using the appropriate method for the
117 **                  currently activated tag.
118 **
119 **                  When the entire message has been written, or if an error
120 **                  occurs, the app will be notified with NFA_RW_WRITE_CPLT_EVT.
121 **
122 **                  p_data needs to be persistent until NFA_RW_WRITE_CPLT_EVT
123 **
124 **
125 ** Returns:
126 **                  NFA_STATUS_OK if successfully initiated
127 **                  NFC_STATUS_REFUSED if tag does not support NDEF/locked
128 **                  NFA_STATUS_FAILED otherwise
129 **
130 *******************************************************************************/
131 extern tNFA_STATUS NFA_RwWriteNDef(uint8_t* p_data, uint32_t len);
132 
133 /*****************************************************************************
134 **
135 ** Function         NFA_RwPresenceCheck
136 **
137 ** Description      Check if the tag is still in the field.
138 **
139 **                  The NFA_RW_PRESENCE_CHECK_EVT w/ status is used to
140 **                  indicate presence or non-presence.
141 **
142 **                  option is used only with ISO-DEP protocol
143 **
144 ** Returns
145 **                  NFA_STATUS_OK if successfully initiated
146 **                  NFA_STATUS_FAILED otherwise
147 **
148 *****************************************************************************/
149 extern tNFA_STATUS NFA_RwPresenceCheck(tNFA_RW_PRES_CHK_OPTION option);
150 
151 /*****************************************************************************
152 **
153 ** Function         NFA_RwFormatTag
154 **
155 ** Description      Check if the tag is NDEF Formatable. If yes Format the
156 **                  tag
157 **
158 **                  The NFA_RW_FORMAT_CPLT_EVT w/ status is used to
159 **                  indicate if tag is formated or not.
160 **
161 ** Returns
162 **                  NFA_STATUS_OK if successfully initiated
163 **                  NFA_STATUS_FAILED otherwise
164 **
165 *****************************************************************************/
166 extern tNFA_STATUS NFA_RwFormatTag(void);
167 
168 /*******************************************************************************
169 ** LEGACY / PROPRIETARY TAG READ AND WRITE APIs
170 *******************************************************************************/
171 
172 /*******************************************************************************
173 **
174 ** Function         NFA_RwLocateTlv
175 **
176 ** Description:
177 **      Search for the Lock/Memory contril TLV on the activated Type1/Type2 tag
178 **
179 **      Data is returned to the application using the NFA_TLV_DETECT_EVT. When
180 **      search operation has completed, or if an error occurs, the app will be
181 **      notified with NFA_TLV_DETECT_EVT.
182 **
183 ** Description      Perform the TLV detection procedure  using the appropriate
184 **                  method for the currently activated tag.
185 **
186 **                  Upon successful completion of TLV detection in T1/T2 tag, a
187 **                  NFA_TLV_DETECT_EVT will be sent, to notify the application
188 **                  of the TLV attributes (total lock/reserved bytes etc.).
189 **                  However if the TLV type specified is NDEF then it is same as
190 **                  calling NFA_RwDetectNDef and should expect to receive
191 **                  NFA_NDEF_DETECT_EVT instead of NFA_TLV_DETECT_EVT
192 **
193 **                  It is not mandatory to call this function -
194 **                  NFA_RwDetectNDef, NFA_RwReadNDef and NFA_RwWriteNDef will
195 **                  perform TLV detection internally if not performed already.
196 **                  An application may call this API to check the a
197 **                  tag/card-emulator's total Reserved/ Lock bytes before
198 **                  issuing a write-request.
199 **
200 ** Returns:
201 **                  NFA_STATUS_OK if successfully initiated
202 **                  NFC_STATUS_REFUSED if tlv_type is NDEF & tag won't support
203 **                  NDEF
204 **                  NFA_STATUS_FAILED otherwise
205 **
206 *******************************************************************************/
207 extern tNFA_STATUS NFA_RwLocateTlv(uint8_t tlv_type);
208 
209 /*******************************************************************************
210 **
211 ** Function         NFA_RwSetTagReadOnly
212 **
213 ** Description:
214 **      Sets tag as read only.
215 **
216 **      When tag is set as read only, or if an error occurs, the app will be
217 **      notified with NFA_SET_TAG_RO_EVT.
218 **
219 ** Returns:
220 **      NFA_STATUS_OK if successfully initiated
221 **      NFA_STATUS_REJECTED if protocol is not T1/T2/ISO15693
222 **                 (or) if hard lock is not requested for protocol ISO15693
223 **      NFA_STATUS_FAILED otherwise
224 **
225 *******************************************************************************/
226 extern tNFA_STATUS NFA_RwSetTagReadOnly(bool b_hard_lock);
227 
228 /*******************************************************************************
229 **
230 ** Function         NFA_RwT1tRid
231 **
232 ** Description:
233 **      Send a RID command to the activated Type 1 tag.
234 **
235 **      Data is returned to the application using the NFA_DATA_EVT. When the
236 **      read operation has completed, or if an error occurs, the app will be
237 **      notified with NFA_READ_CPLT_EVT.
238 **
239 ** Returns:
240 **      NFA_STATUS_OK if successfully initiated
241 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
242 **      NFA_STATUS_FAILED otherwise
243 **
244 *******************************************************************************/
245 extern tNFA_STATUS NFA_RwT1tRid(void);
246 
247 /*******************************************************************************
248 **
249 ** Function         NFA_RwT1tReadAll
250 **
251 ** Description:
252 **      Send a RALL command to the activated Type 1 tag.
253 **
254 **      Data is returned to the application using the NFA_DATA_EVT. When the
255 **      read operation has completed, or if an error occurs, the app will be
256 **      notified with NFA_READ_CPLT_EVT.
257 **
258 ** Returns:
259 **      NFA_STATUS_OK if successfully initiated
260 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
261 **      NFA_STATUS_FAILED otherwise
262 **
263 *******************************************************************************/
264 extern tNFA_STATUS NFA_RwT1tReadAll(void);
265 
266 /*******************************************************************************
267 **
268 ** Function         NFA_RwT1tRead
269 **
270 ** Description:
271 **      Send a READ command to the activated Type 1 tag.
272 **
273 **      Data is returned to the application using the NFA_DATA_EVT. When the
274 **      read operation has completed, or if an error occurs, the app will be
275 **      notified with NFA_READ_CPLT_EVT.
276 **
277 ** Returns:
278 **      NFA_STATUS_OK if successfully initiated
279 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
280 **      NFA_STATUS_FAILED otherwise
281 **
282 *******************************************************************************/
283 extern tNFA_STATUS NFA_RwT1tRead(uint8_t block_number, uint8_t index);
284 
285 /*******************************************************************************
286 **
287 ** Function         NFA_RwT1tWrite
288 **
289 ** Description:
290 **      Send a WRITE command to the activated Type 1 tag.
291 **
292 **      Data is returned to the application using the NFA_DATA_EVT. When the
293 **      write operation has completed, or if an error occurs, the app will be
294 **      notified with NFA_WRITE_CPLT_EVT.
295 **
296 ** Returns:
297 **      NFA_STATUS_OK if successfully initiated
298 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
299 **      NFA_STATUS_FAILED otherwise
300 **
301 *******************************************************************************/
302 extern tNFA_STATUS NFA_RwT1tWrite(uint8_t block_number, uint8_t index,
303                                   uint8_t data, bool b_erase);
304 
305 /*******************************************************************************
306 **
307 ** Function         NFA_RwT1tReadSeg
308 **
309 ** Description:
310 **      Send a RSEG command to the activated Type 1 tag.
311 **
312 **      Data is returned to the application using the NFA_DATA_EVT. When the
313 **      read operation has completed, or if an error occurs, the app will be
314 **      notified with NFA_READ_CPLT_EVT.
315 **
316 ** Returns:
317 **      NFA_STATUS_OK if successfully initiated
318 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
319 **      NFA_STATUS_FAILED otherwise
320 **
321 *******************************************************************************/
322 extern tNFA_STATUS NFA_RwT1tReadSeg(uint8_t segment_number);
323 
324 /*******************************************************************************
325 **
326 ** Function         NFA_RwT1tRead8
327 **
328 ** Description:
329 **      Send a READ8 command to the activated Type 1 tag.
330 **
331 **      Data is returned to the application using the NFA_DATA_EVT. When the
332 **      read operation has completed, or if an error occurs, the app will be
333 **      notified with NFA_READ_CPLT_EVT.
334 **
335 ** Returns:
336 **      NFA_STATUS_OK if successfully initiated
337 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
338 **      NFA_STATUS_FAILED otherwise
339 **
340 *******************************************************************************/
341 extern tNFA_STATUS NFA_RwT1tRead8(uint8_t block_number);
342 
343 /*******************************************************************************
344 **
345 ** Function         NFA_RwT1tWrite8
346 **
347 ** Description:
348 **      Send a WRITE8_E / WRITE8_NE command to the activated Type 1 tag.
349 **
350 **      Data is returned to the application using the NFA_DATA_EVT. When the
351 **      read operation has completed, or if an error occurs, the app will be
352 **      notified with NFA_READ_CPLT_EVT.
353 **
354 ** Returns:
355 **      NFA_STATUS_OK if successfully initiated
356 **      NFA_STATUS_NOT_INITIALIZED: type 1 tag not activated
357 **      NFA_STATUS_FAILED otherwise
358 **
359 *******************************************************************************/
360 extern tNFA_STATUS NFA_RwT1tWrite8(uint8_t block_number, uint8_t* p_data,
361                                    bool b_erase);
362 
363 /*******************************************************************************
364 **
365 ** Function         NFA_RwT2tRead
366 **
367 ** Description:
368 **      Send a READ command to the activated Type 2 tag.
369 **
370 **      Data is returned to the application using the NFA_DATA_EVT. When the
371 **      read operation has completed, or if an error occurs, the app will be
372 **      notified with NFA_READ_CPLT_EVT.
373 **
374 ** Returns:
375 **      NFA_STATUS_OK if successfully initiated
376 **      NFA_STATUS_NOT_INITIALIZED: type 2 tag not activated
377 **      NFA_STATUS_FAILED otherwise
378 **
379 *******************************************************************************/
380 extern tNFA_STATUS NFA_RwT2tRead(uint8_t block_number);
381 
382 /*******************************************************************************
383 **
384 ** Function         NFA_RwT2tWrite
385 **
386 ** Description:
387 **      Send an WRITE command to the activated Type 2 tag.
388 **
389 **      When the write operation has completed (or if an error occurs), the
390 **      app will be notified with NFA_WRITE_CPLT_EVT.
391 **
392 ** Returns:
393 **      NFA_STATUS_OK if successfully initiated
394 **      NFA_STATUS_NOT_INITIALIZED: type 2 tag not activated
395 **      NFA_STATUS_FAILED otherwise
396 **
397 *******************************************************************************/
398 extern tNFA_STATUS NFA_RwT2tWrite(uint8_t block_number, uint8_t* p_data);
399 
400 /*******************************************************************************
401 **
402 ** Function         NFA_RwT2tSectorSelect
403 **
404 ** Description:
405 **      Send SECTOR SELECT command to the activated Type 2 tag.
406 **
407 **      When the sector select operation has completed (or if an error occurs),
408 **      the app will be notified with NFA_SECTOR_SELECT_CPLT_EVT.
409 **
410 ** Returns:
411 **      NFA_STATUS_OK if successfully initiated
412 **      NFA_STATUS_NOT_INITIALIZED: type 2 tag not activated
413 **      NFA_STATUS_FAILED otherwise
414 **
415 *******************************************************************************/
416 extern tNFA_STATUS NFA_RwT2tSectorSelect(uint8_t sector_number);
417 
418 /*******************************************************************************
419 **
420 ** Function         NFA_RwT3tRead
421 **
422 ** Description:
423 **      Send a CHECK (read) command to the activated Type 3 tag.
424 **
425 **      Data is returned to the application using the NFA_RW_DATA_EVT. When the
426 **      read operation has completed, or if an error occurs, the app will be
427 **      notified with NFA_READ_CPLT_EVT.
428 **
429 ** Returns:
430 **      NFA_STATUS_OK if successfully initiated
431 **      NFA_STATUS_NOT_INITIALIZED: type 3 tag not activated
432 **      NFA_STATUS_FAILED otherwise
433 **
434 *******************************************************************************/
435 extern tNFA_STATUS NFA_RwT3tRead(uint8_t num_blocks,
436                                  tNFA_T3T_BLOCK_DESC* t3t_blocks);
437 
438 /*******************************************************************************
439 **
440 ** Function         NFA_RwT3tWrite
441 **
442 ** Description:
443 **      Send an UPDATE (write) command to the activated Type 3 tag.
444 **
445 **      When the write operation has completed (or if an error occurs), the
446 **      app will be notified with NFA_WRITE_CPLT_EVT.
447 **
448 ** Returns:
449 **      NFA_STATUS_OK if successfully initiated
450 **      NFA_STATUS_NOT_INITIALIZED: type 3 tag not activated
451 **      NFA_STATUS_FAILED otherwise
452 **
453 *******************************************************************************/
454 extern tNFA_STATUS NFA_RwT3tWrite(uint8_t num_blocks,
455                                   tNFA_T3T_BLOCK_DESC* t3t_blocks,
456                                   uint8_t* p_data);
457 
458 /*******************************************************************************
459 **
460 ** Function         NFA_RwI93Inventory
461 **
462 ** Description:
463 **      Send Inventory command to the activated ISO 15693 tag with/without AFI..
464 **      If UID is provided then set UID[0]:MSB, ... UID[7]:LSB
465 **
466 **      When the write operation has completed (or if an error occurs), the
467 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
468 **
469 ** Returns:
470 **      NFA_STATUS_OK if successfully initiated
471 **      NFA_STATUS_NOT_INITIALIZED: ISO 15693 tag not activated
472 **      NFA_STATUS_FAILED otherwise
473 **
474 *******************************************************************************/
475 extern tNFA_STATUS NFA_RwI93Inventory(bool afi_present, uint8_t afi,
476                                       uint8_t* p_uid);
477 
478 /*******************************************************************************
479 **
480 ** Function         NFA_RwI93StayQuiet
481 **
482 ** Description:
483 **      Send Stay Quiet command to the activated ISO 15693 tag.
484 **
485 **      When the operation has completed (or if an error occurs), the
486 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
487 **
488 ** Returns:
489 **      NFA_STATUS_OK if successfully initiated
490 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
491 **      NFA_STATUS_FAILED otherwise
492 **
493 *******************************************************************************/
494 extern tNFA_STATUS NFA_RwI93StayQuiet(void);
495 
496 /*******************************************************************************
497 **
498 ** Function         NFA_RwI93ReadSingleBlock
499 **
500 ** Description:
501 **      Send Read Single Block command to the activated ISO 15693 tag.
502 **
503 **      Data is returned to the application using the NFA_DATA_EVT. When the
504 **      read operation has completed, or if an error occurs, the app will be
505 **      notified with NFA_I93_CMD_CPLT_EVT.
506 **
507 ** Returns:
508 **      NFA_STATUS_OK if successfully initiated
509 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
510 **      NFA_STATUS_FAILED otherwise
511 **
512 *******************************************************************************/
513 extern tNFA_STATUS NFA_RwI93ReadSingleBlock(uint8_t block_number);
514 
515 /*******************************************************************************
516 **
517 ** Function         NFA_RwI93WriteSingleBlock
518 **
519 ** Description:
520 **      Send Write Single Block command to the activated ISO 15693 tag.
521 **
522 **      When the write operation has completed (or if an error occurs), the
523 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
524 **
525 ** Returns:
526 **      NFA_STATUS_OK if successfully initiated
527 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
528 **      NFA_STATUS_FAILED otherwise
529 **
530 *******************************************************************************/
531 extern tNFA_STATUS NFA_RwI93WriteSingleBlock(uint8_t block_number,
532                                              uint8_t* p_data);
533 
534 /*******************************************************************************
535 **
536 ** Function         NFA_RwI93LockBlock
537 **
538 ** Description:
539 **      Send Lock block command to the activated ISO 15693 tag.
540 **
541 **      When the operation has completed (or if an error occurs), the
542 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
543 **
544 ** Returns:
545 **      NFA_STATUS_OK if successfully initiated
546 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
547 **      NFA_STATUS_FAILED otherwise
548 **
549 *******************************************************************************/
550 extern tNFA_STATUS NFA_RwI93LockBlock(uint8_t block_number);
551 
552 /*******************************************************************************
553 **
554 ** Function         NFA_RwI93ReadMultipleBlocks
555 **
556 ** Description:
557 **      Send Read Multiple Block command to the activated ISO 15693 tag.
558 **
559 **      Data is returned to the application using the NFA_DATA_EVT. When the
560 **      read operation has completed, or if an error occurs, the app will be
561 **      notified with NFA_I93_CMD_CPLT_EVT.
562 **
563 ** Returns:
564 **      NFA_STATUS_OK if successfully initiated
565 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
566 **      NFA_STATUS_FAILED otherwise
567 **
568 *******************************************************************************/
569 extern tNFA_STATUS NFA_RwI93ReadMultipleBlocks(uint8_t first_block_number,
570                                                uint16_t number_blocks);
571 
572 /*******************************************************************************
573 **
574 ** Function         NFA_RwI93WriteMultipleBlocks
575 **
576 ** Description:
577 **      Send Write Multiple Block command to the activated ISO 15693 tag.
578 **
579 **      When the write operation has completed (or if an error occurs), the
580 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
581 **
582 ** Returns:
583 **      NFA_STATUS_OK if successfully initiated
584 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
585 **      NFA_STATUS_FAILED otherwise
586 **
587 *******************************************************************************/
588 extern tNFA_STATUS NFA_RwI93WriteMultipleBlocks(uint8_t first_block_number,
589                                                 uint16_t number_blocks,
590                                                 uint8_t* p_data);
591 
592 /*******************************************************************************
593 **
594 ** Function         NFA_RwI93Select
595 **
596 ** Description:
597 **      Send Select command to the activated ISO 15693 tag.
598 **
599 **      UID[0]: 0xE0, MSB
600 **      UID[1]: IC Mfg Code
601 **      ...
602 **      UID[7]: LSB
603 **
604 **      When the operation has completed (or if an error occurs), the
605 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
606 **
607 ** Returns:
608 **      NFA_STATUS_OK if successfully initiated
609 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
610 **      NFA_STATUS_FAILED otherwise
611 **
612 *******************************************************************************/
613 extern tNFA_STATUS NFA_RwI93Select(uint8_t* p_uid);
614 
615 /*******************************************************************************
616 **
617 ** Function         NFA_RwI93ResetToReady
618 **
619 ** Description:
620 **      Send Reset to ready command to the activated ISO 15693 tag.
621 **
622 **      When the operation has completed (or if an error occurs), the
623 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
624 **
625 ** Returns:
626 **      NFA_STATUS_OK if successfully initiated
627 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
628 **      NFA_STATUS_FAILED otherwise
629 **
630 *******************************************************************************/
631 extern tNFA_STATUS NFA_RwI93ResetToReady(void);
632 
633 /*******************************************************************************
634 **
635 ** Function         NFA_RwI93WriteAFI
636 **
637 ** Description:
638 **      Send Write AFI command to the activated ISO 15693 tag.
639 **
640 **      When the operation has completed (or if an error occurs), the
641 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
642 **
643 ** Returns:
644 **      NFA_STATUS_OK if successfully initiated
645 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
646 **      NFA_STATUS_FAILED otherwise
647 **
648 *******************************************************************************/
649 extern tNFA_STATUS NFA_RwI93WriteAFI(uint8_t afi);
650 
651 /*******************************************************************************
652 **
653 ** Function         NFA_RwI93LockAFI
654 **
655 ** Description:
656 **      Send Lock AFI command to the activated ISO 15693 tag.
657 **
658 **      When the operation has completed (or if an error occurs), the
659 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
660 **
661 ** Returns:
662 **      NFA_STATUS_OK if successfully initiated
663 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
664 **      NFA_STATUS_FAILED otherwise
665 **
666 *******************************************************************************/
667 extern tNFA_STATUS NFA_RwI93LockAFI(void);
668 
669 /*******************************************************************************
670 **
671 ** Function         NFA_RwI93WriteDSFID
672 **
673 ** Description:
674 **      Send Write DSFID command to the activated ISO 15693 tag.
675 **
676 **      When the operation has completed (or if an error occurs), the
677 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
678 **
679 ** Returns:
680 **      NFA_STATUS_OK if successfully initiated
681 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
682 **      NFA_STATUS_FAILED otherwise
683 **
684 *******************************************************************************/
685 extern tNFA_STATUS NFA_RwI93WriteDSFID(uint8_t dsfid);
686 
687 /*******************************************************************************
688 **
689 ** Function         NFA_RwI93LockDSFID
690 **
691 ** Description:
692 **      Send Lock DSFID command to the activated ISO 15693 tag.
693 **
694 **      When the operation has completed (or if an error occurs), the
695 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
696 **
697 ** Returns:
698 **      NFA_STATUS_OK if successfully initiated
699 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
700 **      NFA_STATUS_FAILED otherwise
701 **
702 *******************************************************************************/
703 extern tNFA_STATUS NFA_RwI93LockDSFID(void);
704 
705 /*******************************************************************************
706 **
707 ** Function         NFA_RwI93GetSysInfo
708 **
709 ** Description:
710 **      Send Get system information command to the activated ISO 15693 tag.
711 **      If UID is provided then set UID[0]:MSB, ... UID[7]:LSB
712 **
713 **      When the operation has completed (or if an error occurs), the
714 **      app will be notified with NFA_I93_CMD_CPLT_EVT.
715 **
716 ** Returns:
717 **      NFA_STATUS_OK if successfully initiated
718 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
719 **      NFA_STATUS_FAILED otherwise
720 **
721 *******************************************************************************/
722 extern tNFA_STATUS NFA_RwI93GetSysInfo(uint8_t* p_uid);
723 
724 /*******************************************************************************
725 **
726 ** Function         NFA_RwI93GetMultiBlockSecurityStatus
727 **
728 ** Description:
729 **      Send Get Multiple block security status command to the activated ISO
730 **      15693 tag.
731 **
732 **      Data is returned to the application using the NFA_DATA_EVT. When the
733 **      read operation has completed, or if an error occurs, the app will be
734 **      notified with NFA_I93_CMD_CPLT_EVT.
735 **
736 ** Returns:
737 **      NFA_STATUS_OK if successfully initiated
738 **      NFA_STATUS_WRONG_PROTOCOL: ISO 15693 tag not activated
739 **      NFA_STATUS_FAILED otherwise
740 **
741 *******************************************************************************/
742 extern tNFA_STATUS NFA_RwI93GetMultiBlockSecurityStatus(
743     uint8_t first_block_number, uint16_t number_blocks);
744 
745 #endif /* NFA_RW_API_H */
746