AppNearMe µNFC stack for the NXP PN532 chip License: You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Dependents:   IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more

License

You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Committer:
AppNearMe
Date:
Wed Nov 07 18:18:52 2012 +0000
Revision:
10:2af578c635cd
Updated library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AppNearMe 10:2af578c635cd 1 /*
AppNearMe 10:2af578c635cd 2 pn532_status.h
AppNearMe 10:2af578c635cd 3 Copyright (c) Donatien Garnier 2012
AppNearMe 10:2af578c635cd 4 donatien.garnier@appnearme.com
AppNearMe 10:2af578c635cd 5 http://www.appnearme.com/
AppNearMe 10:2af578c635cd 6 */
AppNearMe 10:2af578c635cd 7
AppNearMe 10:2af578c635cd 8
AppNearMe 10:2af578c635cd 9 #ifndef PN532_STATUS_H_
AppNearMe 10:2af578c635cd 10 #define PN532_STATUS_H_
AppNearMe 10:2af578c635cd 11
AppNearMe 10:2af578c635cd 12 #ifdef __cplusplus
AppNearMe 10:2af578c635cd 13 extern "C" {
AppNearMe 10:2af578c635cd 14 #endif
AppNearMe 10:2af578c635cd 15
AppNearMe 10:2af578c635cd 16 #include "core/errors.h"
AppNearMe 10:2af578c635cd 17
AppNearMe 10:2af578c635cd 18 #define PN532_STATUS_TIMEOUT 0x01 //Time Out, the target has not answered
AppNearMe 10:2af578c635cd 19 #define PN532_STATUS_CRC 0x02 //A CRC error has been detected by the CIU
AppNearMe 10:2af578c635cd 20 #define PN532_STATUS_PARITY 0x03 //A Parity error has been detected by the CIU 0x03
AppNearMe 10:2af578c635cd 21 #define PN532_STATUS_BITCOUNT 0x04 //During an anti-collision/select operation (ISO/IEC14443-3
AppNearMe 10:2af578c635cd 22 //Type A and ISO/IEC18092 106 kbps passive mode), an
AppNearMe 10:2af578c635cd 23 //erroneous Bit Count has been detected
AppNearMe 10:2af578c635cd 24 #define PN532_STATUS_FRAMING 0x05 //Framing error during Mifare operation
AppNearMe 10:2af578c635cd 25 #define PN532_STATUS_ANTICOLL 0x06 //An abnormal bit-collision has been detected during bit wise
AppNearMe 10:2af578c635cd 26 //anti-collision at 106 kbps
AppNearMe 10:2af578c635cd 27 #define PN532_STATUS_BUFFER_TOO_SMALL 0x07 //Communication buffer size insufficient 0x07
AppNearMe 10:2af578c635cd 28 #define PN532_STATUS_BUFFER_OVERFLOW 0x09 //RF Buffer overflow has been detected by the CIU (bit
AppNearMe 10:2af578c635cd 29 //BufferOvfl of the register CIU_Error)
AppNearMe 10:2af578c635cd 30 #define PN532_STATUS_NFCIP1_ACTIVE 0x0A //In active communication mode, the RF field has not been
AppNearMe 10:2af578c635cd 31 //switched on in time by the counterpart (as defined in NFCIP-1
AppNearMe 10:2af578c635cd 32 //standard)
AppNearMe 10:2af578c635cd 33 #define PN532_STATUS_RF 0x0B //RF Protocol error
AppNearMe 10:2af578c635cd 34 #define PN532_STATUS_OVERHEAT 0x0D //Temperature error: the internal temperature sensor has
AppNearMe 10:2af578c635cd 35 //detected overheating, and therefore has automatically
AppNearMe 10:2af578c635cd 36 //switched off the antenna drivers
AppNearMe 10:2af578c635cd 37 #define PN532_STATUS_INTERNAL 0x0E //Internal buffer overflow
AppNearMe 10:2af578c635cd 38 #define PN532_STATUS_INVALID_PARAM 0x10 //Invalid parameter (range, format, …)
AppNearMe 10:2af578c635cd 39 #define PN532_STATUS_RELEASED 0x29 //Target has been released (RF off)
AppNearMe 10:2af578c635cd 40
AppNearMe 10:2af578c635cd 41 #define ___PN532_STATUS_CHECK(e,s) ((e&0x3F)==s)
AppNearMe 10:2af578c635cd 42 #define PN532_STATUS_TO_ERR( e ) (___PN532_STATUS_CHECK((e&0x3F),0)?OK: \
AppNearMe 10:2af578c635cd 43 (___PN532_STATUS_CHECK(e,PN532_STATUS_TIMEOUT))?ERR_TIMEOUT: \
AppNearMe 10:2af578c635cd 44 (___PN532_STATUS_CHECK(e,PN532_STATUS_CRC))?ERR_CRC: \
AppNearMe 10:2af578c635cd 45 (___PN532_STATUS_CHECK(e,PN532_STATUS_PARITY))?ERR_PARITY: \
AppNearMe 10:2af578c635cd 46 (___PN532_STATUS_CHECK(e,PN532_STATUS_BITCOUNT))?ERR_PROTOCOL: \
AppNearMe 10:2af578c635cd 47 (___PN532_STATUS_CHECK(e,PN532_STATUS_FRAMING))?ERR_PROTOCOL: \
AppNearMe 10:2af578c635cd 48 (___PN532_STATUS_CHECK(e,PN532_STATUS_NFCIP1_ACTIVE))?ERR_PROTOCOL: \
AppNearMe 10:2af578c635cd 49 (___PN532_STATUS_CHECK(e,PN532_STATUS_RF))?ERR_PROTOCOL: \
AppNearMe 10:2af578c635cd 50 (___PN532_STATUS_CHECK(e,PN532_STATUS_ANTICOLL))?ERR_COLLISION: \
AppNearMe 10:2af578c635cd 51 (___PN532_STATUS_CHECK(e,PN532_STATUS_BUFFER_TOO_SMALL))?ERR_BUFFER_TOO_SMALL: \
AppNearMe 10:2af578c635cd 52 (___PN532_STATUS_CHECK(e,PN532_STATUS_BUFFER_OVERFLOW))?ERR_CONTROLLER: \
AppNearMe 10:2af578c635cd 53 (___PN532_STATUS_CHECK(e,PN532_STATUS_OVERHEAT))?ERR_CONTROLLER: \
AppNearMe 10:2af578c635cd 54 (___PN532_STATUS_CHECK(e,PN532_STATUS_INTERNAL))?ERR_CONTROLLER: \
AppNearMe 10:2af578c635cd 55 (___PN532_STATUS_CHECK(e,PN532_STATUS_INVALID_PARAM))?ERR_PARAMS: \
AppNearMe 10:2af578c635cd 56 (___PN532_STATUS_CHECK(e,PN532_STATUS_RELEASED))?ERR_FIELD: \
AppNearMe 10:2af578c635cd 57 ERR_UNKNOWN \
AppNearMe 10:2af578c635cd 58 )
AppNearMe 10:2af578c635cd 59
AppNearMe 10:2af578c635cd 60 #ifdef __cplusplus
AppNearMe 10:2af578c635cd 61 }
AppNearMe 10:2af578c635cd 62 #endif
AppNearMe 10:2af578c635cd 63
AppNearMe 10:2af578c635cd 64 #endif /* PN532_STATUS_H_ */