[Add] First commit
This commit is contained in:
@ -0,0 +1,56 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright 2017-2021 NXP */
|
||||
/* */
|
||||
/* NXP Confidential. This software is owned or controlled by NXP and may only */
|
||||
/* be used strictly in accordance with the applicable license terms. */
|
||||
/* By expressly accepting such terms or by downloading, installing, */
|
||||
/* activating and/or otherwise using the software, you are agreeing that you */
|
||||
/* have read, and that you agree to comply with and are bound by, such */
|
||||
/* license terms. If you do not agree to be bound by the applicable license */
|
||||
/* terms, then you may not retain, install, activate or otherwise use the */
|
||||
/* software. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \file
|
||||
* Example Source Header for Nfcrdlib_SimplifiedApi_ISO application.
|
||||
*
|
||||
* $Author: NXP $
|
||||
* $Revision: $ (v07.10.00)
|
||||
* $Date: $
|
||||
*/
|
||||
|
||||
#ifndef INTFS_NFCRDLIB_SIMPLIFIEDAPI_ISO_H_
|
||||
#define INTFS_NFCRDLIB_SIMPLIFIEDAPI_ISO_H_
|
||||
#include <phApp_Init.h>
|
||||
#include <Nfcrdlib_SimplifiedApi_ISO_15693.h>
|
||||
#include <Nfcrdlib_SimplifiedApi_ISO_18000.h>
|
||||
#include <Nfcrdlib_SimplifiedApi_ISO_MFUL.h>
|
||||
#include <Nfcrdlib_SimplifiedApi_ISO_MFC.h>
|
||||
|
||||
uint32_t NfcLib_MifareClassic_1k_Reference_app(void);
|
||||
uint32_t NfcLib_ISO18000p3m3_Reference_app(void);
|
||||
uint32_t NfcLib_ISO15693_Reference_app(void);
|
||||
uint32_t NfcLib_MifareDesfire_Reference_app(void);
|
||||
uint32_t NfcLib_MifareUltralight_Reference_app(void);
|
||||
uint32_t NfcLib_TypeB_Reference_app(void);
|
||||
uint32_t NfcLib_Layer4TypeA_Reference_app(void);
|
||||
|
||||
#ifdef PH_OSAL_FREERTOS
|
||||
#ifdef PHOSAL_FREERTOS_STATIC_MEM_ALLOCATION
|
||||
#define SIMPLIFIED_ISO_STACK (2200/4)
|
||||
#else /* PHOSAL_FREERTOS_STATIC_MEM_ALLOCATION */
|
||||
#if defined( __PN74XXXX__) || defined(__PN76XX__)
|
||||
#define SIMPLIFIED_ISO_STACK (2000/4)
|
||||
#else /* defined( __PN74XXXX__) || defined(__PN76XX__) */
|
||||
#define SIMPLIFIED_ISO_STACK (2050)
|
||||
#endif /* defined( __PN74XXXX__) || defined(__PN76XX__) */
|
||||
#endif /* PHOSAL_FREERTOS_STATIC_MEM_ALLOCATION*/
|
||||
#define SIMPLIFIED_ISO_PRIO 4
|
||||
#endif /* PH_OSAL_FREERTOS */
|
||||
|
||||
#ifdef PH_OSAL_LINUX
|
||||
#define SIMPLIFIED_ISO_PRIO 0
|
||||
#define SIMPLIFIED_ISO_STACK 0x20000
|
||||
#endif /* PH_OSAL_LINUX*/
|
||||
|
||||
#endif /* INTFS_NFCRDLIB_SIMPLIFIEDAPI_ISO_H_ */
|
||||
@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright 2017-2020, NXP
|
||||
*
|
||||
* All rights are reserved. Reproduction in whole or in part is
|
||||
* prohibited without the written consent of the copyright owner.
|
||||
* NXP reserves the right to make changes without notice at any time.
|
||||
* NXP makes no warranty, expressed, implied or statutory, including but
|
||||
* not limited to any implied warranty of merchantability or fitness for any
|
||||
*particular purpose, or that the use will not infringe any third party patent,
|
||||
* copyright or trademark. NXP must not be liable for any loss or damage
|
||||
* arising from its use.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Simplified API ISO15693.
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EX11_SIMPLIFIEDAPI_15693_H
|
||||
#define EX11_SIMPLIFIEDAPI_15693_H
|
||||
|
||||
/* Read Single Block takes the option and block num to read */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, bBlockNo can be 0x00 - 0xFF */
|
||||
#define READ_SINGLEBLOCK(bOpt, bBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_ReadSingleBlock; \
|
||||
}
|
||||
|
||||
/* Extended Read Single Block takes the option and block num to read the extended memory card*/
|
||||
/* bOpt can be #PH_ON or #PH_OFF, wBlockNo can be 0x00 - 0xFFFF */
|
||||
#define EXTENDEDREAD_SINGLEBLOCK(bOpt, wBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_ReadSingleBlock; \
|
||||
}
|
||||
|
||||
/* Read Multiple Block takes the option, block num and num of Blocks to Read*/
|
||||
/* Option can be #PH_ON or #PH_OFF, block bBlockNo can be 0x00 - 0xFF, wNumBlock can be 0x01 - 0x100 */
|
||||
#define READ_MULTIPLEBLOCK(bOpt, bBlockNo, wNumBlock) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_ReadMultipleBlocks; \
|
||||
}
|
||||
|
||||
/* Read Multiple Block takes the option, block num and num of Blocks to Read from the extended memory card */
|
||||
/* Option can be #PH_ON or #PH_OFF, block bBlockNo can be 0x00 - 0xFFFF, wNumBlock can be 0x01 - 0xFFFF */
|
||||
#define EXTENDEDREAD_MULTIPLEBLOCK(bOpt, wBlockNo, wNumBlock) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_ReadMultipleBlocks; \
|
||||
}
|
||||
|
||||
/* Get System Information takes no parameter and gets the system information */
|
||||
#define GET_SYSTEMINFORMATION() { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_GetSystemInformation; \
|
||||
}
|
||||
|
||||
/* Extended Get System Information takes no parameter and gets the system information for extended memory card */
|
||||
#define EXTENDEDGET_SYSTEMINFORMATION() { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_ExtendedGetSystemInformation; \
|
||||
}
|
||||
|
||||
/* Get Multiple Block Security status takes the Block no and num of blocks whose security status to be read */
|
||||
/* bBlockNo can be 0x00 - 0xFF and wNumBlock can be 0x01 - 0x100 */
|
||||
#define GET_MULTIPLEBLOCKSECURITYSTATUS(bBlockNo, wNumBlock) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_GetMultipleBlockSecurityStatus; \
|
||||
}
|
||||
|
||||
/* Extended Get Multiple Block Security status takes the Block no and num of blocks for extended memory whose security status to be read */
|
||||
/* wBlockNo can be 0x00 - 0xFFFF and wNumBlock can be 0x01 - 0xFFFF */
|
||||
#define EXTENDEDGET_MULTIPLEBLOCKSECURITYSTATUS(wBlockNo, wNumBlock) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_GetMultipleBlockSecurityStatus; \
|
||||
}
|
||||
|
||||
/* Write Single Block takes the option , block number and data to write */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, bBlockNo can be 0x00 - 0xFF, pData takes the pointer to the start of the data */
|
||||
#define WRITE_SINGLEBLOCK(bOpt, bBlockNo, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_WriteSingleBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.pBuffer = pData; \
|
||||
}
|
||||
|
||||
/* Extended Write Single Block takes the option , block number and data to write to a extended memory card */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, wBlockNo can be 0x00 - 0xFFFF, pData takes the pointer to the start of the data */
|
||||
#define EXTENDEDWRITE_SINGLEBLOCK(bOpt, wBlockNo, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_WriteSingleBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.pBuffer = pData; \
|
||||
}
|
||||
|
||||
/* Write Multiple Block takes the option , block number, number of blocks and data to write */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, bBlockNo can be 0x00 - 0xFF, wNumBlock can be 0x01 - 0x100, pData takes the pointer to the start of the data */
|
||||
#define WRITE_MULTIPLEBLOCK(bOpt, bBlockNo, wNumBlock, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_WriteMultipleBlocks; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.pBuffer = pData; \
|
||||
}
|
||||
|
||||
/* Extended Write Multiple Block takes the option , block number, number of blocks and data to write to a extended memory card */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, wBlockNo can be 0x00 - 0xFFFF, wNumBlock can be 0x01 - 0xFFFF, pData takes the pointer to the start of the data */
|
||||
#define EXTENDEDWRITE_MULTIPLEBLOCK(bOpt, wBlockNo, wNumBlock, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wNumBlocks = wNumBlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_WriteMultipleBlocks; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.pBuffer = pData; \
|
||||
}
|
||||
|
||||
/* Lock Block takes the option and block number to Lock */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, bBlockNo can be 0x00 - 0xFF */
|
||||
#define LOCK_BLOCK(bOpt, bBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_LockBlock; \
|
||||
}
|
||||
|
||||
/* Extended Lock Block takes the option and block number of Extended Memory Card to Lock */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, wBlockNo can be 0x00 - 0xFFFF */
|
||||
#define EXTENDEDLOCK_BLOCK(bOpt, wBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.wBlockNumber = wBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_Extended_LockBlock; \
|
||||
}
|
||||
|
||||
/* Write AFI takes the option and AFI to write */
|
||||
/* bOpt can be #PH_ON or #PH_OFF, bAFI can be any valid AFI value */
|
||||
#define WRITE_AFI(bOpt, bAFI) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bAfi = bAFI; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_WriteAFI; \
|
||||
}
|
||||
|
||||
/* Lock AFI takes the option with which to lock the AFI */
|
||||
/* bOpt can be #PH_ON or #PH_OFF */
|
||||
#define LOCK_AFI(bOpt) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_LockAFI; \
|
||||
}
|
||||
|
||||
/* Write DSFID takes the option and DSFID to write */
|
||||
/* bOpt can be #PH_ON or #PH_OFF and bDSFID can be any valid DSFID value */
|
||||
#define WRITE_DSFID(bOpt, bDSFID) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bDsfid = bDSFID; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_WriteDSFID; \
|
||||
}
|
||||
|
||||
/* Lock DSFID takes the option with which to lock the DSFID */
|
||||
/* bOpt can be #PH_ON or #PH_OFF */
|
||||
#define LOCK_DSFID(bOpt) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO15693.bCommand = ISO15693_LockDSFID; \
|
||||
}
|
||||
|
||||
#endif /* EX11_SIMPLIFIEDAPI_15693_H */
|
||||
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright 2017-2020, NXP
|
||||
*
|
||||
* All rights are reserved. Reproduction in whole or in part is
|
||||
* prohibited without the written consent of the copyright owner.
|
||||
* NXP reserves the right to make changes without notice at any time.
|
||||
* NXP makes no warranty, expressed, implied or statutory, including but
|
||||
* not limited to any implied warranty of merchantability or fitness for any
|
||||
*particular purpose, or that the use will not infringe any third party patent,
|
||||
* copyright or trademark. NXP must not be liable for any loss or damage
|
||||
* arising from its use.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Simplified API ISO 18000.
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EX11_SIMPLIFIEDAPI_ISO_18000_H
|
||||
#define EX11_SIMPLIFIEDAPI_ISO_18000_H
|
||||
|
||||
/* ACK does not take any parameter and uses the handle present in context */
|
||||
#define I18000_ACK() { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Ack; \
|
||||
}
|
||||
|
||||
/* REQRN takes the option with which to perform the REQRn Command */
|
||||
/* bOpt can be only PHAL_I18000P3M3_REQRN_USE_HANDLE here */
|
||||
#define I18000_REQRN(bOpt) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_ReqRn; \
|
||||
}
|
||||
|
||||
/* READ takes the Memory Bank to read, address of the word to read, length of the word ptr and No of words to read */
|
||||
/* bMembank can be 0x00 - 0x03 , pWordptr is user choice limited to tag memory size */
|
||||
/* bWordPtrLength can be 0x00 - 0x03 and depends on the TAG memory size , bWordcount is the number of words to read */
|
||||
#define I18000_READ(bMembank, pWordptr, bWordPtrlength, bWordcount) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bMemBank = bMembank; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pWordPtr = pWordptr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordPtrLength = bWordPtrlength; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordCount = bWordcount; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Read; \
|
||||
}
|
||||
|
||||
/* WRITE takes the option, Memory Bank to write, address of the word to write, length of the word ptr and Data to write */
|
||||
/* bOpt can be #PH_NFCLIB_18000P3M3_AC_NO_COVER_CODING or #PH_NFCLIB_18000P3M3_AC_USE_COVER_CODING, bMembank can be 0x00 - 0x03 */
|
||||
/* pWordptr is user choice limited to tag memory size, bWordPtrLength can be 0x00 - 0x03 and depends on the TAG memory size */
|
||||
/* pData is a 2 byte word to write */
|
||||
#define I18000_WRITE(bOpt, bMembank, pWordptr, bWordPtrlength, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bMemBank = bMembank; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pWordPtr = pWordptr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordPtrLength = bWordPtrlength; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pBuffer = pData; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Write; \
|
||||
}
|
||||
|
||||
/* KILL takes the option , the password for the kill and recommissioning option */
|
||||
/* bOpt can be #PH_NFCLIB_18000P3M3_AC_NO_COVER_CODING or #PH_NFCLIB_18000P3M3_AC_USE_COVER_CODING, pPassWord is a 4 byte password */
|
||||
/* bReCom can be any optional or mandatory support Recom option, value 0x04 is a mandatory support */
|
||||
#define I18000_KILL(bOpt, pPassWord, bReCom) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pPassword = pPassWord; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bRecom = bReCom; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Kill; \
|
||||
}
|
||||
|
||||
/* LOCK takes the Mask on which and the action with which to perform the Lock */
|
||||
/* pLockMask and pLockAction both are a 10-bit field please refer ISO 18000-3M3 for detailed value */
|
||||
#define I18000_LOCK(pLockMask, pLockAction) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pMask = pLockMask; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pAction = pLockAction; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Lock; \
|
||||
}
|
||||
|
||||
/* ACCESS takes the option and password for the Access */
|
||||
/* bOpt can be #PH_NFCLIB_18000P3M3_AC_NO_COVER_CODING or #PH_NFCLIB_18000P3M3_AC_USE_COVER_CODING, pPassWord is a 4 byte password */
|
||||
#define I18000_ACCESS(bOpt, pPassWord) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bOption = bOpt; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pPassword = pPassWord; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_Access; \
|
||||
}
|
||||
|
||||
/* BLOCKWRITE takes the Memory Bank to write ,address of the word,length of the word ptr, No of words and Data to write */
|
||||
/* bMembank can be 0x00 - 0x03, pWordptr is user choice limited to tag memory size, bWordPtrLen can be 0x00 - 0x03 and depends on the TAG memory size */
|
||||
/* bWordcount is the no of words to write and is card support specific, pData takes the data to write */
|
||||
#define I18000_BLOCKWRITE(bMembank, pWordptr, bWordPtrLen, bWordcount, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bMemBank = bMembank; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pWordPtr = pWordptr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordPtrLength = bWordPtrLen; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordCount = bWordcount; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pBuffer = pData; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_BlockWrite; \
|
||||
}
|
||||
|
||||
/* BLOCKERASE takes the Memory Bank to write ,address of the word,length of the word ptr and No of words to erase */
|
||||
/* bMembank can be 0x00 - 0x03, pWordptr is user choice limited to tag memory size */
|
||||
/* bWordPtrLen can be 0x00 - 0x03 and depends on the TAG memory size and No of words to erase is card support specific*/
|
||||
#define I18000_BLOCKERASE(bMembank, pWordptr, bWordPtrLen, bWordcount) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bMemBank = bMembank; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pWordPtr = pWordptr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordPtrLength = bWordPtrLen; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bWordCount = bWordcount; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_BlockErase; \
|
||||
}
|
||||
|
||||
/* BLOCKPERMALOCK takes the RFU, READ/LOCK choice, Memory Bank to PermaLock, starting address of the block and length of the block ptr, range of the block mask, and MemMask */
|
||||
/* bRFU is to be kept 0, bReadlock can be 0/1, bMembank can be 0x00 - 0x03, pBlockptr is user choice limited to tag memory size */
|
||||
/* bBlockPtrLen can be 0x00 - 0x03, bBlockrange depends on Tag Memory and pMemMask along with ReadLock depend upon 0/1 */
|
||||
#define I18000_BLOCKPERMALOCK(bRfu, bReadlock, bMembank, pBlockptr, bBlockPtrLen, bBlockrange, pMemMask) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bRFU = bRfu; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bReadLock = bReadlock; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bMemBank = bMembank; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pBlockPtr = pBlockptr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bBlockPtrLength = bBlockPtrLen; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bBlockRange = bBlockrange; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pMask = pMemMask; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_BlockPermaLock; \
|
||||
}
|
||||
|
||||
/* SETHANDLE takes the pointer to the handle */
|
||||
/* pHandlePtr is a 2 byte Handle return by the REQRN command */
|
||||
#define I18000_SETHANDLE(pHandlePtr) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.pHandle = pHandlePtr; \
|
||||
phNfcLib_TransmitInput.phNfcLib_ISO18000.bCommand = ISO18000_SetHandle; \
|
||||
}
|
||||
|
||||
#endif /* EX11_SIMPLIFIEDAPI_ISO_18000_H */
|
||||
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright 2017-2020, NXP
|
||||
*
|
||||
* All rights are reserved. Reproduction in whole or in part is
|
||||
* prohibited without the written consent of the copyright owner.
|
||||
* NXP reserves the right to make changes without notice at any time.
|
||||
* NXP makes no warranty, expressed, implied or statutory, including but
|
||||
* not limited to any implied warranty of merchantability or fitness for any
|
||||
*particular purpose, or that the use will not infringe any third party patent,
|
||||
* copyright or trademark. NXP must not be liable for any loss or damage
|
||||
* arising from its use.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Simplified API ISO MIFARE Classic contactless IC.
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EX11_SIMPLIFIEDAPI_MFC_H
|
||||
#define EX11_SIMPLIFIEDAPI_MFC_H
|
||||
|
||||
/* READ takes the block number to Read */
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size */
|
||||
#define MFC_READ(bBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Read; \
|
||||
}
|
||||
|
||||
/* WRITE takes the block number and data to Write */
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size and the pBlockData is the pointer to 16 bytes data */
|
||||
#define MFC_WRITE(bBlockNo, pBlockData) {\
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.pBuffer = pBlockData; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Write; \
|
||||
}
|
||||
|
||||
/* INCREMENT takes the block number of the value block and the value with which to increment the block */
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size and should be value block*/
|
||||
/* pValue takes pointer to a 4 byte value data */
|
||||
#define MFC_INCREMENT(bBlockNo, pValue) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.pBuffer = pValue; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Increment; \
|
||||
}
|
||||
|
||||
/* DECREMENT takes the block number of the value block and the value with which to decrement the block */
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size and should be value block*/
|
||||
/* pValue takes pointer to a 4 byte value data */
|
||||
#define MFC_DECREMENT(bBlockNo, pValue) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.pBuffer = pValue; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Decrement; \
|
||||
}
|
||||
|
||||
/* TRANSFER takes the block number of the value block where the transfer buffer should be transferred */
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size and should be value block*/
|
||||
#define MFC_TRANSFER(bBlockNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Transfer; \
|
||||
}
|
||||
|
||||
/* RESTORE takes the block number of the value block the transfer buffer shall be restored from*/
|
||||
/* bBlockNo can take any value between 0x00-0xFF depending upon card size and should be value block*/
|
||||
#define MFC_RESTORE(bBlockNo) {\
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Restore; \
|
||||
}
|
||||
|
||||
/* AUTHENTICATE takes the block number, key type, key number and key version of the Key with which to authenticate */
|
||||
/* bBlockNo can take any value between 0x00-0xFF constraint to card memory, bKeyType can be #PHAL_MFC_KEYA or #PHAL_MFC_KEYB */
|
||||
/* bKeyNumber and wKeyVersion of the Keystore depends upon the size of keystore and size is 2 for current settings */
|
||||
#define MFC_AUTHENTICATE(bBlockNo, bKeytype, bKeyNo, wKeyVersion) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bBlockNumber = bBlockNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bKeyType = bKeytype; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bKeyNumber = bKeyNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bKeyVersion = wKeyVersion; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareClassic.bCommand = Authenticate; \
|
||||
}
|
||||
|
||||
/* PERSONALIZEUID takes the UID type with which to personalize the presented card */
|
||||
/* bUidType can be PHAL_MFC_UID_TYPE_UIDF0 or PHAL_MFC_UID_TYPE_UIDF1 or PHAL_MFC_UID_TYPE_UIDF2 or PHAL_MFC_UID_TYPE_UIDF3 */
|
||||
#define MFC_PERSONALIZEUID(bUidType) { \
|
||||
}
|
||||
|
||||
#endif /* EX11_SIMPLIFIEDAPI_MFC_H */
|
||||
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2017-2020, NXP
|
||||
*
|
||||
* All rights are reserved. Reproduction in whole or in part is
|
||||
* prohibited without the written consent of the copyright owner.
|
||||
* NXP reserves the right to make changes without notice at any time.
|
||||
* NXP makes no warranty, expressed, implied or statutory, including but
|
||||
* not limited to any implied warranty of merchantability or fitness for any
|
||||
*particular purpose, or that the use will not infringe any third party patent,
|
||||
* copyright or trademark. NXP must not be liable for any loss or damage
|
||||
* arising from its use.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Simplified API ISO MFUL.
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EX11_SIMPLIFIEDAPI_ISO_MFUL_H
|
||||
#define EX11_SIMPLIFIEDAPI_ISO_MFUL_H
|
||||
|
||||
/* MFUL_READ takes the page no to read */
|
||||
/* bPageNo can be 0x00 - 0xFF depending upon card layout */
|
||||
#define MFUL_READ(bPageNo) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bPageNumber = bPageNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bCommand = MFUL_Read; \
|
||||
}
|
||||
|
||||
/* MFUL_WRITE takes the page no and data to write */
|
||||
/* bPageNo can be 0x00 - 0xFF depending upon card layout, pData is a pointer to 4 byte page data */
|
||||
#define MFUL_WRITE(bPageNo, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bPageNumber = bPageNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.pBuffer = pData; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bCommand = MFUL_Write; \
|
||||
}
|
||||
|
||||
/* MFUL_COMPATIBILITY_WRITE takes the page no and data to write */
|
||||
/* bPageNo can be 0x00 - 0xFF depending upon card layout, pData is a pointer to 16 byte page data */
|
||||
#define MFUL_COMPATIBILITY_WRITE(bPageNo, pData) { \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bPageNumber = bPageNo; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.pBuffer = pData; \
|
||||
phNfcLib_TransmitInput.phNfcLib_MifareUltraLight.bCommand = MFUL_Compatibility_Write; \
|
||||
}
|
||||
|
||||
#endif /* EX11_SIMPLIFIEDAPI_ISO_MFUL_H */
|
||||
189
Examples/Nfcrdlib_SimplifiedAPI_ISO/intfs/phApp_Init.h
Normal file
189
Examples/Nfcrdlib_SimplifiedAPI_ISO/intfs/phApp_Init.h
Normal file
@ -0,0 +1,189 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright 2016-2023 NXP */
|
||||
/* */
|
||||
/* NXP Confidential. This software is owned or controlled by NXP and may only */
|
||||
/* be used strictly in accordance with the applicable license terms. */
|
||||
/* By expressly accepting such terms or by downloading, installing, */
|
||||
/* activating and/or otherwise using the software, you are agreeing that you */
|
||||
/* have read, and that you agree to comply with and are bound by, such */
|
||||
/* license terms. If you do not agree to be bound by the applicable license */
|
||||
/* terms, then you may not retain, install, activate or otherwise use the */
|
||||
/* software. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \file
|
||||
* Example Source abstracting component header specific to HW used in the examples
|
||||
* This file shall be present in all examples. A customer does not need to touch/modify this file. This file
|
||||
* purely depends on the phNxpBuild_Lpc.h or phNxpBuild_App.h
|
||||
* The phAppInit.h externs the component data structures initialized here that is in turn included by the core examples.
|
||||
* The core example shall not use any other variable defined here except the RdLib component data structures(as explained above)
|
||||
* The RdLib component initialization requires some user defined data and function pointers.
|
||||
* These are defined in the respective examples and externed here.
|
||||
*
|
||||
* Keystore and Crypto initialization needs to be handled by application.
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PHAPP_INIT_H
|
||||
#define PHAPP_INIT_H
|
||||
|
||||
/* Status header */
|
||||
#include <ph_Status.h>
|
||||
|
||||
/* Driver Header */
|
||||
#include <phDriver.h>
|
||||
|
||||
/* NFCLIB Header */
|
||||
#include <phNfcLib.h>
|
||||
|
||||
/* Discovery Loop Header */
|
||||
#include <phacDiscLoop.h>
|
||||
|
||||
/* Platform definitions Header */
|
||||
#include <ph_RefDefs.h>
|
||||
|
||||
/* Check for K82 controller based boards. */
|
||||
#if defined(PHDRIVER_FRDM_K82FPN5180_BOARD) || \
|
||||
defined(PHDRIVER_FRDM_K82FRC663_BOARD) || \
|
||||
defined(PHDRIVER_K82F_PNEV5190B_BOARD)
|
||||
#define PHDRIVER_KINETIS_K82
|
||||
#endif
|
||||
|
||||
/* Check for LPC1769 controller based boards. */
|
||||
#if defined(PHDRIVER_LPC1769PN5180_BOARD) || \
|
||||
defined(PHDRIVER_LPC1769RC663_BOARD) || \
|
||||
defined(PHDRIVER_LPC1769PN5190_BOARD)
|
||||
#define PHDRIVER_LPC1769
|
||||
#endif
|
||||
|
||||
#if defined(PHDRIVER_PIPN5180_BOARD) || \
|
||||
defined(PHDRIVER_PIRC663_BOARD) || \
|
||||
defined(PHDRIVER_PIPN5190_BOARD)
|
||||
#include <phDriver_Linux_Int.h>
|
||||
#endif
|
||||
|
||||
#ifdef PHDRIVER_KINETIS_K82
|
||||
# include <fsl_debug_console.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__PN76XX__)
|
||||
#ifdef DEBUG
|
||||
#ifdef PHDRIVER_KINETIS_K82
|
||||
#if SDK_DEBUGCONSOLE==1
|
||||
#define DEBUG_PRINTF DbgConsole_Printf
|
||||
#else
|
||||
#define DEBUG_PRINTF(...) printf(__VA_ARGS__);
|
||||
#endif
|
||||
#else /* PHDRIVER_KINETIS_K82 */
|
||||
#include <stdio.h>
|
||||
#define DEBUG_PRINTF(...) printf(__VA_ARGS__); fflush(stdout)
|
||||
#endif /* PHDRIVER_KINETIS_K82 */
|
||||
#else /* DEBUG */
|
||||
#define DEBUG_PRINTF(...)
|
||||
#define DEBUG_SCANF(...)
|
||||
#endif /* DEBUG */
|
||||
#else /* __PN76XX__ */
|
||||
#if (SEGGER_RTT_ENABLE == 1)
|
||||
#include "SEGGER_RTT.h"
|
||||
#define DEBUG_PRINTF(...) SEGGER_RTT_printf(0, __VA_ARGS__);
|
||||
#define DEBUG_SCANF(Input , data) *data = (SEGGER_RTT_WaitKey() - 0x30); SEGGER_RTT_WaitKey()
|
||||
#else
|
||||
#if DEBUG
|
||||
#include <fsl_debug_console.h>
|
||||
#define DEBUG_PRINTF(...) PRINTF(__VA_ARGS__);
|
||||
#define DEBUG_SCANF(...) SCANF(__VA_ARGS__);while ((GETCHAR()) != '\n');
|
||||
#define DEBUG_GETCHAR GETCHAR
|
||||
#else
|
||||
#define DEBUG_PRINTF(...)
|
||||
#define DEBUG_SCANF(...)
|
||||
#endif /* DEBUG */
|
||||
#endif /* (SEGGER_RTT_ENABLE == 1) */
|
||||
#endif /* __PN76XX__ */
|
||||
/*******************************************************************************
|
||||
** Global Variable Declaration
|
||||
*******************************************************************************/
|
||||
|
||||
#define PH_NFCRDLIB_EXAMPLE_LPCD_GUARDTIME 100 /* LPCD Guard time(T4) in milli-seconds configured by application for Rc663. */
|
||||
#define PH_NFCRDLIB_EXAMPLE_LPCD_RFON_TIME 56 /* LPCD RFON time(T3) in micro-seconds configured by application for Rc663. */
|
||||
|
||||
/* HAL & BAL declarations */
|
||||
|
||||
#ifdef PH_PLATFORM_HAS_ICFRONTEND
|
||||
extern phbalReg_Type_t sBalParams;
|
||||
#endif /* PH_PLATFORM_HAS_ICFRONTEND */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_PN5180
|
||||
extern phhalHw_Pn5180_DataParams_t * pHal;
|
||||
#endif /* NXPBUILD__PHHAL_HW_PN5180 */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_PN5190
|
||||
extern phhalHw_Pn5190_DataParams_t * pHal;
|
||||
#endif /* NXPBUILD__PHHAL_HW_PN5190 */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_RC663
|
||||
extern phhalHw_Rc663_DataParams_t * pHal;
|
||||
#endif /* NXPBUILD__PHHAL_HW_RC663 */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_PN7462AU
|
||||
extern phhalHw_PN7462AU_DataParams_t * pHal;
|
||||
#endif /* NXPBUILD__PHHAL_HW_PN7462AU */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_PN76XX
|
||||
extern phhalHw_Pn76xx_DataParams_t * pHal;
|
||||
#endif /* NXPBUILD__PHHAL_HW_PN76XX */
|
||||
|
||||
/**************************************************Prints if error is detected**************************************************************/
|
||||
/* Enable(1) / Disable(0) printing error/info */
|
||||
#define DETECT_ERROR 0
|
||||
|
||||
#if DETECT_ERROR
|
||||
#define DEBUG_ERROR_PRINT(x) x
|
||||
#define PRINT_INFO(...) DEBUG_PRINTF(__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_ERROR_PRINT(x)
|
||||
#define PRINT_INFO(...)
|
||||
#endif
|
||||
|
||||
#define CHECK_STATUS(x) \
|
||||
if ((x) != PH_ERR_SUCCESS) \
|
||||
{ \
|
||||
DEBUG_PRINTF("Line: %d Error - (0x%04X) has occurred : 0xCCEE CC-Component ID, EE-Error code. Refer-ph_Status.h\n", __LINE__, (x)); \
|
||||
}
|
||||
|
||||
/* prints if error is detected */
|
||||
#define CHECK_SUCCESS(x) \
|
||||
if ((x) != PH_ERR_SUCCESS) \
|
||||
{ \
|
||||
DEBUG_PRINTF("\nLine: %d Error - (0x%04X) has occurred : 0xCCEE CC-Component ID, EE-Error code. Refer-ph_Status.h\n ", __LINE__, (x)); \
|
||||
return (x); \
|
||||
}
|
||||
|
||||
/* prints if error is detected */
|
||||
#define CHECK_NFCLIB_STATUS(x) \
|
||||
if ((x) != PH_NFCLIB_STATUS_SUCCESS) \
|
||||
{ \
|
||||
DEBUG_PRINTF("\nLine: %d Error - (0x%04X) has occurred in NFCLIB\n ", __LINE__, (x)); \
|
||||
}
|
||||
|
||||
/*********************************************************************************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
** Function Declarations
|
||||
*******************************************************************************/
|
||||
extern void phApp_CPU_Init(void);
|
||||
extern void phApp_PrintTagInfo(phacDiscLoop_Sw_DataParams_t *pDataParams, uint16_t wNumberOfTags, uint16_t wTagsDetected);
|
||||
extern void phApp_PrintTech(uint8_t TechType);
|
||||
extern void phApp_Print_Buff(uint8_t *pBuff, uint8_t num);
|
||||
extern void PrintErrorInfo(phStatus_t wStatus);
|
||||
extern phStatus_t phApp_Configure_IRQ();
|
||||
|
||||
#ifdef PH_PLATFORM_HAS_ICFRONTEND
|
||||
extern void CLIF_IRQHandler(void);
|
||||
#endif /* PH_PLATFORM_HAS_ICFRONTEND */
|
||||
|
||||
#endif /* PHAPP_INIT_H */
|
||||
283
Examples/Nfcrdlib_SimplifiedAPI_ISO/intfs/ph_NxpBuild_App.h
Normal file
283
Examples/Nfcrdlib_SimplifiedAPI_ISO/intfs/ph_NxpBuild_App.h
Normal file
@ -0,0 +1,283 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright 2016-2023 NXP */
|
||||
/* */
|
||||
/* NXP Confidential. This software is owned or controlled by NXP and may only */
|
||||
/* be used strictly in accordance with the applicable license terms. */
|
||||
/* By expressly accepting such terms or by downloading, installing, */
|
||||
/* activating and/or otherwise using the software, you are agreeing that you */
|
||||
/* have read, and that you agree to comply with and are bound by, such */
|
||||
/* license terms. If you do not agree to be bound by the applicable license */
|
||||
/* terms, then you may not retain, install, activate or otherwise use the */
|
||||
/* software. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \file
|
||||
* Application specific selection of Reader Library Components
|
||||
*
|
||||
* $Author$
|
||||
* $Revision$ (v07.10.00)
|
||||
* $Date$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PH_NXPBUILD_APP_H_INC
|
||||
#define PH_NXPBUILD_APP_H_INC
|
||||
|
||||
/** \defgroup ph_NxpBuild NXP Build
|
||||
* \brief Controls the Inclusion of required components, Inclusion SRC/DATA within components and the Build Dependencies between the components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* NXPBUILD_DELETE: included code lines should be always removed from code */
|
||||
|
||||
/* NXP BUILD DEFINES */
|
||||
/* use #define to include components */
|
||||
/* comment out #define to exclude components */
|
||||
|
||||
/* DEBUG build mode */
|
||||
/*#define NXPBUILD__PH_DEBUG*/ /**< DEBUG build definition */
|
||||
|
||||
#define NXPRDLIB_REM_GEN_INTFS
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
#if defined(__PN74XXXX__) || defined (__PN73XXXX__)
|
||||
#define NXPBUILD__PHHAL_HW_PN7462AU /**< NFC Controller PN7462AU HAL */
|
||||
#endif
|
||||
|
||||
#ifdef __PN76XX__
|
||||
#ifdef __PN7642__
|
||||
#define NXPBUILD__PHHAL_HW_PN7642 /**< NFC Controller PN7642 HAL */
|
||||
#elif __PN7640__
|
||||
#define NXPBUILD__PHHAL_HW_PN7640 /**< NFC Controller PN7640 HAL */
|
||||
#else
|
||||
#error " PN76 platform definition (__PN7642__ or __PN7640__) missing !!! "
|
||||
#endif
|
||||
|
||||
#if defined(__PN7642__) || defined(__PN7640__)
|
||||
#define NXPBUILD__PHHAL_HW_PN76XX /**< NFC Controller PN76XX HAL */
|
||||
#endif
|
||||
#endif /* __PN76XX__ */
|
||||
|
||||
#if defined(PHDRIVER_LPC1769PN5180_BOARD) \
|
||||
|| defined(PHDRIVER_FRDM_K82FPN5180_BOARD)
|
||||
# define NXPBUILD__PHHAL_HW_PN5180
|
||||
#endif
|
||||
|
||||
#if defined(PHDRIVER_LPC1769PN5190_BOARD) \
|
||||
|| defined(PHDRIVER_K82F_PNEV5190B_BOARD)
|
||||
# define NXPBUILD__PHHAL_HW_PN5190
|
||||
#endif
|
||||
|
||||
#if defined(PHDRIVER_LPC1769RC663_BOARD) \
|
||||
|| defined(PHDRIVER_FRDM_K82FRC663_BOARD)
|
||||
# define NXPBUILD__PHHAL_HW_RC663
|
||||
#endif
|
||||
|
||||
#if defined(NXPBUILD__PHHAL_HW_PN5180) || \
|
||||
defined(NXPBUILD__PHHAL_HW_PN5190) || \
|
||||
defined(NXPBUILD__PHHAL_HW_PN76XX) || \
|
||||
defined(NXPBUILD__PHHAL_HW_PN7462AU)
|
||||
// #define NXPBUILD__PHHAL_HW_TARGET /**< Dependency checking if target mode macros should be enabled */
|
||||
#endif
|
||||
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
#define NXPBUILD__PHPAL_I14443P3A_SW /**< PAL ISO 14443-3A SW Component is included. */
|
||||
|
||||
#define NXPBUILD__PHPAL_I14443P3B_SW /**< PAL ISO 14443-3B SW Component is included. */
|
||||
|
||||
#define NXPBUILD__PHPAL_I14443P4A_SW /**< PAL ISO 14443-4A SW Component is included. */
|
||||
|
||||
#define NXPBUILD__PHPAL_I14443P4_SW /**< PAL ISO 14443-4 SW Component is included. */
|
||||
|
||||
//#define NXPBUILD__PHPAL_MIFARE_SW /**< PAL MIFARE SW Component is included */
|
||||
//#define NXPBUILD__PHPAL_MIFARE_STUB /**< PAL MIFARE STUB Component is included */
|
||||
|
||||
//#define NXPBUILD__PHPAL_FELICA_SW /**< PAL Felica SW Component is included. */
|
||||
|
||||
#define NXPBUILD__PHPAL_SLI15693_SW /**< PAL SLI 15693 Component is included. */
|
||||
#ifndef NXPBUILD__PHHAL_HW_PN7640
|
||||
#define NXPBUILD__PHPAL_I18000P3M3_SW /**< PAL ISO 18000p3m3 Component is included. */
|
||||
#endif /* NXPBUILD__PHHAL_HW_PN7640 */
|
||||
|
||||
#ifdef NXPBUILD__PHHAL_HW_RC663 /**< If FE HAL is RC663, then include EPC UID PAL as required, otherwise exclude. */
|
||||
// #define NXPBUILD__PHPAL_EPCUID_SW /**< PAL EPC UID SW Component is included. */
|
||||
#endif
|
||||
|
||||
//#define NXPBUILD__PHPAL_I18092MPI_SW /**< PAL ISO18092 (P2P) SW Component is included. */
|
||||
|
||||
#ifndef NXPBUILD__PHHAL_HW_RC663 /**< If FE HAL is RC663, then exclude ISO14443 Card Mode PAL & ISO18092 Target Mode PAL, otherwise include as required. */
|
||||
// #define NXPBUILD__PHPAL_I14443P4MC_SW /**< PAL ISO 14443-4 Card Mode SW Component is included. */
|
||||
// #define NXPBUILD__PHPAL_I18092MT_SW /**< PAL ISO 18092 Target Mode SW Component is included. */
|
||||
#endif /* NXPBUILD__PHHAL_HW_RC663 */
|
||||
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
#define NXPBUILD__PHAC_DISCLOOP_SW /**< Discovery Loop Activity SW Component is included. */
|
||||
|
||||
#ifdef NXPBUILD__PHAC_DISCLOOP_SW /**< If DiscLoop SW Component is included, macros( & it's dependencies) to include/exclude SRC/DATA within Discloop is defined. */
|
||||
|
||||
#if defined (NXPBUILD__PHHAL_HW_PN5180) || \
|
||||
defined (NXPBUILD__PHHAL_HW_PN5190) || \
|
||||
defined (NXPBUILD__PHHAL_HW_RC663) || \
|
||||
defined (NXPBUILD__PHHAL_HW_PN7462AU) || \
|
||||
defined (NXPBUILD__PHHAL_HW_PN7642)
|
||||
// #define NXPBUILD__PHAC_DISCLOOP_LPCD /**< SRC to enable LPCD is included. */
|
||||
#endif
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_I14443P3A_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P3_TAGS /**< SRC/DATA to Detect/CollRes/Activate cards such as MFC, MFUL, MFP SL1 etc is included. */
|
||||
// #define NXPBUILD__PHAC_DISCLOOP_TYPEA_JEWEL_TAGS /**< SRC/DATA to Detect cards such as NFC Forum T1T, Topaz/Jewel is included. */
|
||||
|
||||
#if defined(NXPBUILD__PHPAL_I14443P4A_SW) && defined(NXPBUILD__PHPAL_I14443P4_SW)
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P4_TAGS /**< SRC/DATA to Detect cards such as MFDF, MFP, T4AT NFC Forum Tag or Type A EMVCo is included. */
|
||||
#endif
|
||||
#endif /* NXPBUILD__PHPAL_I14443P3A_SW */
|
||||
|
||||
#if defined(NXPBUILD__PHPAL_I14443P3A_SW) && defined(NXPBUILD__PHPAL_I18092MPI_SW)
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_P2P_TAGS /**< SRC/DATA to Detect Peer Passive Type A P2P Target mode devices is included. */
|
||||
#endif
|
||||
|
||||
#ifndef NXPBUILD__PHHAL_HW_RC663
|
||||
#ifdef NXPBUILD__PHPAL_I18092MPI_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_P2P_ACTIVE /**< SRC/DATA to Detect Peer Active Type A P2P Target mode devices is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF212_P2P_ACTIVE/**< SRC/DATA to Detect Peer Active Type F212 P2P Target mode devices is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF424_P2P_ACTIVE/**< SRC/DATA to Detect Peer Active Type F424 P2P Target mode devices is included. */
|
||||
#endif /* NXPBUILD__PHPAL_I18092MPI_SW */
|
||||
#endif /* NXPBUILD__PHHAL_HW_RC663 */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_FELICA_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_FELICA_TAGS /**< SRC/DATA to Detect FeliCa Cards is included. */
|
||||
#ifdef NXPBUILD__PHPAL_I18092MPI_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF_P2P_TAGS /**< SRC/DATA to Detect Peer Passive Type F P2P Target mode devices is included. */
|
||||
#endif /* NXPBUILD__PHPAL_I18092MPI_SW */
|
||||
#endif /* NXPBUILD__PHPAL_FELICA_SW */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_I14443P3B_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEB_I3P3B_TAGS /**< SRC/DATA to Detect Type B Cards that operate at Layer3 level is included */
|
||||
#ifdef NXPBUILD__PHPAL_I14443P4_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEB_I3P4B_TAGS /**< SRC/DATA to Detect Type B Cards such as NFC Forum Type 4 Tags, EMVCo Type B Cards etc is included */
|
||||
#endif /* NXPBUILD__PHPAL_I14443P4_SW */
|
||||
#endif /* NXPBUILD__PHPAL_I14443P3B_SW */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_SLI15693_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEV_TAGS /**< SRC/DATA to Detect Type V Cards such as ICODE SLI/SLIX/SLI2/Tesa Cards is included*/
|
||||
#endif /* NXPBUILD__PHPAL_SLI15693_SW */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_I18000P3M3_SW
|
||||
#define NXPBUILD__PHAC_DISCLOOP_I18000P3M3_TAGS /**< SRC/DATA to Detect ICODE ILT Cards such as SMARTRAC StackIt Cards is included*/
|
||||
#endif /* NXPBUILD__PHPAL_I18000P3M3_SW */
|
||||
|
||||
#ifndef NXPBUILD__PHHAL_HW_RC663 /**< If FE HAL is RC663, target mode is not supported at all, hence exclude those SRC, otherwise include as required */
|
||||
#ifdef NXPBUILD__PHHAL_HW_TARGET
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_TARGET_PASSIVE /**< SRC to Initialize Type A passive listen config and subsequently call HAL AutoColl is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEA_TARGET_ACTIVE /**< SRC to Initialize Type A active listen config and subsequently call HAL AutoColl is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF212_TARGET_PASSIVE/**< SRC to Initialize Type F212 passive listen config and subsequently call HAL AutoColl is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF212_TARGET_ACTIVE /**< SRC to Initialize Type F212 active listen config and subsequently call HAL AutoColl is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF424_TARGET_PASSIVE/**< SRC to Initialize Type F424 passive listen config and subsequently call HAL AutoColl is included. */
|
||||
#define NXPBUILD__PHAC_DISCLOOP_TYPEF424_TARGET_ACTIVE /**< SRC to Initialize Type F424 active listen config and subsequently call HAL AutoColl is included. */
|
||||
#endif /* NXPBUILD__PHHAL_HW_TARGET */
|
||||
#endif
|
||||
|
||||
#endif /* NXPBUILD__PHAC_DISCLOOP_SW */
|
||||
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
#define NXPBUILD__PHNFCLIB /**< Simplified API Interface, If enabling this the entry point should be this component in the application */
|
||||
#ifdef NXPBUILD__PHNFCLIB
|
||||
#define NXPBUILD__PHNFCLIB_PROFILES /**< Simplified API Interface to provide different profiles to user. */
|
||||
#ifdef NXPBUILD__PHNFCLIB_PROFILES
|
||||
#define NXPBUILD__PH_NFCLIB_ISO /* Enable the ISO profile of Simplified API */
|
||||
//#define NXPBUILD__PH_NFCLIB_EMVCO /* Enable the EMVCO profile of Simplified API */
|
||||
//#define NXPBUILD__PH_NFCLIB_NFC /* Enable the NFC profile of Simplified API */
|
||||
#endif /* NXPBUILD__PHNFCLIB_PROFILES */
|
||||
#endif /* NXPBUILD__PHNFCLIB */
|
||||
|
||||
#ifdef NXPBUILD__PH_NFCLIB_ISO
|
||||
|
||||
#ifdef NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P3_TAGS
|
||||
#define NXPBUILD__PH_NFCLIB_ISO_MFC
|
||||
#define NXPBUILD__PH_NFCLIB_ISO_MFUL
|
||||
#endif /* NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P3_TAGS */
|
||||
|
||||
#ifdef NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P4_TAGS
|
||||
#define NXPBUILD__PH_NFCLIB_ISO_MFDF
|
||||
#endif /* NXPBUILD__PHAC_DISCLOOP_TYPEA_I3P4_TAGS */
|
||||
|
||||
#ifdef NXPBUILD__PHAC_DISCLOOP_TYPEV_TAGS
|
||||
#define NXPBUILD__PH_NFCLIB_ISO_15693
|
||||
#endif /* NXPBUILD__PHAC_DISCLOOP_TYPEV_TAGS*/
|
||||
|
||||
#ifdef NXPBUILD__PHAC_DISCLOOP_I18000P3M3_TAGS
|
||||
#define NXPBUILD__PH_NFCLIB_ISO_18000
|
||||
#endif /* NXPBUILD__PHAC_DISCLOOP_I18000P3M3_TAGS */
|
||||
|
||||
#endif /* NXPBUILD__PH_NFCLIB_ISO*/
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
//#define NXPBUILD__PH_CIDMANAGER_SW /**< CID Manager SW Component is included. */
|
||||
|
||||
#define NXPBUILD__PH_KEYSTORE_SW /**< SW KeyStore Component is included. */
|
||||
|
||||
#if defined(NXPBUILD__PHHAL_HW_RC663) && !defined(NXPBUILD__PH_KEYSTORE_SW)
|
||||
// #define NXPBUILD__PH_KEYSTORE_RC663 /**< RC663 KeyStore Component is included. */
|
||||
#endif
|
||||
//#define NXPBUILD__PH_NDA_MFDF /**< MIFARE DESFire contactless IC */
|
||||
//#define NXPBUILD__PH_CRYPTOSYM_SW /**< Crypto Symbols SW Component is included. */
|
||||
//#define NXPBUILD__PH_CRYPTORNG_SW /**< Crypto RNG SW Component is included. */
|
||||
|
||||
/*********************************************************************************************************************************************************************************/
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_FELICA_SW
|
||||
#define NXPBUILD__PHAL_FELICA_SW /**< AL FeliCa SW Component is included */
|
||||
#endif /* NXPBUILD__PHPAL_FELICA_SW */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_MIFARE_SW
|
||||
#if defined(NXPBUILD__PH_KEYSTORE_SW) || defined(NXPBUILD__PH_KEYSTORE_RC663)
|
||||
#define NXPBUILD__PHAL_MFC_SW /**< AL MIFARE Classic contactless IC SW Component is included */
|
||||
#endif
|
||||
#define NXPBUILD__PHAL_MFUL_SW /**< AL Mifare Ultrlight SW Component is included */
|
||||
#define NXPBUILD__PHAL_MFDF_SW /**< AL Mifare DesFire SW Component is included */
|
||||
// #define NXPBUILD__PHAL_MFNTAG42XDNA_SW /**< AL MIFARE Prime Ntag42XDna contactless IC SW Component is included */
|
||||
#endif /* NXPBUILD__PHPAL_MIFARE_SW */
|
||||
|
||||
//#define NXPBUILD__PHAL_T1T_SW /**< AL Type T1 Tag SW Component is included */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_SLI15693_SW
|
||||
//#define NXPBUILD__PHAL_ICODE_SW /**< AL ICODE SW COMPONENT is included */
|
||||
#endif /* NXPBUILD__PHPAL_SLI15693_SW */
|
||||
|
||||
//#define NXPBUILD__PHAL_TOP_SW /**< AL for TagOps Mapping SW Component is included.Required for NDEF operations */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_I18000P3M3_SW
|
||||
#define NXPBUILD__PHAL_I18000P3M3_SW /**< AL ISO18000p3m3 SW Component is included */
|
||||
#endif /* NXPBUILD__PHPAL_I18000P3M3_SW */
|
||||
|
||||
#ifdef NXPBUILD__PHPAL_I14443P4MC_SW
|
||||
#if !defined(PH_OSAL_NULLOS)
|
||||
#define NXPBUILD__PHCE_T4T_SW /**< AL HCE T2AT SW Component is included */
|
||||
//#define NXPBUILD__PHCE_T4T_PROPRIETARY /**< SRC to handle HCE T4AT Proprietary Commands is included */
|
||||
/*#define NXPBUILD__PHCE_T4T_EXT_NDEF */ /**< SRC to handle Extended NDEF Support as per T4T spec 3.0 is included */
|
||||
#endif
|
||||
#endif /* NXPBUILD__PHPAL_I14443P4MC_SW */
|
||||
|
||||
/* LLCP Components */
|
||||
#if defined(NXPBUILD__PHPAL_I18092MPI_SW) || defined(NXPBUILD__PHPAL_I18092MT_SW)
|
||||
#if !defined(PH_OSAL_NULLOS)
|
||||
#define NXPBUILD__PHLN_LLCP_SW /**< Link LLCP SW Component is included */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* SNEP components */
|
||||
#ifdef NXPBUILD__PHLN_LLCP_SW
|
||||
#define NXPBUILD__PHNP_SNEP_SW /**< Protocol SNEP SW Component is included */
|
||||
#endif /* NXPBUILD__PHLN_LLCP_SW */
|
||||
|
||||
/* Enable/disable Debugging */
|
||||
/*#define NXPBUILD__PH_DEBUG*/ /**< TODO: To be checked if required */
|
||||
|
||||
/** @}
|
||||
* end of ph_NxpBuild
|
||||
*/
|
||||
|
||||
#endif /* PH_NXPBUILD_APP_H_INC */
|
||||
Reference in New Issue
Block a user