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
first commit,

Who changed what in which revision?

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