1 /**************************************************************************/
5 /**************************************************************************/
10 #include "projectconfig.h"
12 #define PN532_DEBUG(fmt, args...) printf(fmt, ##args)
14 typedef enum pn532_state_e
22 /* Error messages generate by the stack (not to be confused with app level errors from the PN532) */
23 typedef enum pn532_error_e
25 PN532_ERROR_NONE
= 0x00,
26 PN532_ERROR_UNABLETOINIT
= 0x01, // Unable to initialise or wakeup the device
27 PN532_ERROR_APPLEVELERROR
= 0x02, // Application level error detected
28 PN532_ERROR_BUSY
= 0x03, // Busy executing a previous command
29 PN532_ERROR_NOACK
= 0x04, // No ack message received
30 PN532_ERROR_INVALIDACK
= 0x05, // Ack != 00 00 FF 00 FF 00
31 PN532_ERROR_PREAMBLEMISMATCH
= 0x06, // Frame preamble + start code mismatch
32 PN532_ERROR_EXTENDEDFRAME
= 0x07, // Extended frames currently unsupported
33 PN532_ERROR_LENCHECKSUMMISMATCH
= 0x08,
34 PN532_ERROR_RESPONSEBUFFEREMPTY
= 0x09, // No response data received
35 PN532_ERROR_SPIREADYSTATUSTIMEOUT
= 0x0A // Timeout waiting for 'ready' status (SPI only)
39 typedef enum pn532_modulation_e
41 PN532_MODULATION_ISO14443A_106KBPS
= 0x00,
42 PN532_MODULATION_FELICA_212KBPS
= 0x01,
43 PN532_MODULATION_FELICA_424KBPS
= 0x02,
44 PN532_MODULATION_ISO14443B_106KBPS
= 0x03,
45 PN532_MODULATION_JEWEL_106KBPS
= 0x04
48 /* PN532 Protocol control block */
53 pn532_modulation_t modulation
;
59 pn532_pcb_t
* pn532GetPCB();
60 pn532_error_t
pn532SetModulation(pn532_modulation_t mod
);
61 pn532_error_t
pn532Write(byte_t
*abtCommand
, size_t szLen
);
62 pn532_error_t
pn532Read(byte_t
*abtResponse
, size_t * pszLen
);
63 void pn532PrintHex(const byte_t
* pbtData
, const size_t szBytes
);