gerriko
(Gerriko IO)
October 9, 2020, 4:49pm
1
I have a NXP NTAG I2C Plus (NFC Type 2 Tag) - NTAG I2C Plus 2K: NFC Forum Type 2 Tag with I2C Interface | NXP Semiconductors
I wish to use this device with an Mbed OS compatible board.
I am reading through the Mbed documentation on GitHub to determine which NFC endpoint to use:
# Near-field communication in Mbed OS
## Table of contents
- [Near-field communication in Mbed OS](#near-field-communication-in-mbed-os)
- [Table of contents](#table-of-contents)
- [Revision history](#revision-history)
- [Introduction](#introduction)
- [Overview and background](#overview-and-background)
- [Use cases](#use-cases)
- [Commissioning](#commissioning)
- [Identification](#identification)
- [Transport](#transport)
- [BLE pairing](#ble-pairing)
- [System architecture and high-level design](#system-architecture-and-high-level-design)
- [Compliance with NFC forum specifications](#compliance-with-nfc-forum-specifications)
- [User-facing API](#user-facing-api)
- [Phase 1: MicroNFC stack integration](#phase-1-micronfc-stack-integration)
- [Phase 2: NFC host/controller split, NCI and NFC HAL API](#phase-2-nfc-hostcontroller-split-nci-and-nfc-hal-api)
- [Detailed design](#detailed-design)
This file has been truncated. show original
It wasn’t clear to me which to use. I then reviewed the HAL:
# Near-field communication in Mbed OS
## Table of contents
- [Near-field communication in Mbed OS](#near-field-communication-in-mbed-os)
- [Table of contents](#table-of-contents)
- [Revision history](#revision-history)
- [Introduction](#introduction)
- [Overview and background](#overview-and-background)
- [Use cases](#use-cases)
- [Commissioning](#commissioning)
- [Identification](#identification)
- [Transport](#transport)
- [BLE pairing](#ble-pairing)
- [System architecture and high-level design](#system-architecture-and-high-level-design)
- [Compliance with NFC forum specifications](#compliance-with-nfc-forum-specifications)
- [User-facing API](#user-facing-api)
- [Phase 1: MicroNFC stack integration](#phase-1-micronfc-stack-integration)
- [Phase 2: NFC host/controller split, NCI and NFC HAL API](#phase-2-nfc-hostcontroller-split-nci-and-nfc-hal-api)
- [Detailed design](#detailed-design)
This file has been truncated. show original
This looks more like it as this includes functions like:
void read_bytes(uint32_t address, size_t count);
void write_bytes(uint32_t address, const uint8_t *bytes, size_t count);
What’s not clear to me from documentation is how to implement.
For example, the NTAG uses I2C to communicate with the MCU. So what is the best method to merge the I2C read and write bytes with the NFC HAL API read and write byte functions etc.
Any guidance is greatly appreciated as it would be nice to see the Mbed NFC library in action with the NXP NTAG device.
Thanks.
donatien
(Donatien Garnier)
October 9, 2020, 5:29pm
2
Hi, thanks for looking into the NFC API!
The read_bytes()/write_bytes() functions should read & write inside the EEPROM’s memory.
You will need to map the I2C commands listed in the datasheet:
Thanks,
Don
gerriko
(Gerriko IO)
October 12, 2020, 9:49am
3
Thanks @donatien for the datasheet.
I have made a start based on a partial port of an Arduino library I’ve used in the past.
I could simply recreate the whole library, but that fails to incorporate the Mbed NFC functionality.
So, what I’m struggling to grasp, is really the mechanics or basics on how to bridge the Mbed NFC library as I have no examples to work from.
Any advice greatly appreciated.
Thanks
G://
gerriko
(Gerriko IO)
October 12, 2020, 10:20am
4
I think I found what I am looking for to help guide me
(I see this header file would be used to link in with the nfcEEPROM library. Ref: https://os.mbed.com/docs/mbed-os/v6.3/apis/nfc-eeprom.html ):
But when opening up this file, I see the author(s) included a
namespace vendor { … }
So, one specific question for the forum readers… what the heck is “vendor” used for.
eldavo
(Dave Hall)
October 26, 2020, 5:55am
5
Hi, I also recently went looking for some drivers for the NXP NTAG I2C Plus, and came across this link:
It seems to have the required drivers implemented for doing the basics of communication.
There are also some NXP source files available as part of this demo here:
NFC DIN rail demo - how to do parametrization with... - NXP Community (in the link http://nxp.com/assets/downloads/data/en/software/DINRailDemo_SourceCode.zip )
Hope that helps!
Cheers,
Dave
1 Like
gerriko
(Gerriko IO)
October 27, 2020, 10:04pm
6
Thanks this helps a great deal.