rw_api.h revision 4182dab9b5de4222ffd4a539fa084cb2b56bc6a1
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
20/******************************************************************************
21 *
22 *  This file contains the Near Field Communication (NFC) Reader/Writer mode
23 *  related API function external definitions.
24 *
25 ******************************************************************************/
26
27#ifndef RW_API_H
28#define RW_API_H
29#include "tags_defs.h"
30
31#define RW_T1T_BLD_ADD(a, k, y)   a = ((k & 0xF) << 3) | (y&0x7);
32#define RW_T1T_BLD_ADDS(a, s)     a = ((s & 0xF) << 4);
33
34#define RW_T1T_FIRST_EVT    0x20
35#define RW_T2T_FIRST_EVT    0x40
36#define RW_T3T_FIRST_EVT    0x60
37#define RW_T4T_FIRST_EVT    0x80
38#define RW_I93_FIRST_EVT    0xA0
39
40enum
41{
42    /* Note: the order of these events can not be changed */
43    /* Type 1 tag events for tRW_CBACK */
44    RW_T1T_RID_EVT = RW_T1T_FIRST_EVT,          /* Read ID command completd              */
45    RW_T1T_RALL_CPLT_EVT,                       /* Read All command completed            */
46    RW_T1T_READ_CPLT_EVT,                       /* Read byte completed                   */
47    RW_T1T_WRITE_E_CPLT_EVT,                    /* Write byte after erase completed      */
48    RW_T1T_WRITE_NE_CPLT_EVT,                   /* Write byte with no erase completed    */
49    RW_T1T_RSEG_CPLT_EVT,                       /* Read segment completed                */
50    RW_T1T_READ8_CPLT_EVT,                      /* Read block completed                  */
51    RW_T1T_WRITE_E8_CPLT_EVT,                   /* Write block after erase completed     */
52    RW_T1T_WRITE_NE8_CPLT_EVT,                  /* Write block with no erase completed   */
53    RW_T1T_TLV_DETECT_EVT,                      /* Lock/Mem/Prop tlv detection complete  */
54    RW_T1T_NDEF_DETECT_EVT,                     /* NDEF detection complete               */
55    RW_T1T_NDEF_READ_EVT,                       /* NDEF read completed                   */
56    RW_T1T_NDEF_WRITE_EVT,                      /* NDEF write complete                   */
57    RW_T1T_SET_TAG_RO_EVT,                      /* Tag is set as read only               */
58    RW_T1T_RAW_FRAME_EVT,                       /* Response of raw frame sent            */
59    RW_T1T_PRESENCE_CHECK_EVT,                  /* Response to RW_T1tPresenceCheck       */
60    RW_T1T_FORMAT_CPLT_EVT,                     /* Tag Formated                          */
61    RW_T1T_INTF_ERROR_EVT,                      /* RF Interface error event              */
62    RW_T1T_MAX_EVT,
63
64    /* Type 2 tag events */
65    RW_T2T_READ_CPLT_EVT = RW_T2T_FIRST_EVT,    /* Read completed                        */
66    RW_T2T_WRITE_CPLT_EVT,                      /* Write completed                       */
67    RW_T2T_SELECT_CPLT_EVT,                     /* Sector select completed               */
68    RW_T2T_NDEF_DETECT_EVT,                     /* NDEF detection complete               */
69    RW_T2T_TLV_DETECT_EVT,                      /* Lock/Mem/Prop tlv detection complete  */
70    RW_T2T_NDEF_READ_EVT,                       /* NDEF read completed                   */
71    RW_T2T_NDEF_WRITE_EVT,                      /* NDEF write complete                   */
72    RW_T2T_SET_TAG_RO_EVT,                      /* Tag is set as read only               */
73    RW_T2T_RAW_FRAME_EVT,                       /* Response of raw frame sent            */
74    RW_T2T_PRESENCE_CHECK_EVT,                  /* Response to RW_T2tPresenceCheck       */
75    RW_T2T_FORMAT_CPLT_EVT,                     /* Tag Formated                          */
76    RW_T2T_INTF_ERROR_EVT,                      /* RF Interface error event              */
77    RW_T2T_MAX_EVT,
78
79    /* Type 3 tag events for tRW_CBACK */
80    RW_T3T_CHECK_CPLT_EVT = RW_T3T_FIRST_EVT,   /* Read completed                           */
81    RW_T3T_UPDATE_CPLT_EVT,                     /* Write completed                          */
82    RW_T3T_CHECK_EVT,                           /* Segment of data received from type 3 tag */
83    RW_T3T_RAW_FRAME_EVT,                       /* SendRawFrame response                    */
84    RW_T3T_NDEF_DETECT_EVT,                     /* NDEF detection complete                  */
85    RW_T3T_PRESENCE_CHECK_EVT,                  /* Response to RW_T3tPresenceCheck          */
86    RW_T3T_POLL_EVT,                            /* Response to RW_T3tPoll                   */
87    RW_T3T_GET_SYSTEM_CODES_EVT,                /* Response to RW_T3tGetSystemCodes         */
88    RW_T3T_FORMAT_CPLT_EVT,                     /* Tag Formated (Felica-Lite only)          */
89    RW_T3T_SET_READ_ONLY_CPLT_EVT,              /* Tag is set as Read only                  */
90    RW_T3T_INTF_ERROR_EVT,                      /* RF Interface error event                 */
91    RW_T3T_MAX_EVT,
92
93    /* Type 4 tag events for tRW_CBACK */
94    RW_T4T_NDEF_DETECT_EVT = RW_T4T_FIRST_EVT,  /* Result of NDEF detection procedure       */
95                                                /* Mandatory NDEF file is selected          */
96    RW_T4T_NDEF_READ_EVT,                       /* Segment of data received from type 4 tag */
97    RW_T4T_NDEF_READ_CPLT_EVT,                  /* Read operation completed                 */
98    RW_T4T_NDEF_READ_FAIL_EVT,                  /* Read operation failed                    */
99    RW_T4T_NDEF_UPDATE_CPLT_EVT,                /* Update operation completed               */
100    RW_T4T_NDEF_UPDATE_FAIL_EVT,                /* Update operation failed                  */
101    RW_T4T_SET_TO_RO_EVT,                       /* Tag is set as read only                  */
102    RW_T4T_PRESENCE_CHECK_EVT,                  /* Response to RW_T4tPresenceCheck          */
103    RW_T4T_RAW_FRAME_EVT,                       /* Response of raw frame sent               */
104    RW_T4T_INTF_ERROR_EVT,                      /* RF Interface error event                 */
105    RW_T4T_NDEF_FORMAT_CPLT_EVT,                /* Format operation completed               */
106    RW_T4T_MAX_EVT,
107
108    /* ISO 15693 tag events for tRW_CBACK */
109    RW_I93_NDEF_DETECT_EVT = RW_I93_FIRST_EVT,  /* Result of NDEF detection procedure */
110    RW_I93_NDEF_READ_EVT,                       /* Segment of data received from tag  */
111    RW_I93_NDEF_READ_CPLT_EVT,                  /* Read operation completed           */
112    RW_I93_NDEF_READ_FAIL_EVT,                  /* Read operation failed              */
113    RW_I93_NDEF_UPDATE_CPLT_EVT,                /* Update operation completed         */
114    RW_I93_NDEF_UPDATE_FAIL_EVT,                /* Update operation failed            */
115    RW_I93_FORMAT_CPLT_EVT,                     /* Format procedure complete          */
116    RW_I93_SET_TAG_RO_EVT,                      /* Set read-only procedure complete   */
117    RW_I93_INVENTORY_EVT,                       /* Response of Inventory              */
118    RW_I93_DATA_EVT,                            /* Response of Read, Get Multi Security */
119    RW_I93_SYS_INFO_EVT,                        /* Response of System Information     */
120    RW_I93_CMD_CMPL_EVT,                        /* Command complete                   */
121    RW_I93_PRESENCE_CHECK_EVT,                  /* Response to RW_I93PresenceCheck    */
122    RW_I93_RAW_FRAME_EVT,                       /* Response of raw frame sent         */
123    RW_I93_INTF_ERROR_EVT,                      /* RF Interface error event           */
124    RW_I93_MAX_EVT
125};
126
127#define RW_RAW_FRAME_EVT     0xFF
128
129typedef uint8_t tRW_EVENT;
130
131#define RW_NDEF_FL_READ_ONLY                    0x01    /* Tag is read only              */
132#define RW_NDEF_FL_FORMATED                     0x02    /* Tag formated for NDEF         */
133#define RW_NDEF_FL_SUPPORTED                    0x04    /* NDEF supported by the tag     */
134#define RW_NDEF_FL_UNKNOWN                      0x08    /* Unable to find if tag is ndef capable/formated/read only */
135#define RW_NDEF_FL_FORMATABLE                   0x10    /* Tag supports format operation */
136#define RW_NDEF_FL_SOFT_LOCKABLE                0x20    /* Tag can be soft locked */
137#define RW_NDEF_FL_HARD_LOCKABLE                0x40    /* Tag can be hard locked */
138#define RW_NDEF_FL_OTP                          0x80    /* Tag is one time programmable */
139
140typedef uint8_t tRW_NDEF_FLAG;
141
142/* options for RW_T4tPresenceCheck  */
143#define RW_T4T_CHK_READ_BINARY_CH0      0
144#define RW_T4T_CHK_READ_BINARY_CH1      1
145#define RW_T4T_CHK_READ_BINARY_CH2      2
146#define RW_T4T_CHK_READ_BINARY_CH3      3
147#define RW_T4T_CHK_EMPTY_I_BLOCK        4
148
149typedef struct
150{
151    tNFC_STATUS     status;
152    uint8_t         hr[T1T_HR_LEN];
153    uint8_t         uid[T1T_CMD_UID_LEN];
154} tRW_T1T_RID_EVT;
155
156typedef struct
157{
158    tNFC_STATUS     status;
159    uint16_t        msg_len;            /* Length of the NDEF message */
160} tRW_T2T_DETECT;
161
162typedef struct
163{
164    tNFC_STATUS     status;             /* Status of the POLL request */
165    uint8_t         rc;                 /* RC (request code) used in the POLL request */
166    uint8_t         response_num;       /* Number of SENSF_RES responses */
167    uint8_t         response_bufsize;   /* Size of SENSF_RES responses */
168    uint8_t         *response_buf;      /* Buffer of responses (length + SENSF_RES) see $8.1.2.2 of NCI specs */
169} tRW_T3T_POLL;
170
171typedef struct
172{
173    tNFC_STATUS     status;             /* Status of the Get System Codes request */
174    uint8_t         num_system_codes;   /* Number of system codes */
175    uint16_t        *p_system_codes;    /* Table of system codes */
176} tRW_T3T_SYSTEM_CODES;
177
178typedef struct
179{
180    tNFC_STATUS     status;             /* status of NDEF detection */
181    tNFC_PROTOCOL   protocol;           /* protocol used to detect NDEF */
182    uint32_t        max_size;           /* max number of bytes available for NDEF data */
183    uint32_t        cur_size;           /* current size of stored NDEF data (in bytes) */
184    tRW_NDEF_FLAG   flags;              /* Flags to indicate NDEF capability,formated,formatable and read only */
185} tRW_DETECT_NDEF_DATA;
186
187typedef struct
188{
189    tNFC_STATUS     status;             /* status of NDEF detection */
190    tNFC_PROTOCOL   protocol;           /* protocol used to detect TLV */
191    uint8_t         num_bytes;          /* number of reserved/lock bytes based on the type of tlv */
192} tRW_DETECT_TLV_DATA;
193
194typedef struct
195{
196    tNFC_STATUS     status;
197    NFC_HDR         *p_data;
198} tRW_READ_DATA;
199
200typedef struct
201{
202    tNFC_STATUS     status;
203    uint8_t         sw1;
204    uint8_t         sw2;
205} tRW_T4T_SW;
206
207typedef struct                              /* RW_I93_INVENTORY_EVT        */
208{
209    tNFC_STATUS     status;                 /* status of Inventory command */
210    uint8_t         dsfid;                  /* DSFID                       */
211    uint8_t         uid[I93_UID_BYTE_LEN];  /* UID[0]:MSB, ... UID[7]:LSB  */
212} tRW_I93_INVENTORY;
213
214typedef struct                              /* RW_I93_DATA_EVT               */
215{
216    tNFC_STATUS     status;                 /* status of Read/Get security status command */
217    uint8_t         command;                /* sent command                  */
218    NFC_HDR         *p_data;                 /* block data of security status */
219} tRW_I93_DATA;
220
221typedef struct                              /* RW_I93_SYS_INFO_EVT             */
222{
223    tNFC_STATUS     status;                 /* status of Get Sys Info command  */
224    uint8_t         info_flags;             /* information flags               */
225    uint8_t         uid[I93_UID_BYTE_LEN];  /* UID[0]:MSB, ... UID[7]:LSB      */
226    uint8_t         dsfid;                  /* DSFID if I93_INFO_FLAG_DSFID    */
227    uint8_t         afi;                    /* AFI if I93_INFO_FLAG_AFI        */
228    uint16_t        num_block;              /* number of blocks if I93_INFO_FLAG_MEM_SIZE   */
229    uint8_t         block_size;             /* block size in byte if I93_INFO_FLAG_MEM_SIZE */
230    uint8_t         IC_reference;           /* IC Reference if I93_INFO_FLAG_IC_REF         */
231} tRW_I93_SYS_INFO;
232
233typedef struct                              /* RW_I93_CMD_CMPL_EVT             */
234{
235    tNFC_STATUS     status;                 /* status of sent command          */
236    uint8_t         command;                /* sent command                    */
237    uint8_t         error_code;             /* error code; I93_ERROR_CODE_XXX  */
238} tRW_I93_CMD_CMPL;
239
240typedef struct
241{
242    tNFC_STATUS     status;
243    NFC_HDR         *p_data;
244} tRW_RAW_FRAME;
245
246typedef union
247{
248    tNFC_STATUS             status;
249    tRW_T3T_POLL            t3t_poll;   /* Response to t3t poll command          */
250    tRW_T3T_SYSTEM_CODES    t3t_sc;     /* Received system codes from t3 tag     */
251    tRW_DETECT_TLV_DATA     tlv;        /* The information of detected TLV data  */
252    tRW_DETECT_NDEF_DATA    ndef;       /* The information of detected NDEF data */
253    tRW_READ_DATA           data;       /* The received data from a tag          */
254    tRW_RAW_FRAME           raw_frame;  /* Response of raw frame sent            */
255    tRW_T4T_SW              t4t_sw;     /* Received status words from a tag      */
256    tRW_I93_INVENTORY       i93_inventory;  /* ISO 15693 Inventory response      */
257    tRW_I93_DATA            i93_data;       /* ISO 15693 Data response           */
258    tRW_I93_SYS_INFO        i93_sys_info;   /* ISO 15693 System Information      */
259    tRW_I93_CMD_CMPL        i93_cmd_cmpl;   /* ISO 15693 Command complete        */
260} tRW_DATA;
261
262
263typedef void (tRW_CBACK) (tRW_EVENT event, tRW_DATA *p_data);
264
265/*******************************************************************************
266**
267** Function         RW_T1tRid
268**
269** Description      This function send a RID command for Reader/Writer mode.
270**
271** Returns          tNFC_STATUS
272**
273*******************************************************************************/
274extern tNFC_STATUS RW_T1tRid (void);
275
276/*******************************************************************************
277**
278** Function         RW_T1tReadAll
279**
280** Description      This function send a RALL command for Reader/Writer mode.
281**
282** Returns          tNFC_STATUS
283**
284*******************************************************************************/
285extern tNFC_STATUS RW_T1tReadAll (void);
286
287/*******************************************************************************
288**
289** Function         RW_T1tRead
290**
291** Description      This function send a READ command for Reader/Writer mode.
292**
293** Returns          tNFC_STATUS
294**
295*******************************************************************************/
296extern tNFC_STATUS RW_T1tRead (uint8_t block, uint8_t byte);
297
298/*******************************************************************************
299**
300** Function         RW_T1tWriteErase
301**
302** Description      This function send a WRITE-E command for Reader/Writer mode.
303**
304** Returns          tNFC_STATUS
305**
306*******************************************************************************/
307extern tNFC_STATUS RW_T1tWriteErase (uint8_t block, uint8_t byte, uint8_t new_byte);
308
309/*******************************************************************************
310**
311** Function         RW_T1tWriteNoErase
312**
313** Description      This function send a WRITE-NE command for Reader/Writer mode.
314**
315** Returns          tNFC_STATUS
316**
317*******************************************************************************/
318extern tNFC_STATUS RW_T1tWriteNoErase (uint8_t block, uint8_t byte, uint8_t new_byte);
319
320/*******************************************************************************
321**
322** Function         RW_T1tReadSeg
323**
324** Description      This function send a RSEG command for Reader/Writer mode.
325**
326** Returns          tNFC_STATUS
327**
328*******************************************************************************/
329extern tNFC_STATUS RW_T1tReadSeg (uint8_t segment);
330
331/*******************************************************************************
332**
333** Function         RW_T1tRead8
334**
335** Description      This function send a READ8 command for Reader/Writer mode.
336**
337** Returns          tNFC_STATUS
338**
339*******************************************************************************/
340extern tNFC_STATUS RW_T1tRead8 (uint8_t block);
341
342/*******************************************************************************
343**
344** Function         RW_T1tWriteErase8
345**
346** Description      This function send a WRITE-E8 command for Reader/Writer mode.
347**
348** Returns          tNFC_STATUS
349**
350*******************************************************************************/
351extern tNFC_STATUS RW_T1tWriteErase8 (uint8_t block, uint8_t *p_new_dat);
352
353/*******************************************************************************
354**
355** Function         RW_T1tWriteNoErase8
356**
357** Description      This function send a WRITE-NE8 command for Reader/Writer mode.
358**
359** Returns          tNFC_STATUS
360**
361*******************************************************************************/
362extern tNFC_STATUS RW_T1tWriteNoErase8 (uint8_t block, uint8_t *p_new_dat);
363
364/*******************************************************************************
365**
366** Function         RW_T1tLocateTlv
367**
368** Description      This function is called to find the start of the given TLV
369**
370** Parameters:      void
371**
372** Returns          NCI_STATUS_OK, if detection was started. Otherwise, error status.
373**
374*******************************************************************************/
375extern tNFC_STATUS RW_T1tLocateTlv (uint8_t tlv_type);
376
377/*******************************************************************************
378**
379** Function         RW_T1tDetectNDef
380**
381** Description      This function can be called to detect if there is an NDEF
382**                  message on the tag.
383**
384** Parameters:      void
385**
386** Returns          NCI_STATUS_OK, if detection was started. Otherwise, error status.
387**
388*******************************************************************************/
389extern tNFC_STATUS RW_T1tDetectNDef (void);
390
391/*******************************************************************************
392**
393** Function         RW_T1tReadNDef
394**
395** Description      This function can be called to read the NDEF message on the tag.
396**
397** Parameters:      p_buffer:   The buffer into which to read the NDEF message
398**                  buf_len:    The length of the buffer
399**
400** Returns          NCI_STATUS_OK, if read was started. Otherwise, error status.
401**
402*******************************************************************************/
403extern tNFC_STATUS RW_T1tReadNDef (uint8_t *p_buffer, uint16_t buf_len);
404
405/*******************************************************************************
406**
407** Function         RW_T1tWriteNDef
408**
409** Description      This function can be called to write an NDEF message to the tag.
410**
411** Parameters:      msg_len:    The length of the buffer
412**                  p_msg:      The NDEF message to write
413**
414** Returns          NCI_STATUS_OK, if write was started. Otherwise, error status.
415**
416*******************************************************************************/
417extern tNFC_STATUS RW_T1tWriteNDef (uint16_t msg_len, uint8_t *p_msg);
418
419/*******************************************************************************
420**
421** Function         RW_T1tSetTagReadOnly
422**
423** Description      This function can be called to set the tag in to read only
424**                  state
425**
426** Parameters:      b_hard_lock: To hard lock or just soft lock the tag
427**
428** Returns          NCI_STATUS_OK, if set readonly operation started.
429**                                 Otherwise, error status.
430**
431*******************************************************************************/
432extern tNFC_STATUS RW_T1tSetTagReadOnly (bool    b_hard_lock);
433
434/*****************************************************************************
435**
436** Function         RW_T1tPresenceCheck
437**
438** Description
439**      Check if the tag is still in the field.
440**
441**      The RW_T1T_PRESENCE_CHECK_EVT w/ status is used to indicate presence
442**      or non-presence.
443**
444** Returns
445**      NFC_STATUS_OK, if raw data frame sent
446**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
447**      NFC_STATUS_FAILED: other error
448**
449*****************************************************************************/
450extern tNFC_STATUS RW_T1tPresenceCheck (void);
451
452/*****************************************************************************
453**
454** Function         RW_T1tFormatNDef
455**
456** Description
457**      Format Tag content
458**
459** Returns
460**      NFC_STATUS_OK, Command sent to format Tag
461**      NFC_STATUS_REJECTED: Invalid HR0 and cannot format the tag
462**      NFC_STATUS_FAILED: other error
463**
464*****************************************************************************/
465tNFC_STATUS RW_T1tFormatNDef (void);
466
467/*******************************************************************************
468**
469** Function         RW_T2tLocateTlv
470**
471** Description      This function is called to find the start of the given TLV
472**
473** Returns          Pointer to the TLV, if successful. Otherwise, NULL.
474**
475*******************************************************************************/
476extern tNFC_STATUS RW_T2tLocateTlv(uint8_t tlv_type);
477
478/*******************************************************************************
479**
480** Function         RW_T2tRead
481**
482** Description      This function issues the Type 2 Tag READ command. When the
483**                  operation is complete the callback function will be called
484**                  with a RW_T2T_READ_EVT.
485**
486** Returns          tNFC_STATUS
487**
488*******************************************************************************/
489extern tNFC_STATUS RW_T2tRead (uint16_t block);
490
491/*******************************************************************************
492**
493** Function         RW_T2tWrite
494**
495** Description      This function issues the Type 2 Tag WRITE command. When the
496**                  operation is complete the callback function will be called
497**                  with a RW_T2T_WRITE_EVT.
498**
499**                  p_write_data points to the array of 4 bytes to be written
500**
501** Returns          tNFC_STATUS
502**
503*******************************************************************************/
504extern tNFC_STATUS RW_T2tWrite (uint16_t block, uint8_t *p_write_data);
505
506/*******************************************************************************
507**
508** Function         RW_T2tSectorSelect
509**
510** Description      This function issues the Type 2 Tag SECTOR-SELECT command
511**                  packet 1. If a NACK is received as the response, the callback
512**                  function will be called with a RW_T2T_SECTOR_SELECT_EVT. If
513**                  an ACK is received as the response, the command packet 2 with
514**                  the given sector number is sent to the peer device. When the
515**                  response for packet 2 is received, the callback function will
516**                  be called with a RW_T2T_SECTOR_SELECT_EVT.
517**
518**                  A sector is 256 contiguous blocks (1024 bytes).
519**
520** Returns          tNFC_STATUS
521**
522*******************************************************************************/
523extern tNFC_STATUS RW_T2tSectorSelect (uint8_t sector);
524
525/*******************************************************************************
526**
527** Function         RW_T2tDetectNDef
528**
529** Description      This function will find NDEF message if any in the Tag
530**
531** Returns          tNFC_STATUS
532**
533*******************************************************************************/
534extern tNFC_STATUS RW_T2tDetectNDef (bool    skip_dyn_locks);
535
536/*******************************************************************************
537**
538** Function         RW_T2tReadNDef
539**
540** Description      This function can be called to read the NDEF message on the tag.
541**
542** Parameters:      p_buffer:   The buffer into which to read the NDEF message
543**                  buf_len:    The length of the buffer
544**
545** Returns          NCI_STATUS_OK, if read was started. Otherwise, error status.
546**
547*******************************************************************************/
548extern tNFC_STATUS RW_T2tReadNDef (uint8_t *p_buffer, uint16_t buf_len);
549
550/*******************************************************************************
551**
552** Function         RW_T2tWriteNDef
553**
554** Description      This function can be called to write an NDEF message to the tag.
555**
556** Parameters:      msg_len:    The length of the buffer
557**                  p_msg:      The NDEF message to write
558**
559** Returns          NCI_STATUS_OK, if write was started. Otherwise, error status.
560**
561*******************************************************************************/
562extern tNFC_STATUS RW_T2tWriteNDef (uint16_t msg_len, uint8_t *p_msg );
563
564/*******************************************************************************
565**
566** Function         RW_T2tSetTagReadOnly
567**
568** Description      This function can be called to set the tag in to read only
569**                  state
570**
571** Parameters:      b_hard_lock:   To indicate hard lock the tag or not
572**
573** Returns          NCI_STATUS_OK, if set readonly operation started.
574**                                 Otherwise, error status.
575**
576*******************************************************************************/
577extern tNFC_STATUS RW_T2tSetTagReadOnly (bool    b_hard_lock);
578
579/*****************************************************************************
580**
581** Function         RW_T2tPresenceCheck
582**
583** Description
584**      Check if the tag is still in the field.
585**
586**      The RW_T2T_PRESENCE_CHECK_EVT w/ status is used to indicate presence
587**      or non-presence.
588**
589** Returns
590**      NFC_STATUS_OK, if raw data frame sent
591**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
592**      NFC_STATUS_FAILED: other error
593**
594*****************************************************************************/
595extern tNFC_STATUS RW_T2tPresenceCheck (void);
596
597/*****************************************************************************
598**
599** Function         RW_T2tFormatNDef
600**
601** Description
602**      Format Tag content
603**
604** Returns
605**      NFC_STATUS_OK, Command sent to format Tag
606**      NFC_STATUS_FAILED: otherwise
607**
608*****************************************************************************/
609tNFC_STATUS RW_T2tFormatNDef (void);
610
611/*****************************************************************************
612**
613** Function         RW_T3tDetectNDef
614**
615** Description
616**      This function is used to perform NDEF detection on a Type 3 tag, and
617**      retrieve the tag's NDEF attribute information (block 0).
618**
619**      Before using this API, the application must call RW_SelectTagType to
620**      indicate that a Type 3 tag has been activated, and to provide the
621**      tag's Manufacture ID (IDm) .
622**
623** Returns
624**      NFC_STATUS_OK: ndef detection procedure started
625**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
626**      NFC_STATUS_FAILED: other error
627**
628*****************************************************************************/
629extern tNFC_STATUS RW_T3tDetectNDef (void);
630
631/*****************************************************************************
632**
633** Function         RW_T3tFormatNDef
634**
635** Description
636**      Format a type-3 tag for NDEF.
637**
638**      Only Felica-Lite tags are supported by this API. The
639**      RW_T3T_FORMAT_CPLT_EVT is used to notify the status of the operation.
640**
641** Returns
642**      NFC_STATUS_OK: ndef detection procedure started
643**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
644**      NFC_STATUS_FAILED: other error
645**
646*****************************************************************************/
647extern tNFC_STATUS RW_T3tFormatNDef (void);
648
649/*****************************************************************************
650**
651** Function         RW_T3tSetReadOnly
652**
653** Description
654**      Set a type-3 tag to Read Only
655**
656**      Only Felica-Lite tags are supported by this API.
657**      RW_T3tDetectNDef() must be called before using this
658**      The RW_T3T_SET_READ_ONLY_CPLT_EVT event will be returned.
659**
660** Returns
661**      NFC_STATUS_OK if success
662**      NFC_STATUS_FAILED if T3T is busy or other error
663**
664*****************************************************************************/
665extern tNFC_STATUS RW_T3tSetReadOnly (bool    b_hard_lock);
666
667/*****************************************************************************
668**
669** Function         RW_T3tCheckNDef
670**
671** Description
672**      Retrieve NDEF contents from a Type3 tag.
673**
674**      The RW_T3T_CHECK_EVT event is used to notify the application for each
675**      segment of NDEF data received. The RW_T3T_CHECK_CPLT_EVT event is used to
676**      notify the application all segments have been received.
677**
678**      Before using this API, the RW_T3tDetectNDef function must be called to
679**      verify that the tag contains NDEF data, and to retrieve the NDEF
680**      attributes.
681**
682**      Internally, this command will be separated into multiple Tag 3 Check
683**      commands (if necessary) - depending on the tag's Nbr (max number of
684**      blocks per read) attribute.
685**
686** Returns
687**      NFC_STATUS_OK: check command started
688**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
689**      NFC_STATUS_FAILED: other error
690**
691*****************************************************************************/
692extern tNFC_STATUS RW_T3tCheckNDef (void);
693
694/*****************************************************************************
695**
696** Function         RW_T3tUpdateNDef
697**
698** Description
699**      Write NDEF contents to a Type3 tag.
700**
701**      The RW_T3T_UPDATE_CPLT_EVT callback event will be used to notify the
702**      application of the response.
703**
704**      Before using this API, the RW_T3tDetectNDef function must be called to
705**      verify that the tag contains NDEF data, and to retrieve the NDEF
706**      attributes.
707**
708**      Internally, this command will be separated into multiple Tag 3 Update
709**      commands (if necessary) - depending on the tag's Nbw (max number of
710**      blocks per write) attribute.
711**
712** Returns
713**      NFC_STATUS_OK: check command started
714**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
715**      NFC_STATUS_REFUSED: tag is read-only
716**      NFC_STATUS_BUFFER_FULL: len exceeds tag's maximum size
717**      NFC_STATUS_FAILED: other error
718**
719*****************************************************************************/
720extern tNFC_STATUS RW_T3tUpdateNDef (uint32_t len, uint8_t *p_data);
721
722/*****************************************************************************
723**
724** Function         RW_T3tCheck
725**
726** Description
727**      Read (non-NDEF) contents from a Type3 tag.
728**
729**      The RW_READ_EVT event is used to notify the application for each
730**      segment of NDEF data received. The RW_READ_CPLT_EVT event is used to
731**      notify the application all segments have been received.
732**
733**      Before using this API, the application must call RW_SelectTagType to
734**      indicate that a Type 3 tag has been activated, and to provide the
735**      tag's Manufacture ID (IDm) .
736**
737** Returns
738**      NFC_STATUS_OK: check command started
739**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
740**      NFC_STATUS_FAILED: other error
741**
742*****************************************************************************/
743extern tNFC_STATUS RW_T3tCheck (uint8_t num_blocks, tT3T_BLOCK_DESC *t3t_blocks);
744
745/*****************************************************************************
746**
747** Function         RW_T3tUpdate
748**
749** Description
750**      Write (non-NDEF) contents to a Type3 tag.
751**
752**      The RW_WRITE_CPLT_EVT event is used to notify the application all
753**      segments have been received.
754**
755**      Before using this API, the application must call RW_SelectTagType to
756**      indicate that a Type 3 tag has been activated, and to provide the tag's
757**      Manufacture ID (IDm) .
758**
759** Returns
760**      NFC_STATUS_OK: check command started
761**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
762**      NFC_STATUS_FAILED: other error
763**
764*****************************************************************************/
765extern tNFC_STATUS RW_T3tUpdate (uint8_t num_blocks, tT3T_BLOCK_DESC *t3t_blocks, uint8_t *p_data);
766
767/*****************************************************************************
768**
769** Function         RW_T3tSendRawFrame
770**
771** Description
772**      This function is called to send a raw data frame to the peer device.
773**      When type 3 tag receives response from peer, the callback function
774**      will be called with a RW_T3T_RAW_FRAME_EVT [Table 6].
775**
776**      Before using this API, the application must call RW_SelectTagType to
777**      indicate that a Type 3 tag has been activated.
778**
779**      The raw frame should be a properly formatted Type 3 tag message.
780**
781** Returns
782**      NFC_STATUS_OK, if raw data frame sent
783**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
784**      NFC_STATUS_FAILED: other error
785**
786*****************************************************************************/
787extern tNFC_STATUS RW_T3tSendRawFrame (uint16_t len, uint8_t *p_data);
788
789/*****************************************************************************
790**
791** Function         RW_T3tPoll
792**
793** Description
794**      Send POLL command
795**
796** Returns
797**      NFC_STATUS_OK, if raw data frame sent
798**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
799**      NFC_STATUS_FAILED: other error
800**
801*****************************************************************************/
802extern tNFC_STATUS RW_T3tPoll (uint16_t system_code, tT3T_POLL_RC rc, uint8_t tsn);
803
804/*****************************************************************************
805**
806** Function         RW_T3tPresenceCheck
807**
808** Description
809**      Check if the tag is still in the field.
810**
811**      The RW_T3T_PRESENCE_CHECK_EVT w/ status is used to indicate presence
812**      or non-presence.
813**
814** Returns
815**      NFC_STATUS_OK, if raw data frame sent
816**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
817**      NFC_STATUS_FAILED: other error
818**
819*****************************************************************************/
820extern tNFC_STATUS RW_T3tPresenceCheck (void);
821
822/*****************************************************************************
823**
824** Function         RW_T3tGetSystemCodes
825**
826** Description
827**      Get systems codes supported by the activated tag:
828**              Poll for wildcard (FFFF):
829**                  - If felica-lite code then poll for ndef (12fc)
830**                  - Otherwise send RequestSystmCode command to get
831**                    system codes.
832**
833**      Before using this API, the application must call RW_SelectTagType to
834**      indicate that a Type 3 tag has been activated.
835**
836** Returns
837**      NFC_STATUS_OK, if raw data frame sent
838**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
839**      NFC_STATUS_FAILED: other error
840**
841*****************************************************************************/
842extern tNFC_STATUS RW_T3tGetSystemCodes (void);
843
844/*****************************************************************************
845**
846** Function         RW_T4tFormatNDef
847**
848** Description
849**      Format a type-4 tag for NDEF.
850**
851**      Only Desifire tags are supported by this API. The
852**      RW_T4T_FORMAT_CPLT_EVT is used to notify the status of the operation.
853**
854** Returns
855**      NFC_STATUS_OK: if success
856**      NFC_STATUS_FAILED: other error
857*****************************************************************************/
858extern tNFC_STATUS RW_T4tFormatNDef (void);
859
860/*******************************************************************************
861**
862** Function         RW_T4tDetectNDef
863**
864** Description      This function performs NDEF detection procedure
865**
866**                  RW_T4T_NDEF_DETECT_EVT will be returned
867**
868** Returns          NFC_STATUS_OK if success
869**                  NFC_STATUS_FAILED if T4T is busy or other error
870**
871*******************************************************************************/
872extern tNFC_STATUS RW_T4tDetectNDef (void);
873
874/*******************************************************************************
875**
876** Function         RW_T4tReadNDef
877**
878** Description      This function performs NDEF read procedure
879**                  Note: RW_T4tDetectNDef() must be called before using this
880**
881**                  The following event will be returned
882**                      RW_T4T_NDEF_READ_EVT for each segmented NDEF message
883**                      RW_T4T_NDEF_READ_CPLT_EVT for the last segment or complete NDEF
884**                      RW_T4T_NDEF_READ_FAIL_EVT for failure
885**
886** Returns          NFC_STATUS_OK if success
887**                  NFC_STATUS_FAILED if T4T is busy or other error
888**
889*******************************************************************************/
890extern tNFC_STATUS RW_T4tReadNDef (void);
891
892/*******************************************************************************
893**
894** Function         RW_T4tUpdateNDef
895**
896** Description      This function performs NDEF update procedure
897**                  Note: RW_T4tDetectNDef() must be called before using this
898**                        Updating data must not be removed until returning event
899**
900**                  The following event will be returned
901**                      RW_T4T_NDEF_UPDATE_CPLT_EVT for complete
902**                      RW_T4T_NDEF_UPDATE_FAIL_EVT for failure
903**
904** Returns          NFC_STATUS_OK if success
905**                  NFC_STATUS_FAILED if T4T is busy or other error
906**
907*******************************************************************************/
908extern tNFC_STATUS RW_T4tUpdateNDef (uint16_t length, uint8_t *p_data);
909
910/*****************************************************************************
911**
912** Function         RW_T4tPresenceCheck
913**
914** Description
915**      Check if the tag is still in the field.
916**
917**      The RW_T4T_PRESENCE_CHECK_EVT w/ status is used to indicate presence
918**      or non-presence.
919**      option is RW_T4T_CHK_EMPTY_I_BLOCK, use empty I block for presence check.
920**
921** Returns
922**      NFC_STATUS_OK, if raw data frame sent
923**      NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
924**      NFC_STATUS_FAILED: other error
925**
926*****************************************************************************/
927extern tNFC_STATUS RW_T4tPresenceCheck (uint8_t option);
928
929/*****************************************************************************
930**
931** Function         RW_T4tSetNDefReadOnly
932**
933** Description      This function performs NDEF read-only procedure
934**                  Note: RW_T4tDetectNDef() must be called before using this
935**
936**                  The RW_T4T_SET_TO_RO_EVT event will be returned.
937**
938** Returns          NFC_STATUS_OK if success
939**                  NFC_STATUS_FAILED if T4T is busy or other error
940**
941*****************************************************************************/
942extern tNFC_STATUS RW_T4tSetNDefReadOnly (void);
943
944/*******************************************************************************
945**
946** Function         RW_I93Inventory
947**
948** Description      This function send Inventory command with/without AFI
949**                  If UID is provided then set UID[0]:MSB, ... UID[7]:LSB
950**
951**                  RW_I93_RESPONSE_EVT will be returned
952**
953** Returns          NFC_STATUS_OK if success
954**                  NFC_STATUS_NO_BUFFERS if out of buffer
955**                  NFC_STATUS_FAILED if T4T is busy or other error
956**
957*******************************************************************************/
958extern tNFC_STATUS RW_I93Inventory (bool    including_afi, uint8_t afi, uint8_t *p_uid);
959
960/*******************************************************************************
961**
962** Function         RW_I93StayQuiet
963**
964** Description      This function send Inventory command
965**
966**                  RW_I93_CMD_CMPL_EVT will be returned
967**
968** Returns          NFC_STATUS_OK if success
969**                  NFC_STATUS_NO_BUFFERS if out of buffer
970**                  NFC_STATUS_BUSY if busy
971**                  NFC_STATUS_FAILED if other error
972**
973*******************************************************************************/
974extern tNFC_STATUS RW_I93StayQuiet (void);
975
976/*******************************************************************************
977**
978** Function         RW_I93ReadSingleBlock
979**
980** Description      This function send Read Single Block command
981**
982**                  RW_I93_RESPONSE_EVT will be returned
983**
984** Returns          NFC_STATUS_OK if success
985**                  NFC_STATUS_NO_BUFFERS if out of buffer
986**                  NFC_STATUS_BUSY if busy
987**                  NFC_STATUS_FAILED if other error
988**
989*******************************************************************************/
990extern tNFC_STATUS RW_I93ReadSingleBlock (uint16_t block_number);
991
992/*******************************************************************************
993**
994** Function         RW_I93WriteSingleBlock
995**
996** Description      This function send Write Single Block command
997**                  Application must get block size first by calling RW_I93GetSysInfo().
998**
999**                  RW_I93_CMD_CMPL_EVT will be returned
1000**
1001** Returns          NFC_STATUS_OK if success
1002**                  NFC_STATUS_NO_BUFFERS if out of buffer
1003**                  NFC_STATUS_BUSY if busy
1004**                  NFC_STATUS_FAILED if other error
1005**
1006*******************************************************************************/
1007extern tNFC_STATUS RW_I93WriteSingleBlock (uint16_t block_number, uint8_t  *p_data);
1008
1009/*******************************************************************************
1010**
1011** Function         RW_I93LockBlock
1012**
1013** Description      This function send Lock Block command
1014**
1015**                  RW_I93_CMD_CMPL_EVT will be returned
1016**
1017** Returns          NFC_STATUS_OK if success
1018**                  NFC_STATUS_NO_BUFFERS if out of buffer
1019**                  NFC_STATUS_BUSY if busy
1020**                  NFC_STATUS_FAILED if other error
1021**
1022*******************************************************************************/
1023extern tNFC_STATUS RW_I93LockBlock (uint8_t block_number);
1024
1025/*******************************************************************************
1026**
1027** Function         RW_I93ReadMultipleBlocks
1028**
1029** Description      This function send Read Multiple Blocks command
1030**
1031**                  RW_I93_RESPONSE_EVT will be returned
1032**
1033** Returns          NFC_STATUS_OK if success
1034**                  NFC_STATUS_NO_BUFFERS if out of buffer
1035**                  NFC_STATUS_BUSY if busy
1036**                  NFC_STATUS_FAILED if other error
1037**
1038*******************************************************************************/
1039extern tNFC_STATUS RW_I93ReadMultipleBlocks (uint16_t first_block_number,
1040                                             uint16_t number_blocks);
1041
1042/*******************************************************************************
1043**
1044** Function         RW_I93WriteMultipleBlocks
1045**
1046** Description      This function send Write Multiple Blocks command
1047**
1048**                  RW_I93_CMD_CMPL_EVT will be returned
1049**
1050** Returns          NFC_STATUS_OK if success
1051**                  NFC_STATUS_NO_BUFFERS if out of buffer
1052**                  NFC_STATUS_BUSY if busy
1053**                  NFC_STATUS_FAILED if other error
1054**
1055*******************************************************************************/
1056extern tNFC_STATUS RW_I93WriteMultipleBlocks (uint8_t  first_block_number,
1057                                              uint16_t number_blocks,
1058                                              uint8_t *p_data);
1059
1060/*******************************************************************************
1061**
1062** Function         RW_I93Select
1063**
1064** Description      This function send Select command
1065**
1066**                  UID[0]: 0xE0, MSB
1067**                  UID[1]: IC Mfg Code
1068**                  ...
1069**                  UID[7]: LSB
1070**
1071**                  RW_I93_CMD_CMPL_EVT will be returned
1072**
1073** Returns          NFC_STATUS_OK if success
1074**                  NFC_STATUS_NO_BUFFERS if out of buffer
1075**                  NFC_STATUS_BUSY if busy
1076**                  NFC_STATUS_FAILED if other error
1077**
1078*******************************************************************************/
1079extern tNFC_STATUS RW_I93Select (uint8_t *p_uid);
1080
1081/*******************************************************************************
1082**
1083** Function         RW_I93ResetToReady
1084**
1085** Description      This function send Reset To Ready command
1086**
1087**                  RW_I93_CMD_CMPL_EVT will be returned
1088**
1089** Returns          NFC_STATUS_OK if success
1090**                  NFC_STATUS_NO_BUFFERS if out of buffer
1091**                  NFC_STATUS_BUSY if busy
1092**                  NFC_STATUS_FAILED if other error
1093**
1094*******************************************************************************/
1095extern tNFC_STATUS RW_I93ResetToReady (void);
1096
1097/*******************************************************************************
1098**
1099** Function         RW_I93WriteAFI
1100**
1101** Description      This function send Write AFI command
1102**
1103**                  RW_I93_CMD_CMPL_EVT will be returned
1104**
1105** Returns          NFC_STATUS_OK if success
1106**                  NFC_STATUS_NO_BUFFERS if out of buffer
1107**                  NFC_STATUS_BUSY if busy
1108**                  NFC_STATUS_FAILED if other error
1109**
1110*******************************************************************************/
1111extern tNFC_STATUS RW_I93WriteAFI (uint8_t afi);
1112
1113/*******************************************************************************
1114**
1115** Function         RW_I93LockAFI
1116**
1117** Description      This function send Lock AFI command
1118**
1119**                  RW_I93_CMD_CMPL_EVT will be returned
1120**
1121** Returns          NFC_STATUS_OK if success
1122**                  NFC_STATUS_NO_BUFFERS if out of buffer
1123**                  NFC_STATUS_BUSY if busy
1124**                  NFC_STATUS_FAILED if other error
1125**
1126*******************************************************************************/
1127extern tNFC_STATUS RW_I93LockAFI (void);
1128
1129/*******************************************************************************
1130**
1131** Function         RW_I93WriteDSFID
1132**
1133** Description      This function send Write DSFID command
1134**
1135**                  RW_I93_CMD_CMPL_EVT will be returned
1136**
1137** Returns          NFC_STATUS_OK if success
1138**                  NFC_STATUS_NO_BUFFERS if out of buffer
1139**                  NFC_STATUS_BUSY if busy
1140**                  NFC_STATUS_FAILED if other error
1141**
1142*******************************************************************************/
1143extern tNFC_STATUS RW_I93WriteDSFID (uint8_t dsfid);
1144
1145/*******************************************************************************
1146**
1147** Function         RW_I93LockDSFID
1148**
1149** Description      This function send Lock DSFID command
1150**
1151**                  RW_I93_CMD_CMPL_EVT will be returned
1152**
1153** Returns          NFC_STATUS_OK if success
1154**                  NFC_STATUS_NO_BUFFERS if out of buffer
1155**                  NFC_STATUS_BUSY if busy
1156**                  NFC_STATUS_FAILED if other error
1157**
1158*******************************************************************************/
1159extern tNFC_STATUS RW_I93LockDSFID (void);
1160
1161/*******************************************************************************
1162**
1163** Function         RW_I93GetSysInfo
1164**
1165** Description      This function send Get System Information command
1166**                  If UID is provided then set UID[0]:MSB, ... UID[7]:LSB
1167**
1168**                  RW_I93_RESPONSE_EVT will be returned
1169**
1170** Returns          NFC_STATUS_OK if success
1171**                  NFC_STATUS_NO_BUFFERS if out of buffer
1172**                  NFC_STATUS_BUSY if busy
1173**                  NFC_STATUS_FAILED if other error
1174**
1175*******************************************************************************/
1176extern tNFC_STATUS RW_I93GetSysInfo (uint8_t *p_uid);
1177
1178/*******************************************************************************
1179**
1180** Function         RW_I93GetMultiBlockSecurityStatus
1181**
1182** Description      This function send Get Multiple Block Security Status command
1183**
1184**                  RW_I93_RESPONSE_EVT will be returned
1185**
1186** Returns          NFC_STATUS_OK if success
1187**                  NFC_STATUS_NO_BUFFERS if out of buffer
1188**                  NFC_STATUS_BUSY if busy
1189**                  NFC_STATUS_FAILED if other error
1190**
1191*******************************************************************************/
1192extern tNFC_STATUS RW_I93GetMultiBlockSecurityStatus (uint16_t first_block_number,
1193                                                      uint16_t number_blocks);
1194
1195/*******************************************************************************
1196**
1197** Function         RW_I93DetectNDef
1198**
1199** Description      This function performs NDEF detection procedure
1200**
1201**                  RW_I93_NDEF_DETECT_EVT will be returned
1202**
1203** Returns          NFC_STATUS_OK if success
1204**                  NFC_STATUS_FAILED if busy or other error
1205**
1206*******************************************************************************/
1207extern tNFC_STATUS RW_I93DetectNDef (void);
1208
1209/*******************************************************************************
1210**
1211** Function         RW_I93ReadNDef
1212**
1213** Description      This function performs NDEF read procedure
1214**                  Note: RW_I93DetectNDef() must be called before using this
1215**
1216**                  The following event will be returned
1217**                      RW_I93_NDEF_READ_EVT for each segmented NDEF message
1218**                      RW_I93_NDEF_READ_CPLT_EVT for the last segment or complete NDEF
1219**                      RW_I93_NDEF_READ_FAIL_EVT for failure
1220**
1221** Returns          NFC_STATUS_OK if success
1222**                  NFC_STATUS_FAILED if I93 is busy or other error
1223**
1224*******************************************************************************/
1225extern tNFC_STATUS RW_I93ReadNDef (void);
1226
1227/*******************************************************************************
1228**
1229** Function         RW_I93UpdateNDef
1230**
1231** Description      This function performs NDEF update procedure
1232**                  Note: RW_I93DetectNDef() must be called before using this
1233**                        Updating data must not be removed until returning event
1234**
1235**                  The following event will be returned
1236**                      RW_I93_NDEF_UPDATE_CPLT_EVT for complete
1237**                      RW_I93_NDEF_UPDATE_FAIL_EVT for failure
1238**
1239** Returns          NFC_STATUS_OK if success
1240**                  NFC_STATUS_FAILED if I93 is busy or other error
1241**
1242*******************************************************************************/
1243extern tNFC_STATUS RW_I93UpdateNDef (uint16_t length, uint8_t *p_data);
1244
1245/*******************************************************************************
1246**
1247** Function         RW_I93FormatNDef
1248**
1249** Description      This function performs formatting procedure
1250**
1251**                  RW_I93_FORMAT_CPLT_EVT will be returned
1252**
1253** Returns          NFC_STATUS_OK if success
1254**                  NFC_STATUS_FAILED if busy or other error
1255**
1256*******************************************************************************/
1257extern tNFC_STATUS RW_I93FormatNDef (void);
1258
1259/*******************************************************************************
1260**
1261** Function         RW_I93SetTagReadOnly
1262**
1263** Description      This function performs NDEF read-only procedure
1264**                  Note: RW_I93DetectNDef() must be called before using this
1265**                        Updating data must not be removed until returning event
1266**
1267**                  The RW_I93_SET_TAG_RO_EVT event will be returned.
1268**
1269** Returns          NFC_STATUS_OK if success
1270**                  NFC_STATUS_FAILED if I93 is busy or other error
1271**
1272*******************************************************************************/
1273extern tNFC_STATUS RW_I93SetTagReadOnly (void);
1274
1275/*****************************************************************************
1276**
1277** Function         RW_I93PresenceCheck
1278**
1279** Description      Check if the tag is still in the field.
1280**
1281**                  The RW_I93_PRESENCE_CHECK_EVT w/ status is used to indicate
1282**                  presence or non-presence.
1283**
1284** Returns          NFC_STATUS_OK, if raw data frame sent
1285**                  NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation
1286**                  NFC_STATUS_FAILED: other error
1287**
1288*****************************************************************************/
1289extern tNFC_STATUS RW_I93PresenceCheck (void);
1290
1291/*******************************************************************************
1292**
1293** Function         RW_SendRawFrame
1294**
1295** Description      This function sends a raw frame to the peer device.
1296**
1297** Returns          tNFC_STATUS
1298**
1299*******************************************************************************/
1300extern tNFC_STATUS RW_SendRawFrame (uint8_t *p_raw_data, uint16_t data_len);
1301
1302/*******************************************************************************
1303**
1304** Function         RW_SetActivatedTagType
1305**
1306** Description      This function sets tag type for Reader/Writer mode.
1307**
1308** Returns          tNFC_STATUS
1309**
1310*******************************************************************************/
1311extern tNFC_STATUS RW_SetActivatedTagType (tNFC_ACTIVATE_DEVT *p_activate_params, tRW_CBACK *p_cback);
1312
1313/*******************************************************************************
1314**
1315** Function         RW_SetTraceLevel
1316**
1317** Description      This function sets the trace level for Reader/Writer mode.
1318**                  If called with a value of 0xFF,
1319**                  it simply returns the current trace level.
1320**
1321** Returns          The new or current trace level
1322**
1323*******************************************************************************/
1324extern uint8_t RW_SetTraceLevel (uint8_t new_level);
1325
1326#endif /* RW_API_H */
1327