Firmware SDK
twr_tag_nfc

Driver for HARDWARIO NFC Module. More...

Data Structures

struct  twr_tag_nfc_t
 Instance. More...
 
struct  twr_tag_nfc_ndef_t
 NDEF Instance. More...
 

Macros

#define TWR_TAG_NFC_I2C_ADDRESS_DEFAULT   0x08
 Default I2C address.
 
#define TWR_TAG_NFC_BUFFER_SIZE   864
 

Functions

bool twr_tag_nfc_init (twr_tag_nfc_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize NFC Tag. More...
 
bool twr_tag_nfc_memory_read (twr_tag_nfc_t *self, void *buffer, size_t length)
 Read from memory. More...
 
bool twr_tag_nfc_memory_write (twr_tag_nfc_t *self, void *buffer, size_t length)
 Write to memory. More...
 
bool twr_tag_nfc_memory_write_ndef (twr_tag_nfc_t *self, twr_tag_nfc_ndef_t *ndef)
 Write to memory. More...
 
void twr_tag_nfc_ndef_init (twr_tag_nfc_ndef_t *self)
 Initialize NDEF. More...
 
bool twr_tag_nfc_ndef_add_text (twr_tag_nfc_ndef_t *self, const char *text, const char *encoding)
 Add ndef text record. More...
 
bool twr_tag_nfc_ndef_add_uri (twr_tag_nfc_ndef_t *self, const char *uri)
 Add ndef uri record. More...
 

Detailed Description

Driver for HARDWARIO NFC Module.

Function Documentation

◆ twr_tag_nfc_init()

bool twr_tag_nfc_init ( twr_tag_nfc_t self,
twr_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize NFC Tag.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 10 of file twr_tag_nfc.c.

Here is the call graph for this function:

◆ twr_tag_nfc_memory_read()

bool twr_tag_nfc_memory_read ( twr_tag_nfc_t self,
void *  buffer,
size_t  length 
)

Read from memory.

Parameters
[in]selfInstance
[out]bufferPointer to destination buffer
[in]lengthNumber of bytes to be read, must by modulo 16, max 880
Returns
true On success
false On failure

Definition at line 66 of file twr_tag_nfc.c.

◆ twr_tag_nfc_memory_write()

bool twr_tag_nfc_memory_write ( twr_tag_nfc_t self,
void *  buffer,
size_t  length 
)

Write to memory.

Parameters
[in]selfInstance
[in]bufferPointer to source buffer
[in]lengthNumber of bytes to be written, must by modulo 16, max 880
Returns
true On success
false On failure

Definition at line 102 of file twr_tag_nfc.c.

Referenced by twr_tag_nfc_memory_write_ndef().

Here is the caller graph for this function:

◆ twr_tag_nfc_memory_write_ndef()

bool twr_tag_nfc_memory_write_ndef ( twr_tag_nfc_t self,
twr_tag_nfc_ndef_t ndef 
)

Write to memory.

Parameters
[in]selfInstance
[in]ndefInstance
Returns
true On success
false On failure

Definition at line 144 of file twr_tag_nfc.c.

Here is the call graph for this function:

◆ twr_tag_nfc_ndef_add_text()

bool twr_tag_nfc_ndef_add_text ( twr_tag_nfc_ndef_t self,
const char *  text,
const char *  encoding 
)

Add ndef text record.

Parameters
[in]selfInstance
[in]*textString to be added
[in]*encodingEncoding for example "en"

Definition at line 171 of file twr_tag_nfc.c.

◆ twr_tag_nfc_ndef_add_uri()

bool twr_tag_nfc_ndef_add_uri ( twr_tag_nfc_ndef_t self,
const char *  uri 
)

Add ndef uri record.

Parameters
[in]selfInstance
[in]*uriURI

Definition at line 199 of file twr_tag_nfc.c.

◆ twr_tag_nfc_ndef_init()

void twr_tag_nfc_ndef_init ( twr_tag_nfc_ndef_t self)

Initialize NDEF.

Parameters
[in]selfInstance

Definition at line 156 of file twr_tag_nfc.c.