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