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
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 .
Interfaces/Component_class.h@0:674813bd5ec9, 2015-11-19 (annotated)
- Committer:
- giovannivisentini
- Date:
- Thu Nov 19 08:50:18 2015 +0000
- Revision:
- 0:674813bd5ec9
- Child:
- 1:6d202b62ed68
first commit,
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| giovannivisentini | 0:674813bd5ec9 | 1 | /** |
| giovannivisentini | 0:674813bd5ec9 | 2 | ****************************************************************************** |
| giovannivisentini | 0:674813bd5ec9 | 3 | * @file Component_class.h |
| giovannivisentini | 0:674813bd5ec9 | 4 | * @author AST / EST |
| giovannivisentini | 0:674813bd5ec9 | 5 | * @version V0.0.1 |
| giovannivisentini | 0:674813bd5ec9 | 6 | * @date 13-April-2015 |
| giovannivisentini | 0:674813bd5ec9 | 7 | * @brief This file contains the abstract class describing the interface of a |
| giovannivisentini | 0:674813bd5ec9 | 8 | * generic component. |
| giovannivisentini | 0:674813bd5ec9 | 9 | ****************************************************************************** |
| giovannivisentini | 0:674813bd5ec9 | 10 | * @attention |
| giovannivisentini | 0:674813bd5ec9 | 11 | * |
| giovannivisentini | 0:674813bd5ec9 | 12 | * <h2><center>© 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 | /* Define to prevent from recursive inclusion --------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 41 | |
| giovannivisentini | 0:674813bd5ec9 | 42 | #ifndef __COMPONENT_CLASS_H |
| giovannivisentini | 0:674813bd5ec9 | 43 | #define __COMPONENT_CLASS_H |
| giovannivisentini | 0:674813bd5ec9 | 44 | |
| giovannivisentini | 0:674813bd5ec9 | 45 | |
| giovannivisentini | 0:674813bd5ec9 | 46 | /* Includes ------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 47 | |
| giovannivisentini | 0:674813bd5ec9 | 48 | #include <stdint.h> |
| giovannivisentini | 0:674813bd5ec9 | 49 | |
| giovannivisentini | 0:674813bd5ec9 | 50 | |
| giovannivisentini | 0:674813bd5ec9 | 51 | /* Classes ------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 52 | |
| giovannivisentini | 0:674813bd5ec9 | 53 | /** An abstract class for Generic components. |
| giovannivisentini | 0:674813bd5ec9 | 54 | */ |
| giovannivisentini | 0:674813bd5ec9 | 55 | class Component |
| giovannivisentini | 0:674813bd5ec9 | 56 | { |
| giovannivisentini | 0:674813bd5ec9 | 57 | public: |
| giovannivisentini | 0:674813bd5ec9 | 58 | /** |
| giovannivisentini | 0:674813bd5ec9 | 59 | * @brief Initialization of the component. |
| giovannivisentini | 0:674813bd5ec9 | 60 | * @param[out] ptr Pointer to device specific initalization structure. |
| giovannivisentini | 0:674813bd5ec9 | 61 | * @return 0 in case of success, an error code otherwise. |
| giovannivisentini | 0:674813bd5ec9 | 62 | */ |
| giovannivisentini | 0:674813bd5ec9 | 63 | virtual int Init(void *ptr) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 64 | |
| giovannivisentini | 0:674813bd5ec9 | 65 | /** |
| giovannivisentini | 0:674813bd5ec9 | 66 | * @brief Get ID of the component. |
| giovannivisentini | 0:674813bd5ec9 | 67 | * @param[out] id Pointer to where to store the ID to. |
| giovannivisentini | 0:674813bd5ec9 | 68 | * @return 0 in case of success, an error code otherwise. |
| giovannivisentini | 0:674813bd5ec9 | 69 | */ |
| giovannivisentini | 0:674813bd5ec9 | 70 | virtual int ReadID(uint8_t *id) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 71 | |
| giovannivisentini | 0:674813bd5ec9 | 72 | virtual ~Component(){}; |
| giovannivisentini | 0:674813bd5ec9 | 73 | }; |
| giovannivisentini | 0:674813bd5ec9 | 74 | |
| giovannivisentini | 0:674813bd5ec9 | 75 | #endif /* __COMPONENT_CLASS_H */ |
| giovannivisentini | 0:674813bd5ec9 | 76 | |
| giovannivisentini | 0:674813bd5ec9 | 77 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| giovannivisentini | 0:674813bd5ec9 | 78 |
