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:
Fri Nov 27 15:10:25 2015 +0000
Revision:
1:6d202b62ed68
Parent:
0:674813bd5ec9
add the enable/disable read/write function

Who changed what in which revision?

UserRevisionLine numberNew contents of line
giovannivisentini 1:6d202b62ed68 1 /**
giovannivisentini 1:6d202b62ed68 2 ******************************************************************************
giovannivisentini 1:6d202b62ed68 3 * @file Component_class.h
giovannivisentini 1:6d202b62ed68 4 * @author AST / EST
giovannivisentini 1:6d202b62ed68 5 * @version V0.0.1
giovannivisentini 1:6d202b62ed68 6 * @date 13-April-2015
giovannivisentini 1:6d202b62ed68 7 * @brief This file contains the abstract class describing the interface of a
giovannivisentini 1:6d202b62ed68 8 * generic component.
giovannivisentini 1:6d202b62ed68 9 ******************************************************************************
giovannivisentini 1:6d202b62ed68 10 * @attention
giovannivisentini 1:6d202b62ed68 11 *
giovannivisentini 1:6d202b62ed68 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
giovannivisentini 1:6d202b62ed68 13 *
giovannivisentini 1:6d202b62ed68 14 * Redistribution and use in source and binary forms, with or without modification,
giovannivisentini 1:6d202b62ed68 15 * are permitted provided that the following conditions are met:
giovannivisentini 1:6d202b62ed68 16 * 1. Redistributions of source code must retain the above copyright notice,
giovannivisentini 1:6d202b62ed68 17 * this list of conditions and the following disclaimer.
giovannivisentini 1:6d202b62ed68 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
giovannivisentini 1:6d202b62ed68 19 * this list of conditions and the following disclaimer in the documentation
giovannivisentini 1:6d202b62ed68 20 * and/or other materials provided with the distribution.
giovannivisentini 1:6d202b62ed68 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
giovannivisentini 1:6d202b62ed68 22 * may be used to endorse or promote products derived from this software
giovannivisentini 1:6d202b62ed68 23 * without specific prior written permission.
giovannivisentini 1:6d202b62ed68 24 *
giovannivisentini 1:6d202b62ed68 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
giovannivisentini 1:6d202b62ed68 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
giovannivisentini 1:6d202b62ed68 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
giovannivisentini 1:6d202b62ed68 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
giovannivisentini 1:6d202b62ed68 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
giovannivisentini 1:6d202b62ed68 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
giovannivisentini 1:6d202b62ed68 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
giovannivisentini 1:6d202b62ed68 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
giovannivisentini 1:6d202b62ed68 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
giovannivisentini 1:6d202b62ed68 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
giovannivisentini 1:6d202b62ed68 35 *
giovannivisentini 1:6d202b62ed68 36 ******************************************************************************
giovannivisentini 1:6d202b62ed68 37 */
giovannivisentini 1:6d202b62ed68 38
giovannivisentini 0:674813bd5ec9 39
giovannivisentini 1:6d202b62ed68 40 /* Define to prevent from recursive inclusion --------------------------------*/
giovannivisentini 1:6d202b62ed68 41
giovannivisentini 1:6d202b62ed68 42 #ifndef __COMPONENT_CLASS_H
giovannivisentini 1:6d202b62ed68 43 #define __COMPONENT_CLASS_H
giovannivisentini 1:6d202b62ed68 44
giovannivisentini 1:6d202b62ed68 45
giovannivisentini 1:6d202b62ed68 46 /* Includes ------------------------------------------------------------------*/
giovannivisentini 1:6d202b62ed68 47
giovannivisentini 1:6d202b62ed68 48 #include <stdint.h>
giovannivisentini 1:6d202b62ed68 49
giovannivisentini 1:6d202b62ed68 50
giovannivisentini 1:6d202b62ed68 51 /* Classes ------------------------------------------------------------------*/
giovannivisentini 1:6d202b62ed68 52
giovannivisentini 1:6d202b62ed68 53 /** An abstract class for Generic components.
giovannivisentini 1:6d202b62ed68 54 */
giovannivisentini 1:6d202b62ed68 55 class Component
giovannivisentini 1:6d202b62ed68 56 {
giovannivisentini 1:6d202b62ed68 57 public:
giovannivisentini 1:6d202b62ed68 58 /**
giovannivisentini 1:6d202b62ed68 59 * @brief Initialization of the component.
giovannivisentini 1:6d202b62ed68 60 * @param[out] ptr Pointer to device specific initalization structure.
giovannivisentini 1:6d202b62ed68 61 * @return 0 in case of success, an error code otherwise.
giovannivisentini 1:6d202b62ed68 62 */
giovannivisentini 1:6d202b62ed68 63 virtual int Init(void *ptr) = 0;
giovannivisentini 1:6d202b62ed68 64
giovannivisentini 1:6d202b62ed68 65 /**
giovannivisentini 1:6d202b62ed68 66 * @brief Get ID of the component.
giovannivisentini 1:6d202b62ed68 67 * @param[out] id Pointer to where to store the ID to.
giovannivisentini 1:6d202b62ed68 68 * @return 0 in case of success, an error code otherwise.
giovannivisentini 1:6d202b62ed68 69 */
giovannivisentini 1:6d202b62ed68 70 virtual int ReadID(uint8_t *id) = 0;
giovannivisentini 1:6d202b62ed68 71
giovannivisentini 1:6d202b62ed68 72 virtual ~Component(){};
giovannivisentini 1:6d202b62ed68 73 };
giovannivisentini 1:6d202b62ed68 74
giovannivisentini 1:6d202b62ed68 75 #endif /* __COMPONENT_CLASS_H */
giovannivisentini 1:6d202b62ed68 76
giovannivisentini 1:6d202b62ed68 77 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/