Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_nfc.h
1 #ifndef _BC_TAG_NFC_H
2 #define _BC_TAG_NFC_H
3 
4 #include <bc_i2c.h>
5 
9 
11 
12 #define BC_TAG_NFC_I2C_ADDRESS_DEFAULT 0x08
13 
14 #define BC_TAG_NFC_BUFFER_SIZE 864
15 
17 
18 typedef struct
19 {
20  bc_i2c_channel_t _i2c_channel;
21  uint8_t _i2c_address;
22 
23 } bc_tag_nfc_t;
24 
26 
27 typedef struct
28 {
29  size_t _length;
30  int _last_tnf_pos;
31  uint16_t _encoded_size;
32  uint8_t _buffer[BC_TAG_NFC_BUFFER_SIZE];
33 
35 
40 
41 bool bc_tag_nfc_init(bc_tag_nfc_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address);
42 
49 
50 bool bc_tag_nfc_memory_read(bc_tag_nfc_t *self, void *buffer, size_t length);
51 
58 
59 bool bc_tag_nfc_memory_write(bc_tag_nfc_t *self, void *buffer, size_t length);
60 
66 
68 
71 
73 
78 
79 bool bc_tag_nfc_ndef_add_text(bc_tag_nfc_ndef_t *self, const char *text, const char *encoding);
80 
84 
85 bool bc_tag_nfc_ndef_add_uri(bc_tag_nfc_ndef_t *self, const char *uri);
86 
88 
89 #endif // _BC_TAG_NFC_H
bool bc_tag_nfc_memory_read(bc_tag_nfc_t *self, void *buffer, size_t length)
Read from memory.
Definition: bc_tag_nfc.c:66
bool bc_tag_nfc_ndef_add_uri(bc_tag_nfc_ndef_t *self, const char *uri)
Add ndef uri record.
Definition: bc_tag_nfc.c:199
bool bc_tag_nfc_memory_write_ndef(bc_tag_nfc_t *self, bc_tag_nfc_ndef_t *ndef)
Write to memory.
Definition: bc_tag_nfc.c:144
Instance.
Definition: bc_tag_nfc.h:18
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
bool bc_tag_nfc_memory_write(bc_tag_nfc_t *self, void *buffer, size_t length)
Write to memory.
Definition: bc_tag_nfc.c:102
bool bc_tag_nfc_init(bc_tag_nfc_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize NFC Tag.
Definition: bc_tag_nfc.c:10
bool bc_tag_nfc_ndef_add_text(bc_tag_nfc_ndef_t *self, const char *text, const char *encoding)
Add ndef text record.
Definition: bc_tag_nfc.c:171
NDEF Instance.
Definition: bc_tag_nfc.h:27
void bc_tag_nfc_ndef_init(bc_tag_nfc_ndef_t *self)
Initialize NDEF.
Definition: bc_tag_nfc.c:156