1 /* 2 * Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _NFC_H_ 17 #define _NFC_H_ 18 19 #include <stdio.h> 20 #include <stdint.h> 21 #include <stdbool.h> 22 23 /* 信息标记 */ 24 typedef enum { 25 NDEFFirstPos, /* 起始信息标记 */ 26 NDEFMiddlePos, /* 中间信息标记 */ 27 NDEFLastPos /* 结束信息标记 */ 28 } RecordPosEnu; 29 30 /*************************************************************** 31 * 函数名称: nfc_store_uri_http 32 * 说 明: 向NFC写入URI信息 33 * 参 数: 34 * @position:信息标识 35 * @http:需要写入的网络地址 36 * 返 回 值: 返回ture为成功,false为失败 37 ***************************************************************/ 38 bool nfc_store_uri_http(RecordPosEnu position, uint8_t *http); 39 40 41 /*************************************************************** 42 * 函数名称: nfc_store_text 43 * 说 明: 向NFC写入txt信息 44 * 参 数: 45 * @position:信息标识 46 * @http:需要写入的文本信息 47 * 返 回 值: 返回ture为成功,false为失败 48 ***************************************************************/ 49 bool nfc_store_text(RecordPosEnu position, uint8_t *text); 50 51 52 /*************************************************************** 53 * 函数名称: nfc_init 54 * 说 明: NFC初始化 55 * 参 数: 无 56 * 返 回 值: 返回0为成功,反之为失败 57 ***************************************************************/ 58 unsigned int nfc_init(void); 59 60 61 /*************************************************************** 62 * 函数名称: nfc_deinit 63 * 说 明: NFC销毁 64 * 参 数: 无 65 * 返 回 值: 返回0为成功,反之为失败 66 ***************************************************************/ 67 unsigned int nfc_deinit(void); 68 69 #endif