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 // arudino wraper functions
dotnfc 0:db8030e71f55 3 // by dotnfc@163.com
dotnfc 0:db8030e71f55 4 // 2016/09/10 18:16:00
dotnfc 0:db8030e71f55 5
dotnfc 0:db8030e71f55 6 #include "Arduino.h"
dotnfc 0:db8030e71f55 7
dotnfc 0:db8030e71f55 8
dotnfc 0:db8030e71f55 9 /*==============================================================================
dotnfc 0:db8030e71f55 10 * \brief arduino like 'tone ()'
dotnfc 0:db8030e71f55 11 */
dotnfc 0:db8030e71f55 12 void tone(PwmOut &buz, long frequency)
dotnfc 0:db8030e71f55 13 {
dotnfc 0:db8030e71f55 14 if (frequency == 0) {
dotnfc 0:db8030e71f55 15 buz = 0;
dotnfc 0:db8030e71f55 16 return;
dotnfc 0:db8030e71f55 17 }
dotnfc 0:db8030e71f55 18
dotnfc 0:db8030e71f55 19 float period;
dotnfc 0:db8030e71f55 20
dotnfc 0:db8030e71f55 21 // calculate the period of the note in turn play
dotnfc 0:db8030e71f55 22 period = 1000000 / frequency;
dotnfc 0:db8030e71f55 23 // set the period calculated at the PWM output
dotnfc 0:db8030e71f55 24 buz.period_us (period);
dotnfc 0:db8030e71f55 25 // establish a duty cycle of 50%
dotnfc 0:db8030e71f55 26 buz.write (0.50f);
dotnfc 0:db8030e71f55 27 }
dotnfc 0:db8030e71f55 28
dotnfc 0:db8030e71f55 29