We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-07-11
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RFID/NFC
Downloaded: 3544 times
Not followed.
License: MIT license
NFC Tag 4 Click is NFC RFID tag device, offering 16 Kbit of electrically erasable programmable memory (EEPROM). This Click Board offer two communication interfaces. The first one is an I2C serial link and can be operated from a DC power supply.
Do you want to subscribe in order to receive notifications regarding "NFC Tag 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "NFC Tag 4 click" changes.
Do you want to report abuse regarding "NFC Tag 4 click".
Library Description
Library contains function for getting INT pin state Library contains function for setting CS pin state Library contains function for getting register values Library contains function for setting register values Library contains function for device initialization Library contains function for getting temperature value Library contains function for getting axes values Library contains function for software reset Library contains functions for setting power mode and full scale range
Key functions:
uint8_t nfctag4_password_present( uint8_t * password_bytes )
- presents password to device in order to open I2C security session.uint8_t nfctag4_init( void )
- initializes the device.uint8_t nfctag4_enable_mailbox( uint8_t enable_mailbox )
- enables or disables mailbox functionality.Examples description
The application is composed of three sections :
void applicationTask( )
{
nfctag4_wait_for_int( );
nfctag4_i2c_get( _NFCTAG4_MEMORY_DYNAMIC, _NFCTAG4_DYNAMIC_REG_MB_CTRL, &aux_buffer[0], 1 );
if (( aux_buffer[0] & 0x04 ) == ( 0x04 ))
{
nfctag4_wait_for_int( );
nfctag4_i2c_get( _NFCTAG4_MEMORY_DYNAMIC, _NFCTAG4_DYNAMIC_REG_MB_LEN, &aux_buffer[0], 1 );
message_length = aux_buffer[0];
message_length++;
nfctag4_wait_for_int( );
nfctag4_i2c_get( _NFCTAG4_MEMORY_MAILBOX, _NFCTAG4_MAILBOX_REG_BYTE_0, &aux_buffer[0], message_length );
mikrobus_logWrite( " ", _LOG_LINE );
mikrobus_logWrite( "> ********* MESSAGE ********* <", _LOG_LINE );
ByteToStr( message_length, text );
mikrobus_logWrite( "> Message length : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " [Bytes]", _LOG_LINE );
for (i = 0; i < message_length; i ++)
{
ByteToStr( i, text );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " : ", _LOG_TEXT );
ByteToHex( aux_buffer[ i ], text );
mikrobus_logWrite( "0x", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_LINE );
}
mikrobus_logWrite( "> *********** END *********** <", _LOG_LINE );
}
}
Additional Functions :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.