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 #include "mac_link.h"
dotnfc 0:db8030e71f55 3 #include "PN532_debug.h"
dotnfc 0:db8030e71f55 4
dotnfc 0:db8030e71f55 5 int8_t MACLink::activateAsTarget(uint16_t timeout)
dotnfc 0:db8030e71f55 6 {
dotnfc 0:db8030e71f55 7 pn532.begin();
dotnfc 0:db8030e71f55 8 pn532.SAMConfig();
dotnfc 0:db8030e71f55 9 return pn532.tgInitAsTarget(timeout);
dotnfc 0:db8030e71f55 10 }
dotnfc 0:db8030e71f55 11
dotnfc 0:db8030e71f55 12 bool MACLink::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
dotnfc 0:db8030e71f55 13 {
dotnfc 0:db8030e71f55 14 return pn532.tgSetData(header, hlen, body, blen);
dotnfc 0:db8030e71f55 15 }
dotnfc 0:db8030e71f55 16
dotnfc 0:db8030e71f55 17 int16_t MACLink::read(uint8_t *buf, uint8_t len)
dotnfc 0:db8030e71f55 18 {
dotnfc 0:db8030e71f55 19 return pn532.tgGetData(buf, len);
dotnfc 0:db8030e71f55 20 }