AppNearMe Official / AppNearMe_MuNFC_PN532 Featured

Dependents:   IOT_sensor_nfc AppNearMe_MuNFC_PN532_Test p2p_nfc_test NFCMoodLamp ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pn512_irq.h Source File

pn512_irq.h

00001 /*
00002   pn512_irq.h
00003   Copyright (c) Donatien Garnier 2012
00004   donatien.garnier@appnearme.com
00005   http://www.appnearme.com/
00006 */
00007 
00008 #ifndef PN512_IRQ_H_
00009 #define PN512_IRQ_H_
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00015 #define PN512_IRQ_TX          (1<<6)
00016 #define PN512_IRQ_RX          (1<<5)
00017 #define PN512_IRQ_IDLE        (1<<4)
00018 #define PN512_IRQ_HIGH_ALERT  (1<<3)
00019 #define PN512_IRQ_LOW_ALERT   (1<<2)
00020 #define PN512_IRQ_ERR         (1<<1)
00021 #define PN512_IRQ_TIMER       (1<<0)
00022 
00023 #define PN512_IRQ_SIGIN       (1<<(4+8))
00024 #define PN512_IRQ_MODE        (1<<(3+8))
00025 #define PN512_IRQ_CRC         (1<<(2+8))
00026 #define PN512_IRQ_RF_ON       (1<<(1+8))
00027 #define PN512_IRQ_RF_OFF      (1<<(0+8))
00028 
00029 #define PN512_IRQ_NONE        0
00030 
00031 #define PN512_REG_COMIEN_MASK 0x7F
00032 #define PN512_REG_COMIEN_VAL  0x00
00033 
00034 #define PN512_REG_DIVIEN_MASK 0x1F
00035 #define PN512_REG_DIVIEN_VAL  0x80
00036 
00037 #define PN512_REG_COMIRQ_MASK 0x7F
00038 #define PN512_REG_COMIRQ_CLEAR  0x00
00039 
00040 #define PN512_REG_DIVIRQ_MASK 0x1F
00041 #define PN512_REG_DIVIRQ_CLEAR  0x00
00042 
00043 void pn512_irq_init(void);
00044 
00045 void pn512_irq_set(uint16_t irqs); //ORed
00046 uint16_t pn512_irq_get(void); //ORed
00047 
00048 int pn512_irq_wait(int timeout);
00049 
00050 void pn512_irq_clear(void);
00051 
00052 bool pn512_irq_state(void);
00053 
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057 
00058 #endif /* PN512_IRQ_H_ */