Complete mbed library/workspace for HelloWorld_NFC02A1

Dependencies:   NDefLib X_NUCLEO_NFC02A1 mbed

Fork of HelloWorld_NFC02A1 by ST Expansion SW Team

X-NUCLEO-NFC02A1 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-NFC02A1 Dynamic NFC Tag Expansion Board based on M24LR.

Example Application

This is just a simple "hello world" style program for the X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board. The program writes a URI link to the M24LR dynamic tag using the synchronous programming model. It then reads back the URI from the tag to display it on terminal. The URI can also be retrieved from an NFC enabled smartphone/tablet.

Committer:
rosarium
Date:
Wed Jul 27 09:25:33 2016 +0000
Revision:
0:892175366555
first release of the complete mbed library for HelloWorld_NFC02A1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rosarium 0:892175366555 1 /**
rosarium 0:892175366555 2 ******************************************************************************
rosarium 0:892175366555 3 * @file lib_NDEF_URI.h
rosarium 0:892175366555 4 * @author MMY Application Team
rosarium 0:892175366555 5 * @version $Revision: 1582 $
rosarium 0:892175366555 6 * @date $Date: 2016-02-03 15:06:14 +0100 (Wed, 03 Feb 2016) $
rosarium 0:892175366555 7 * @brief This file help to manage URI NDEF file.
rosarium 0:892175366555 8 ******************************************************************************
rosarium 0:892175366555 9 * @attention
rosarium 0:892175366555 10 *
rosarium 0:892175366555 11 * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
rosarium 0:892175366555 12 *
rosarium 0:892175366555 13 * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
rosarium 0:892175366555 14 * You may not use this file except in compliance with the License.
rosarium 0:892175366555 15 * You may obtain a copy of the License at:
rosarium 0:892175366555 16 *
rosarium 0:892175366555 17 * http://www.st.com/myliberty
rosarium 0:892175366555 18 *
rosarium 0:892175366555 19 * Unless required by applicable law or agreed to in writing, software
rosarium 0:892175366555 20 * distributed under the License is distributed on an "AS IS" BASIS,
rosarium 0:892175366555 21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
rosarium 0:892175366555 22 * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
rosarium 0:892175366555 23 * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
rosarium 0:892175366555 24 * See the License for the specific language governing permissions and
rosarium 0:892175366555 25 * limitations under the License.
rosarium 0:892175366555 26 *
rosarium 0:892175366555 27 ******************************************************************************
rosarium 0:892175366555 28 */
rosarium 0:892175366555 29
rosarium 0:892175366555 30 /* Define to prevent recursive inclusion -------------------------------------*/
rosarium 0:892175366555 31 #ifndef __LIB_NDEF_URI_H
rosarium 0:892175366555 32 #define __LIB_NDEF_URI_H
rosarium 0:892175366555 33
rosarium 0:892175366555 34
rosarium 0:892175366555 35
rosarium 0:892175366555 36 /* Includes ------------------------------------------------------------------*/
rosarium 0:892175366555 37 #include "lib_NDEF.h"
rosarium 0:892175366555 38 #include "m24lr.h"
rosarium 0:892175366555 39 typedef struct
rosarium 0:892175366555 40 {
rosarium 0:892175366555 41 char protocol[80];
rosarium 0:892175366555 42 char URI_Message[400];
rosarium 0:892175366555 43 char Information[400];
rosarium 0:892175366555 44 }sURI_Info;
rosarium 0:892175366555 45
rosarium 0:892175366555 46 typedef struct sRecordInfo sRecordInfo_t;
rosarium 0:892175366555 47
rosarium 0:892175366555 48 class NDEF_URI : public NDEF
rosarium 0:892175366555 49 {
rosarium 0:892175366555 50 public:
rosarium 0:892175366555 51 uint16_t NDEF_ReadURI(sRecordInfo *pRecordStruct, sURI_Info *pURI);
rosarium 0:892175366555 52 uint16_t NDEF_WriteURI(sURI_Info *pURI);
rosarium 0:892175366555 53 void NDEF_Parse_WellKnowType( sRecordInfo *pRecordStruct, sURI_Info* pURI );
rosarium 0:892175366555 54
rosarium 0:892175366555 55 virtual NFCTAG_StatusTypeDef NFCTAG_ReadData( uint8_t * const pData, const uint16_t TarAddr, const uint16_t Size );
rosarium 0:892175366555 56 virtual NFCTAG_StatusTypeDef NFCTAG_WriteData( const uint8_t * const pData, const uint16_t TarAddr, const uint16_t Size );
rosarium 0:892175366555 57
rosarium 0:892175366555 58 void NDEF_PrepareURIMessage( sURI_Info *pURI, uint8_t *pNDEFMessage, uint16_t *size );
rosarium 0:892175366555 59 char getUriType( char *protocol );
rosarium 0:892175366555 60
rosarium 0:892175366555 61 NFCTAG_StatusTypeDef (*ReadDataPtr)( uint8_t * const pData, const uint16_t TarAddr, const uint16_t NbByte );
rosarium 0:892175366555 62 NFCTAG_StatusTypeDef (*WriteDataPtr)( const uint8_t * const pData, const uint16_t TarAddr, const uint16_t NbByte );
rosarium 0:892175366555 63
rosarium 0:892175366555 64 void setM24LR (M24LR *m24LRr) {mM24LRp=m24LRr; }
rosarium 0:892175366555 65 M24LR *mM24LRp;
rosarium 0:892175366555 66
rosarium 0:892175366555 67 };
rosarium 0:892175366555 68
rosarium 0:892175366555 69
rosarium 0:892175366555 70 #endif /* __LIB_NDEF_URI_H */
rosarium 0:892175366555 71
rosarium 0:892175366555 72 /******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/