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