Firmware library for the X-NUCLEO-NFC01A1 Dynamic NFC Tag board.
Dependencies: M24SR
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of X_NUCLEO_NFC01A1 by
X-NUCLEO-NFC01A1 Dynamic NFC Tag Expansion Board Firmware Package
Introduction
This firmware package includes Components Device Drivers, Board Support Package and example applications for STMicroelectronics X-NUCLEO-NFC01A1 Dynamic NFC Tag Expansion Board based on M24SR.
Firmware Library
Class X_NUCLEO_NFC01A1 is intended to represent the Dynamic NFC Tag Expansion Board with the same name.
It provides an API to access to the M24SR component and to the three onboard LEDs.
It is intentionally implemented as a singleton because only one X_NUCLEO_NFC01A1 at a time might be deployed in a HW component stack.
The library also provides an implementation of the NDEF library API for M24SR, providing an simple way to read/write NDEF formatted messages from/to the M24SR dynamic NFC tag.
Example applications
1. Hello World
2. Asynchronous Hello World
Revision 22:ac2e9a086341, committed 2016-02-01
- Comitter:
- giovannivisentini
- Date:
- Mon Feb 01 13:04:43 2016 +0000
- Parent:
- 19:0b65a5813059
- Commit message:
- add default value for the gpocallback
Changed in this revision
--- a/X_NUCLEO_NFC01A1.cpp Thu Jan 28 14:01:18 2016 +0000
+++ b/X_NUCLEO_NFC01A1.cpp Mon Feb 01 13:04:43 2016 +0000
@@ -50,7 +50,8 @@
X_NUCLEO_NFC01A1 *X_NUCLEO_NFC01A1::mInstance = NULL;
X_NUCLEO_NFC01A1* X_NUCLEO_NFC01A1::Instance(I2C &devI2C,
- Nfc::gpoEventCallback gpoEventCallback, const PinName &gpoName,
+ Nfc::gpoEventCallback gpoEventCallback,
+ const PinName &gpoName,
const PinName &RFDisableName, const PinName &led1Name,
const PinName &led2Name, const PinName &led3Name) {
if (mInstance == NULL) { // the first time
--- a/X_NUCLEO_NFC01A1.h Thu Jan 28 14:01:18 2016 +0000 +++ b/X_NUCLEO_NFC01A1.h Mon Feb 01 13:04:43 2016 +0000 @@ -98,7 +98,7 @@ * @param led3Name Pin to control the led1 status. */ static X_NUCLEO_NFC01A1* Instance(I2C &devI2C, - Nfc::gpoEventCallback eventCallback, + Nfc::gpoEventCallback eventCallback=NULL, const PinName &gpoName = DEFAULT_GPO_PIN, const PinName &RFDisableName = DEFAULT_RF_DISABLE_PIN, const PinName &led1Name = DEFAULT_LED1_PIN,
--- a/m24sr/m24sr_class.h Thu Jan 28 14:01:18 2016 +0000 +++ b/m24sr/m24sr_class.h Mon Feb 01 13:04:43 2016 +0000 @@ -108,8 +108,8 @@ memset(uM24SRbuffer, 0, 0xFF * sizeof(int8_t)); uDIDbyte = 0; RFDisablePin = 0; - - mGpoEventInterrupt.fall(eventCallback); + if(eventCallback!=NULL) + mGpoEventInterrupt.fall(eventCallback); mGpoEventInterrupt.mode(PullUp); mGpoEventInterrupt.disable_irq(); }

X-NUCLEO-NFC01A1 Dynamic NFC Tag