/*---------------------------------------------------------------------------* Project: Cafe File: nfc.h Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __NFC_H__ #define __NFC_H__ #include #include #ifdef __cplusplus extern "C" { #endif /*************************************/ /* Error Code */ /*************************************/ #define NFC_ERR_BASE (-5000) enum { NFC_ERR_NONE = 0, // No error. NFC_ERR_INIT = NFC_ERR_BASE, // An error occurred during initialization. NFC_ERR_NOT_INIT, // Error from an uninitialized NFC module. NFC_ERR_TIMEOUT, // Configured timeout occurred. NFC_ERR_INVALID_COMMAND, // Error that occurs if an invalid command is issued. NFC_ERR_INVALID_TAG, // Detected an invalid tag. NFC_ERR_GET_TAG_INFO, // GetTagInfo function error. NFC_ERR_ABORT , // Error caused by aborted processing. NFC_ERR_OTHER, // Other error. NFC_ERR_GET_TAG_INFO_MULTI, // GetTagInfoMulti function error. }; typedef s32 NFCError; // Definition of NFC tag information. #define NFC_MAX_UID_SIZE (10) #define NFC_POLL_TYPE_A (0x00) #define NFC_POLL_TYPE_B (0x01) #define NFC_POLL_TYPE_F (0x02) #define NFC_POLL_TYPE_15693 (0x06) #define NFC_TYPE_1_TAG (0x01) #define NFC_TYPE_2_TAG (0x02) #define NFC_TYPE_3_TAG (0x03) #define NFC_TYPE_4_TAG (0x04) #define NFC_TYPE_ISO_15693 (0x83) typedef struct { u8 uid_len ; u8 uid[NFC_MAX_UID_SIZE]; u8 rf_mode ; u8 tag_type ; u8 reserved[32]; } NFCTagInfo; typedef void (*NFCGetTagInfoCallback)(s32 chan, NFCError errorCode, const NFCTagInfo* tagInfo, void* userData ); typedef void (*NFCGetTagInfoMultiCallback)(s32 chan, NFCError errorCode, u8 tagNum, const NFCTagInfo* tagInfo1, const NFCTagInfo* tagInfo2, const NFCTagInfo* tagInfo3, void* userData ); NFCError NFCGetTagInfo(s32 chan, u16 polling_time, NFCGetTagInfoCallback callback, void* userData) ; NFCError NFCGetTagInfoMulti(s32 chan, u16 polling_time, NFCGetTagInfoMultiCallback callback, void* userData) ; #ifdef __cplusplus } #endif #endif // __NFC_H__