X_NUCLEO_NFC02A1 library for M24LR

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_NFC02A1_mbedOS HelloWorld_NFC02A1laatste HelloWorld_NFC02A1

Fork of X_NUCLEO_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.

Firmware Library

Class X_NUCLEO_NFC02A1 is intended to represent the Dynamic NFC Tag Expansion Board with the same name.
It provides an API to access to the M24LR component and to the three onboard LEDs.
It is intentionally implemented as a singleton because only one X_NUCLEO_NFC02A1 at a time might be deployed in a HW component stack.
The library also provides an implementation of the NDEF library API for M24LR, providing an simple way to read/write NDEF formatted messages from/to the M24LR dynamic NFC tag.

Example application

Hello World is a simple application to program and read an URI from the NFC tag.

Committer:
rosarium
Date:
Wed Sep 28 11:30:09 2016 +0000
Revision:
0:71bff5ad0a49
X_NUCLEO_NFC02A1 converted as an library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rosarium 0:71bff5ad0a49 1 /**
rosarium 0:71bff5ad0a49 2 ******************************************************************************
rosarium 0:71bff5ad0a49 3 * @file component.h
rosarium 0:71bff5ad0a49 4 * @author AST
rosarium 0:71bff5ad0a49 5 * @version V1.0.0
rosarium 0:71bff5ad0a49 6 * @date 1 April 2015
rosarium 0:71bff5ad0a49 7 * @brief Header file containing generic component definitions
rosarium 0:71bff5ad0a49 8 * and I/O functions.
rosarium 0:71bff5ad0a49 9 ******************************************************************************
rosarium 0:71bff5ad0a49 10 * @attention
rosarium 0:71bff5ad0a49 11 *
rosarium 0:71bff5ad0a49 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
rosarium 0:71bff5ad0a49 13 *
rosarium 0:71bff5ad0a49 14 * Redistribution and use in source and binary forms, with or without modification,
rosarium 0:71bff5ad0a49 15 * are permitted provided that the following conditions are met:
rosarium 0:71bff5ad0a49 16 * 1. Redistributions of source code must retain the above copyright notice,
rosarium 0:71bff5ad0a49 17 * this list of conditions and the following disclaimer.
rosarium 0:71bff5ad0a49 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
rosarium 0:71bff5ad0a49 19 * this list of conditions and the following disclaimer in the documentation
rosarium 0:71bff5ad0a49 20 * and/or other materials provided with the distribution.
rosarium 0:71bff5ad0a49 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
rosarium 0:71bff5ad0a49 22 * may be used to endorse or promote products derived from this software
rosarium 0:71bff5ad0a49 23 * without specific prior written permission.
rosarium 0:71bff5ad0a49 24 *
rosarium 0:71bff5ad0a49 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
rosarium 0:71bff5ad0a49 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
rosarium 0:71bff5ad0a49 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
rosarium 0:71bff5ad0a49 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
rosarium 0:71bff5ad0a49 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
rosarium 0:71bff5ad0a49 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
rosarium 0:71bff5ad0a49 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
rosarium 0:71bff5ad0a49 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
rosarium 0:71bff5ad0a49 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
rosarium 0:71bff5ad0a49 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rosarium 0:71bff5ad0a49 35 *
rosarium 0:71bff5ad0a49 36 ******************************************************************************
rosarium 0:71bff5ad0a49 37 */
rosarium 0:71bff5ad0a49 38
rosarium 0:71bff5ad0a49 39
rosarium 0:71bff5ad0a49 40 /* Prevent recursive inclusion -----------------------------------------------*/
rosarium 0:71bff5ad0a49 41
rosarium 0:71bff5ad0a49 42 #ifndef __COMPONENT_H__
rosarium 0:71bff5ad0a49 43 #define __COMPONENT_H__
rosarium 0:71bff5ad0a49 44
rosarium 0:71bff5ad0a49 45
rosarium 0:71bff5ad0a49 46 /* Types ---------------------------------------------------------------------*/
rosarium 0:71bff5ad0a49 47
rosarium 0:71bff5ad0a49 48 /**
rosarium 0:71bff5ad0a49 49 * @brief Component's Context structure definition.
rosarium 0:71bff5ad0a49 50 */
rosarium 0:71bff5ad0a49 51 typedef struct
rosarium 0:71bff5ad0a49 52 {
rosarium 0:71bff5ad0a49 53 /* Identity. */
rosarium 0:71bff5ad0a49 54 uint8_t who_am_i;
rosarium 0:71bff5ad0a49 55
rosarium 0:71bff5ad0a49 56 /* ACTION ----------------------------------------------------------------*/
rosarium 0:71bff5ad0a49 57 /* There should be only a unique identifier for each component, which */
rosarium 0:71bff5ad0a49 58 /* should be the "who_am_i" parameter, hence this parameter is optional. */
rosarium 0:71bff5ad0a49 59 /* -----------------------------------------------------------------------*/
rosarium 0:71bff5ad0a49 60 /* Type. */
rosarium 0:71bff5ad0a49 61 uint8_t type;
rosarium 0:71bff5ad0a49 62
rosarium 0:71bff5ad0a49 63 /* Configuration. */
rosarium 0:71bff5ad0a49 64 uint8_t address;
rosarium 0:71bff5ad0a49 65
rosarium 0:71bff5ad0a49 66 /* Pointer to the Data. */
rosarium 0:71bff5ad0a49 67 void *pData;
rosarium 0:71bff5ad0a49 68
rosarium 0:71bff5ad0a49 69 /* Pointer to the Virtual Table. */
rosarium 0:71bff5ad0a49 70 void *pVTable;
rosarium 0:71bff5ad0a49 71
rosarium 0:71bff5ad0a49 72 /* ACTION ----------------------------------------------------------------*/
rosarium 0:71bff5ad0a49 73 /* There should be only a unique virtual table for each component, which */
rosarium 0:71bff5ad0a49 74 /* should be the "pVTable" parameter, hence this parameter is optional. */
rosarium 0:71bff5ad0a49 75 /* -----------------------------------------------------------------------*/
rosarium 0:71bff5ad0a49 76 /* Pointer to the Extended Virtual Table. */
rosarium 0:71bff5ad0a49 77 void *pExtVTable;
rosarium 0:71bff5ad0a49 78 } DrvContextTypeDef;
rosarium 0:71bff5ad0a49 79
rosarium 0:71bff5ad0a49 80 /**
rosarium 0:71bff5ad0a49 81 * @brief Component's Status enumerator definition.
rosarium 0:71bff5ad0a49 82 */
rosarium 0:71bff5ad0a49 83 typedef enum
rosarium 0:71bff5ad0a49 84 {
rosarium 0:71bff5ad0a49 85 COMPONENT_OK = 0,
rosarium 0:71bff5ad0a49 86 COMPONENT_ERROR,
rosarium 0:71bff5ad0a49 87 COMPONENT_TIMEOUT,
rosarium 0:71bff5ad0a49 88 COMPONENT_NOT_IMPLEMENTED
rosarium 0:71bff5ad0a49 89 } DrvStatusTypeDef;
rosarium 0:71bff5ad0a49 90
rosarium 0:71bff5ad0a49 91 #endif