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 ST Expansion SW Team

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

Files at this revision

API Documentation at this revision

Comitter:
giovannivisentini
Date:
Fri Jan 15 11:02:30 2016 +0000
Parent:
14:7e3d436b19ee
Child:
16:b0d62f4b185a
Commit message:
move the NFC_InitTypeDef struct as M24SR_InitTypeDef

Changed in this revision

Common/nfc.h Show annotated file Show diff for this revision Revisions of this file
m24sr/m24sr.h Show annotated file Show diff for this revision Revisions of this file
m24sr/m24sr_class.cpp Show annotated file Show diff for this revision Revisions of this file
m24sr/m24sr_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/Common/nfc.h	Fri Jan 15 10:34:39 2016 +0000
+++ b/Common/nfc.h	Fri Jan 15 11:02:30 2016 +0000
@@ -62,10 +62,6 @@
  */
 
 /**
- * @brief  NFC init structure definition
- */
-typedef void* NFC_InitTypeDef;
-/**
  * @brief  NFC status enumerator definition
  */
 typedef enum {
@@ -116,7 +112,7 @@
  */
 typedef struct {
 	/* Generic */
-	NFC_StatusTypeDef (*Init)      (void *handle, NFC_InitTypeDef *init);
+	NFC_StatusTypeDef (*Init)      (void *handle, void *init);
 	NFC_StatusTypeDef (*ReadID)    (void *handle, uint8_t *id);
 
 	/* Interrupts */
--- a/m24sr/m24sr.h	Fri Jan 15 10:34:39 2016 +0000
+++ b/m24sr/m24sr.h	Fri Jan 15 11:02:30 2016 +0000
@@ -264,6 +264,8 @@
 	uint8_t uDIDbyte;
 } M24SR_DrvDataTypeDef;
 
+typedef void* M24SR_InitTypeDef;
+
 extern NFC_StatusTypeDef M24SR_IO_Init(void *handle);
 extern NFC_StatusTypeDef M24SR_IO_IsAnswerReady(void *handle);
 extern NFC_StatusTypeDef M24SR_IO_SendI2Ccommand(void *handle, uint8_t NbByte,
--- a/m24sr/m24sr_class.cpp	Fri Jan 15 10:34:39 2016 +0000
+++ b/m24sr/m24sr_class.cpp	Fri Jan 15 11:02:30 2016 +0000
@@ -344,7 +344,7 @@
  * @brief  This function initialize the M24SR device
  * @retval None
  */
-NFC_StatusTypeDef M24SR::M24SR_Init(NFC_InitTypeDef *notUsed) {
+NFC_StatusTypeDef M24SR::M24SR_Init(M24SR_InitTypeDef *notUsed) {
 	(void) notUsed;
 
 	errchk(M24SR_KillSession())
--- a/m24sr/m24sr_class.h	Fri Jan 15 10:34:39 2016 +0000
+++ b/m24sr/m24sr_class.h	Fri Jan 15 11:02:30 2016 +0000
@@ -111,7 +111,7 @@
      * @return NFC_SUCCESS if no errors
 	 */
 	virtual int Init(void *ptr) {
-		return (NFC_StatusTypeDef) M24SR_Init((NFC_InitTypeDef*)ptr);
+		return (NFC_StatusTypeDef) M24SR_Init((M24SR_InitTypeDef*)ptr);
 	}
 
 	virtual int ReadID(uint8_t *id) {
@@ -324,7 +324,7 @@
 
 	/*** Protected Component Related Methods ***/
 
-	NFC_StatusTypeDef M24SR_Init(NFC_InitTypeDef *);
+	NFC_StatusTypeDef M24SR_Init(M24SR_InitTypeDef *);
 	NFC_StatusTypeDef M24SR_ReadID(uint8_t *nfc_id);
 	NFC_StatusTypeDef M24SR_GetSession(void);
 	NFC_StatusTypeDef M24SR_KillSession(void);