AppNearMe µNFC stack for the NXP PN532 chip License: You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Dependents:   IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more

License

You can use the stack free of charge to prototype with mbed; if you want to use the stack with your commercial product, get in touch!

Committer:
AppNearMe
Date:
Wed Nov 07 18:18:52 2012 +0000
Revision:
10:2af578c635cd
Updated library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AppNearMe 10:2af578c635cd 1 /*
AppNearMe 10:2af578c635cd 2 pn512_irq.h
AppNearMe 10:2af578c635cd 3 Copyright (c) Donatien Garnier 2012
AppNearMe 10:2af578c635cd 4 donatien.garnier@appnearme.com
AppNearMe 10:2af578c635cd 5 http://www.appnearme.com/
AppNearMe 10:2af578c635cd 6 */
AppNearMe 10:2af578c635cd 7
AppNearMe 10:2af578c635cd 8 #ifndef PN512_IRQ_H_
AppNearMe 10:2af578c635cd 9 #define PN512_IRQ_H_
AppNearMe 10:2af578c635cd 10
AppNearMe 10:2af578c635cd 11 #ifdef __cplusplus
AppNearMe 10:2af578c635cd 12 extern "C" {
AppNearMe 10:2af578c635cd 13 #endif
AppNearMe 10:2af578c635cd 14
AppNearMe 10:2af578c635cd 15 #define PN512_IRQ_TX (1<<6)
AppNearMe 10:2af578c635cd 16 #define PN512_IRQ_RX (1<<5)
AppNearMe 10:2af578c635cd 17 #define PN512_IRQ_IDLE (1<<4)
AppNearMe 10:2af578c635cd 18 #define PN512_IRQ_HIGH_ALERT (1<<3)
AppNearMe 10:2af578c635cd 19 #define PN512_IRQ_LOW_ALERT (1<<2)
AppNearMe 10:2af578c635cd 20 #define PN512_IRQ_ERR (1<<1)
AppNearMe 10:2af578c635cd 21 #define PN512_IRQ_TIMER (1<<0)
AppNearMe 10:2af578c635cd 22
AppNearMe 10:2af578c635cd 23 #define PN512_IRQ_SIGIN (1<<(4+8))
AppNearMe 10:2af578c635cd 24 #define PN512_IRQ_MODE (1<<(3+8))
AppNearMe 10:2af578c635cd 25 #define PN512_IRQ_CRC (1<<(2+8))
AppNearMe 10:2af578c635cd 26 #define PN512_IRQ_RF_ON (1<<(1+8))
AppNearMe 10:2af578c635cd 27 #define PN512_IRQ_RF_OFF (1<<(0+8))
AppNearMe 10:2af578c635cd 28
AppNearMe 10:2af578c635cd 29 #define PN512_IRQ_NONE 0
AppNearMe 10:2af578c635cd 30
AppNearMe 10:2af578c635cd 31 #define PN512_REG_COMIEN_MASK 0x7F
AppNearMe 10:2af578c635cd 32 #define PN512_REG_COMIEN_VAL 0x00
AppNearMe 10:2af578c635cd 33
AppNearMe 10:2af578c635cd 34 #define PN512_REG_DIVIEN_MASK 0x1F
AppNearMe 10:2af578c635cd 35 #define PN512_REG_DIVIEN_VAL 0x80
AppNearMe 10:2af578c635cd 36
AppNearMe 10:2af578c635cd 37 #define PN512_REG_COMIRQ_MASK 0x7F
AppNearMe 10:2af578c635cd 38 #define PN512_REG_COMIRQ_CLEAR 0x00
AppNearMe 10:2af578c635cd 39
AppNearMe 10:2af578c635cd 40 #define PN512_REG_DIVIRQ_MASK 0x1F
AppNearMe 10:2af578c635cd 41 #define PN512_REG_DIVIRQ_CLEAR 0x00
AppNearMe 10:2af578c635cd 42
AppNearMe 10:2af578c635cd 43 void pn512_irq_init(void);
AppNearMe 10:2af578c635cd 44
AppNearMe 10:2af578c635cd 45 void pn512_irq_set(uint16_t irqs); //ORed
AppNearMe 10:2af578c635cd 46 uint16_t pn512_irq_get(void); //ORed
AppNearMe 10:2af578c635cd 47
AppNearMe 10:2af578c635cd 48 int pn512_irq_wait(int timeout);
AppNearMe 10:2af578c635cd 49
AppNearMe 10:2af578c635cd 50 void pn512_irq_clear(void);
AppNearMe 10:2af578c635cd 51
AppNearMe 10:2af578c635cd 52 bool pn512_irq_state(void);
AppNearMe 10:2af578c635cd 53
AppNearMe 10:2af578c635cd 54 #ifdef __cplusplus
AppNearMe 10:2af578c635cd 55 }
AppNearMe 10:2af578c635cd 56 #endif
AppNearMe 10:2af578c635cd 57
AppNearMe 10:2af578c635cd 58 #endif /* PN512_IRQ_H_ */