This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.

Dependencies:   NDefLib X_NUCLEO_NFC01A1 mbed

Fork of X-MBED-NFC1 by Giovanni Visentini

This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.

The available demos are:

  • SAMPLE_WRITE_URL: write a tag with the ST home page URL
  • SAMPLE_COUNT_CLICK: create a custom tag to count and report the user button clicks.
  • SAMPLE_WRITE_AND_CHANGE_ALL: write a tag with all the supported records and update the tag contents when the user button is pressed.
  • SAMPLE_LOCK_TAG_CONTENT: use the M24SR component API to set the NFC tag as read-only.

To enable the different demos comment/uncomment the SAMPLE_* macros provided in main.cpp .

Committer:
giovannivisentini
Date:
Thu Nov 19 08:50:18 2015 +0000
Revision:
0:674813bd5ec9
Child:
1:6d202b62ed68
first commit,

Who changed what in which revision?

UserRevisionLine numberNew contents of line
giovannivisentini 0:674813bd5ec9 1 /*
giovannivisentini 0:674813bd5ec9 2 * X_NUCLEO_NFC01A1.h
giovannivisentini 0:674813bd5ec9 3 *
giovannivisentini 0:674813bd5ec9 4 * Created on: Nov 5, 2015
giovannivisentini 0:674813bd5ec9 5 * Author: giovanni visentini
giovannivisentini 0:674813bd5ec9 6 */
giovannivisentini 0:674813bd5ec9 7
giovannivisentini 0:674813bd5ec9 8 #ifndef X_NUCLEO_NFC01A1_H_
giovannivisentini 0:674813bd5ec9 9 #define X_NUCLEO_NFC01A1_H_
giovannivisentini 0:674813bd5ec9 10
giovannivisentini 0:674813bd5ec9 11 #include "mbed.h"
giovannivisentini 0:674813bd5ec9 12
giovannivisentini 0:674813bd5ec9 13 #include "m24sr/m24sr_class.h"
giovannivisentini 0:674813bd5ec9 14
giovannivisentini 0:674813bd5ec9 15 #define M24SR_ADDR 0xAC /*!< M24SR address */
giovannivisentini 0:674813bd5ec9 16
giovannivisentini 0:674813bd5ec9 17 class X_NUCLEO_NFC01A1 {
giovannivisentini 0:674813bd5ec9 18
giovannivisentini 0:674813bd5ec9 19 private:
giovannivisentini 0:674813bd5ec9 20 static X_NUCLEO_NFC01A1 *instance;
giovannivisentini 0:674813bd5ec9 21
giovannivisentini 0:674813bd5ec9 22 X_NUCLEO_NFC01A1(I2C &devI2C,const PinName &gpoName,const PinName &RFDisableName,
giovannivisentini 0:674813bd5ec9 23 const PinName &led1Name,const PinName &led2Name,const PinName &led3Name):
giovannivisentini 0:674813bd5ec9 24 mM24SR(M24SR_ADDR,devI2C,gpoName,RFDisableName),
giovannivisentini 0:674813bd5ec9 25 mNfcLed1(led1Name),mNfcLed2(led2Name),mNfcLed3(led3Name){
giovannivisentini 0:674813bd5ec9 26
giovannivisentini 0:674813bd5ec9 27 }
giovannivisentini 0:674813bd5ec9 28
giovannivisentini 0:674813bd5ec9 29
giovannivisentini 0:674813bd5ec9 30 public:
giovannivisentini 0:674813bd5ec9 31 static X_NUCLEO_NFC01A1* Instance(I2C &devI2C,
giovannivisentini 0:674813bd5ec9 32 const PinName &gpoName=D12,const PinName &RFDisableName=D11,
giovannivisentini 0:674813bd5ec9 33 const PinName &led1Name=D5,const PinName &led2Name=D4,const PinName &led3Name=D2);
giovannivisentini 0:674813bd5ec9 34
giovannivisentini 0:674813bd5ec9 35
giovannivisentini 0:674813bd5ec9 36 DigitalOut& getLed1(){return mNfcLed1;}
giovannivisentini 0:674813bd5ec9 37 DigitalOut& getLed2(){return mNfcLed2;}
giovannivisentini 0:674813bd5ec9 38 DigitalOut& getLed3(){return mNfcLed3;}
giovannivisentini 0:674813bd5ec9 39
giovannivisentini 0:674813bd5ec9 40 M24SR& getM24SR(){return mM24SR;}
giovannivisentini 0:674813bd5ec9 41
giovannivisentini 0:674813bd5ec9 42 virtual ~X_NUCLEO_NFC01A1(){}
giovannivisentini 0:674813bd5ec9 43
giovannivisentini 0:674813bd5ec9 44 private:
giovannivisentini 0:674813bd5ec9 45
giovannivisentini 0:674813bd5ec9 46 M24SR mM24SR;
giovannivisentini 0:674813bd5ec9 47 DigitalOut mNfcLed1;
giovannivisentini 0:674813bd5ec9 48 DigitalOut mNfcLed2;
giovannivisentini 0:674813bd5ec9 49 DigitalOut mNfcLed3;
giovannivisentini 0:674813bd5ec9 50
giovannivisentini 0:674813bd5ec9 51 };
giovannivisentini 0:674813bd5ec9 52
giovannivisentini 0:674813bd5ec9 53 #endif /* X_NUCLEO_NFC01A1_H_ */
giovannivisentini 0:674813bd5ec9 54