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

Committer:
giovannivisentini
Date:
Thu Dec 03 13:44:06 2015 +0000
Revision:
0:969a2be49f41
Child:
9:9f2e2e68d695
move the driver files in a separate library

Who changed what in which revision?

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