The M24LR64E NFC tag is an 8KB electrically erasable programmable read-only memory (EEPROM) that can be written to or read from using I2C and NFC-equipped devices.
The user mode (default) allows read and write access to all 8KB of space, provided the sector security status (SSS) allows it. The root mode allows modification of the SSS data and other information, provided the proper password is submitted. The default password for a new tag is 0x00000000. See the datasheet for more details.
The Seeed Studio* wiki page for this device includes a link to an Android* application that can be used to also read and write the device via NFC, as well as set NFC passwords, which cannot be done via I2C.
int addr = M24LR64E::EEPROM_I2C_LENGTH - 1;
printf("Address: %d\n", addr);
uint8_t byte = nfcTag.readByte(addr);
printf("Read byte: %02x\n", byte);
byte = ~byte;
nfcTag.writeByte(addr, byte);
printf("Wrote inverted byte: %02x\n", byte);
byte = nfcTag.readByte(addr);
printf("Read byte: %02x\n", byte);
|
enum | M24LR64E_ADDR_T {
I2C_PASSWORD_ADDR = 2304,
RF_PASSWORD_1_ADDR = 2308,
RF_PASSWORD_2_ADDR = 2312,
RF_PASSWORD_3_ADDR = 2316,
DSFID_ADDR = 2320,
AFI_ADDR = 2321,
RESV_ADDR = 2322,
CONFIG_ADDR = 2323,
UID_ADDR = 2324,
MEM_SIZE_ADDR = 2332,
IC_REF_ADDR = 2335,
PROG_COMP_ENERGY_HARVEST_ADDR = 2339
} |
|
enum | AccessMode { USER_MODE = 0x0,
ROOT_MODE = 0x1
} |
|
enum | SectorAccessRight { Access_1110 = 0,
Access_1111 = 1,
Access_1100 = 2,
Access_0111 = 3
} |
|
enum | SectorSelectPassWd { noPasswd = 0,
passwd_1 = 1,
passwd_2 = 2,
passwd_3 = 3
} |
|
|
| M24LR64E (int bus, AccessMode mode=USER_MODE) |
|
| ~M24LR64E () |
|
bool | submitPasswd (uint32_t passwd) |
|
bool | writePasswd (uint32_t passwd) |
|
void | sectorProtectConfig (unsigned int sectorNumber, bool protectEnable, SectorAccessRight accessRight, SectorSelectPassWd passwd) |
|
void | clearSectorProtect (void) |
|
void | sectorWriteLockBit (unsigned int sectorNumber, bool sockEnable) |
|
uint8_t | getDSFID () |
|
uint8_t | getAFI () |
|
uint8_t * | getUID () |
|
uint32_t | getMemorySize () |
|
void | clearMemory () |
|
mraa::Result | writeByte (unsigned int address, uint8_t data) |
|
mraa::Result | writeBytes (unsigned int address, uint8_t *buffer, int len) |
|
uint8_t | readByte (unsigned int address) |
|
int | readBytes (unsigned int address, uint8_t *buffer, int len) |
|