Fork for the GitHub
NDEFcommon.h@0:de13951f30f6, 2019-11-14 (annotated)
- Committer:
- DiegoOstuni
- Date:
- Thu Nov 14 10:34:11 2019 +0000
- Revision:
- 0:de13951f30f6
Add files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DiegoOstuni | 0:de13951f30f6 | 1 | /** |
DiegoOstuni | 0:de13951f30f6 | 2 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 3 | * @file common.h |
DiegoOstuni | 0:de13951f30f6 | 4 | * @author MMY Application Team |
DiegoOstuni | 0:de13951f30f6 | 5 | * @version $Revision: 3343 $ |
DiegoOstuni | 0:de13951f30f6 | 6 | * @date $Date: 2017-01-24 16:07:22 +0100 (Tue, 24 Jan 2017) $ |
DiegoOstuni | 0:de13951f30f6 | 7 | * @brief Header for main.c module |
DiegoOstuni | 0:de13951f30f6 | 8 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 9 | * @attention |
DiegoOstuni | 0:de13951f30f6 | 10 | * |
DiegoOstuni | 0:de13951f30f6 | 11 | * <h2><center>© COPYRIGHT 2017 STMicroelectronics</center></h2> |
DiegoOstuni | 0:de13951f30f6 | 12 | * |
DiegoOstuni | 0:de13951f30f6 | 13 | * Licensed under MMY-ST Liberty SW License Agreement V2, (the "License"); |
DiegoOstuni | 0:de13951f30f6 | 14 | * You may not use this file except in compliance with the License. |
DiegoOstuni | 0:de13951f30f6 | 15 | * You may obtain a copy of the License at: |
DiegoOstuni | 0:de13951f30f6 | 16 | * |
DiegoOstuni | 0:de13951f30f6 | 17 | * http://www.st.com/software_license_agreement_liberty_v2 |
DiegoOstuni | 0:de13951f30f6 | 18 | * |
DiegoOstuni | 0:de13951f30f6 | 19 | * Unless required by applicable law or agreed to in writing, software |
DiegoOstuni | 0:de13951f30f6 | 20 | * distributed under the License is distributed on an "AS IS" BASIS, |
DiegoOstuni | 0:de13951f30f6 | 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
DiegoOstuni | 0:de13951f30f6 | 22 | * See the License for the specific language governing permissions and |
DiegoOstuni | 0:de13951f30f6 | 23 | * limitations under the License. |
DiegoOstuni | 0:de13951f30f6 | 24 | * |
DiegoOstuni | 0:de13951f30f6 | 25 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 26 | */ |
DiegoOstuni | 0:de13951f30f6 | 27 | |
DiegoOstuni | 0:de13951f30f6 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 29 | #ifndef __COMMON_H |
DiegoOstuni | 0:de13951f30f6 | 30 | #define __COMMON_H |
DiegoOstuni | 0:de13951f30f6 | 31 | |
DiegoOstuni | 0:de13951f30f6 | 32 | /* Includes ------------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 33 | //#include "x_nucleo_nfc04a1_nfctag.h" |
DiegoOstuni | 0:de13951f30f6 | 34 | #include <string.h> |
DiegoOstuni | 0:de13951f30f6 | 35 | #include "stdint.h" |
DiegoOstuni | 0:de13951f30f6 | 36 | |
DiegoOstuni | 0:de13951f30f6 | 37 | /* Exported types ------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 38 | //typedef uint8_t boolean; |
DiegoOstuni | 0:de13951f30f6 | 39 | |
DiegoOstuni | 0:de13951f30f6 | 40 | /** |
DiegoOstuni | 0:de13951f30f6 | 41 | * @brief GPO status information structure definition |
DiegoOstuni | 0:de13951f30f6 | 42 | */ |
DiegoOstuni | 0:de13951f30f6 | 43 | typedef struct |
DiegoOstuni | 0:de13951f30f6 | 44 | { |
DiegoOstuni | 0:de13951f30f6 | 45 | uint8_t WritenEEPROM; |
DiegoOstuni | 0:de13951f30f6 | 46 | uint8_t RfBusy; |
DiegoOstuni | 0:de13951f30f6 | 47 | uint8_t FieldOn; |
DiegoOstuni | 0:de13951f30f6 | 48 | uint8_t FieldOff; |
DiegoOstuni | 0:de13951f30f6 | 49 | uint8_t MsgInMailbox; |
DiegoOstuni | 0:de13951f30f6 | 50 | uint8_t MailboxMsgRead; |
DiegoOstuni | 0:de13951f30f6 | 51 | uint8_t RfInterrupt; |
DiegoOstuni | 0:de13951f30f6 | 52 | uint8_t Rfuser; |
DiegoOstuni | 0:de13951f30f6 | 53 | } IT_GPO_STATUS; |
DiegoOstuni | 0:de13951f30f6 | 54 | |
DiegoOstuni | 0:de13951f30f6 | 55 | /* Exported macro ------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 56 | #ifndef MIN |
DiegoOstuni | 0:de13951f30f6 | 57 | #define MIN(x, y) (((x) < (y)) ? (x) : (y)) |
DiegoOstuni | 0:de13951f30f6 | 58 | #endif |
DiegoOstuni | 0:de13951f30f6 | 59 | |
DiegoOstuni | 0:de13951f30f6 | 60 | /* |
DiegoOstuni | 0:de13951f30f6 | 61 | #undef FAIL |
DiegoOstuni | 0:de13951f30f6 | 62 | #define FAIL 0 |
DiegoOstuni | 0:de13951f30f6 | 63 | |
DiegoOstuni | 0:de13951f30f6 | 64 | #undef PASS |
DiegoOstuni | 0:de13951f30f6 | 65 | #define PASS !FAIL |
DiegoOstuni | 0:de13951f30f6 | 66 | */ |
DiegoOstuni | 0:de13951f30f6 | 67 | |
DiegoOstuni | 0:de13951f30f6 | 68 | #define NFCTAG_4K_SIZE ((uint32_t) 0x200) |
DiegoOstuni | 0:de13951f30f6 | 69 | #define NFCTAG_16K_SIZE ((uint32_t) 0x800) |
DiegoOstuni | 0:de13951f30f6 | 70 | #define NFCTAG_64K_SIZE ((uint32_t) 0x2000) |
DiegoOstuni | 0:de13951f30f6 | 71 | |
DiegoOstuni | 0:de13951f30f6 | 72 | /* Exported constants --------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 73 | #define MAX_NDEF_MEM 0x200 |
DiegoOstuni | 0:de13951f30f6 | 74 | #define ST25DV_MAX_SIZE NFCTAG_4K_SIZE |
DiegoOstuni | 0:de13951f30f6 | 75 | #define ST25DV_NDEF_MAX_SIZE MIN(ST25DV_MAX_SIZE,MAX_NDEF_MEM) |
DiegoOstuni | 0:de13951f30f6 | 76 | #define NFC_DEVICE_MAX_NDEFMEMORY ST25DV_NDEF_MAX_SIZE |
DiegoOstuni | 0:de13951f30f6 | 77 | |
DiegoOstuni | 0:de13951f30f6 | 78 | #define RESULTOK 0x00 |
DiegoOstuni | 0:de13951f30f6 | 79 | #define ERRORCODE_GENERIC 1 |
DiegoOstuni | 0:de13951f30f6 | 80 | |
DiegoOstuni | 0:de13951f30f6 | 81 | /* Exported functions ------------------------------------------------------- */ |
DiegoOstuni | 0:de13951f30f6 | 82 | |
DiegoOstuni | 0:de13951f30f6 | 83 | #endif /* __COMMON_H */ |
DiegoOstuni | 0:de13951f30f6 | 84 | |
DiegoOstuni | 0:de13951f30f6 | 85 | /************************ (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/ |