PN532 Driver library This library provides an abstract API to drive the pn532 nfc chip, with I2C/HSU/SPI interface. Its based on the Seeed Studio's Arduino version.

Dependents:   PN532_ReadUid Nfctest2

Committer:
dotnfc
Date:
Tue Sep 13 06:17:35 2016 +0000
Revision:
1:b5922b3b3257
Parent:
0:db8030e71f55
Remove ununsed files.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dotnfc 0:db8030e71f55 1
dotnfc 0:db8030e71f55 2 #ifndef __PN532_I2C_H__
dotnfc 0:db8030e71f55 3 #define __PN532_I2C_H__
dotnfc 0:db8030e71f55 4
dotnfc 0:db8030e71f55 5 #include <I2C.h>
dotnfc 0:db8030e71f55 6 #include "PN532Interface.h"
dotnfc 0:db8030e71f55 7
dotnfc 0:db8030e71f55 8 #define PN532_I2C_ADDRESS 0x48
dotnfc 0:db8030e71f55 9
dotnfc 0:db8030e71f55 10 class PN532_I2C : public PN532Interface {
dotnfc 0:db8030e71f55 11 public:
dotnfc 0:db8030e71f55 12 PN532_I2C(mbed::I2C &wire);
dotnfc 0:db8030e71f55 13
dotnfc 0:db8030e71f55 14 virtual void begin();
dotnfc 0:db8030e71f55 15 virtual void wakeup();
dotnfc 0:db8030e71f55 16 virtual int8_t writeCommand(const uint8_t *header, uint8_t hlen, const uint8_t *body = 0, uint8_t blen = 0);
dotnfc 0:db8030e71f55 17 virtual int16_t readResponse(uint8_t buf[], uint8_t len, uint16_t timeout = 1000);
dotnfc 0:db8030e71f55 18
dotnfc 0:db8030e71f55 19 private:
dotnfc 0:db8030e71f55 20 mbed::I2C* _wire;
dotnfc 0:db8030e71f55 21 uint8_t command;
dotnfc 0:db8030e71f55 22
dotnfc 0:db8030e71f55 23 int8_t readAckFrame();
dotnfc 0:db8030e71f55 24 };
dotnfc 0:db8030e71f55 25
dotnfc 0:db8030e71f55 26 #endif