interrupt handling
Diff: readerComm.cpp
- Revision:
- 9:9266e0109d26
- Parent:
- 7:96baf1b2fd07
- Child:
- 10:98a58968dc7d
--- a/readerComm.cpp Tue Apr 07 20:20:56 2015 +0000 +++ b/readerComm.cpp Wed Apr 08 20:48:05 2015 +0000 @@ -39,8 +39,8 @@ #include "mbed.h" #include "readerComm.h" -DigitalOut enable(p4); // Control EN pin on TRF7970 -//DigitalOut enable2(p3); // Control EN2 pin on TRF7970 +DigitalOut EN(p4); // Control EN pin on TRF7970 +DigitalOut EN2(p3); // Control EN2 pin on TRF7970 DigitalOut CS(p19); uint8_t turnRFOn[2]; uint8_t testcommand[2]; @@ -180,12 +180,37 @@ void PowerUpNFC(void) -{CS = 1; - wait_ms(4); - enable = 1; +{//CS = 1; +// wait_ms(4); +// EN = 1; +// EN2=1; + + CS = 0; EN2 = 0; EN = 0; + wait_ms(2); + CS = 1; + wait_ms(3); + EN2 = 1; + wait_ms(1); + EN = 1; +} +void PowerUpNFC2(void) +{//CS = 1; +// wait_ms(4); +// EN = 1; +// EN2=1; + +EN = 1; +//wait_ms(1); +EN2=0; + +//wait_ms(1); + //EN2= 0; } void PowerDownNFC(void) -{enable = 0; +{EN = 0; +//wait_ms(1); + EN2= 0; + } void SpiInit1(void) @@ -201,7 +226,7 @@ } void NFCInit(void) -{ +{testPin=1; //wait_ms(2); testcommand[0] = SOFT_INIT; trf797xDirectCommand(testcommand); @@ -233,7 +258,7 @@ testcommand[1] = 0x02; // 6.78 MHz, OOK 100% trf797xWriteSingle(testcommand, 2); //wait_ms(6); -} +testPin=0;} void RegisterReInitNFC(void) {testcommand[0] = TX_TIMER_EPC_HIGH; @@ -385,4 +410,4 @@ trf797xDirectCommand(testcommand); //wait(1); -} \ No newline at end of file +}