interrupt handling

Dependencies:  

Committer:
soumi_ghsoh
Date:
Thu Apr 02 21:10:48 2015 +0000
Revision:
6:3c510c297e2f
Parent:
5:93c612f43ec2
Child:
7:96baf1b2fd07
Added ReadNFC(), InventoryReqNFC()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
soumi_ghsoh 5:93c612f43ec2 1
rwclough 1:1eb96189824d 2 /*
rwclough 2:bd5afc5aa139 3 Header file for readerComm.cpp
rwclough 1:1eb96189824d 4 */
rwclough 1:1eb96189824d 5
rwclough 1:1eb96189824d 6 // Prototypes
soumi_ghsoh 6:3c510c297e2f 7 //void SpiInit1(void);
soumi_ghsoh 6:3c510c297e2f 8 void SpiInit(void);
rwclough 4:9ab0d84bbd07 9 void trf797xInitialSettings(void);
rwclough 4:9ab0d84bbd07 10 void trf797xDirectCommand(uint8_t *buffer);
rwclough 4:9ab0d84bbd07 11 void trf797xWriteSingle(uint8_t *buffer, uint8_t length);
rwclough 4:9ab0d84bbd07 12 void trf797xReadSingle(uint8_t *buffer, uint8_t number);
rwclough 4:9ab0d84bbd07 13 void trf797xReadContinuous(uint8_t *buffer, uint8_t length);
rwclough 4:9ab0d84bbd07 14 void trf797xRawWrite(uint8_t *buffer, uint8_t length);
soumi_ghsoh 6:3c510c297e2f 15 //void trf797xStopDecoders(void);
soumi_ghsoh 6:3c510c297e2f 16 //void trf797xRunDecoders(void);
soumi_ghsoh 6:3c510c297e2f 17 //void trf797xTxNextSlot(void);
soumi_ghsoh 6:3c510c297e2f 18 //void trf797xtDisableSlotCounter(void);
soumi_ghsoh 6:3c510c297e2f 19 //void trf797xReset(void);
soumi_ghsoh 6:3c510c297e2f 20 //void trf797xTurnRfOn(void);
soumi_ghsoh 6:3c510c297e2f 21 //void trf797xTurnRfOff(void);
soumi_ghsoh 6:3c510c297e2f 22 //void trf797xWriteIsoControl(uint8_t iso_control);
soumi_ghsoh 6:3c510c297e2f 23 //void iso15693FindTag(void);
soumi_ghsoh 6:3c510c297e2f 24 //void iso15693Anticollision(uint8_t *mask, uint8_t length);
soumi_ghsoh 5:93c612f43ec2 25 void PowerUpNFC(void);
soumi_ghsoh 6:3c510c297e2f 26 void PowerDownNFC(void);
soumi_ghsoh 5:93c612f43ec2 27 void NFCInit(void);
soumi_ghsoh 5:93c612f43ec2 28 void RegisterReInitNFC(void);
soumi_ghsoh 6:3c510c297e2f 29 void RegistersReadNFC(void);
soumi_ghsoh 6:3c510c297e2f 30 void InventoryReqNFC(void);
soumi_ghsoh 6:3c510c297e2f 31 void ReadNFC(void);
soumi_ghsoh 6:3c510c297e2f 32 void PollNFC(void);
soumi_ghsoh 5:93c612f43ec2 33 // Booleans
rwclough 1:1eb96189824d 34 #define DESELECT 1
rwclough 1:1eb96189824d 35 #define SELECT 0
rwclough 1:1eb96189824d 36 #define ADDRESS 0
rwclough 1:1eb96189824d 37 #define COMMAND 1
rwclough 1:1eb96189824d 38 #define WRITE 0
rwclough 1:1eb96189824d 39 #define READ 1
soumi_ghsoh 5:93c612f43ec2 40 //led
soumi_ghsoh 5:93c612f43ec2 41 #define LED_ON 0
soumi_ghsoh 5:93c612f43ec2 42 #define LED_OFF 1
soumi_ghsoh 5:93c612f43ec2 43 #define FALSE 0
soumi_ghsoh 5:93c612f43ec2 44 #define TRUE 1
rwclough 1:1eb96189824d 45
soumi_ghsoh 5:93c612f43ec2 46 // Direct commands for trf797x
rwclough 1:1eb96189824d 47 #define IDLE 0x00
rwclough 1:1eb96189824d 48 #define SOFT_INIT 0x03
rwclough 1:1eb96189824d 49 #define INITIAL_RF_COLLISION 0x04
rwclough 1:1eb96189824d 50 #define RESPONSE_RF_COLLISION_N 0x05
rwclough 1:1eb96189824d 51 #define RESPONSE_RF_COLLISION_0 0x06
rwclough 1:1eb96189824d 52 #define RESET 0x0F
rwclough 1:1eb96189824d 53 #define TRANSMIT_NO_CRC 0x10
rwclough 1:1eb96189824d 54 #define TRANSMIT_CRC 0x11
rwclough 1:1eb96189824d 55 #define DELAY_TRANSMIT_NO_CRC 0x12
rwclough 1:1eb96189824d 56 #define DELAY_TRANSMIT_CRC 0x13
rwclough 1:1eb96189824d 57 #define TRANSMIT_NEXT_SLOT 0x14
rwclough 1:1eb96189824d 58 #define CLOSE_SLOT_SEQUENCE 0x15
rwclough 1:1eb96189824d 59 #define STOP_DECODERS 0x16
rwclough 1:1eb96189824d 60 #define RUN_DECODERS 0x17
rwclough 1:1eb96189824d 61 #define CHECK_INTERNAL_RF 0x18
rwclough 1:1eb96189824d 62 #define CHECK_EXTERNAL_RF 0x19
rwclough 1:1eb96189824d 63 #define ADJUST_GAIN 0x1A
rwclough 1:1eb96189824d 64
soumi_ghsoh 5:93c612f43ec2 65 // Registers for trf797x
rwclough 1:1eb96189824d 66 #define CHIP_STATUS_CONTROL 0x00
rwclough 1:1eb96189824d 67 #define ISO_CONTROL 0x01
rwclough 1:1eb96189824d 68 #define ISO_14443B_OPTIONS 0x02
rwclough 1:1eb96189824d 69 #define ISO_14443A_OPTIONS 0x03
rwclough 1:1eb96189824d 70 #define TX_TIMER_EPC_HIGH 0x04
rwclough 1:1eb96189824d 71 #define TX_TIMER_EPC_LOW 0x05
rwclough 1:1eb96189824d 72 #define TX_PULSE_LENGTH_CONTROL 0x06
rwclough 1:1eb96189824d 73 #define RX_NO_RESPONSE_WAIT_TIME 0x07
rwclough 1:1eb96189824d 74 #define RX_WAIT_TIME 0x08
rwclough 1:1eb96189824d 75 #define MODULATOR_CONTROL 0x09
rwclough 1:1eb96189824d 76 #define RX_SPECIAL_SETTINGS 0x0A
rwclough 1:1eb96189824d 77 #define REGULATOR_CONTROL 0x0B
rwclough 1:1eb96189824d 78 #define IRQ_STATUS 0x0C
rwclough 1:1eb96189824d 79 #define IRQ_MASK 0x0D
rwclough 1:1eb96189824d 80 #define COLLISION_POSITION 0x0E
rwclough 1:1eb96189824d 81 #define RSSI_LEVELS 0x0F
rwclough 1:1eb96189824d 82 #define SPECIAL_FUNCTION_1 0x10
rwclough 1:1eb96189824d 83 #define SPECIAL_FUNCTION_2 0x11
rwclough 1:1eb96189824d 84 #define RAM_0 0x12
rwclough 1:1eb96189824d 85 #define RAM_1 0x13
rwclough 1:1eb96189824d 86 #define FIFO_IRQ_LEVELS_ADJ 0x14
rwclough 1:1eb96189824d 87 #define RESERVED 0x15
rwclough 1:1eb96189824d 88 #define NFC_LOW_DETECTION 0x16
rwclough 2:bd5afc5aa139 89 #define NFCID 0x17
rwclough 1:1eb96189824d 90 #define NFC_TARGET_LEVEL 0x18
rwclough 1:1eb96189824d 91 #define NFC_TARGET_PROTOCOL 0x19
rwclough 1:1eb96189824d 92 #define TEST_SETTINGS_1 0x1A
rwclough 1:1eb96189824d 93 #define TEST_SETTINGS_2 0x1B
rwclough 2:bd5afc5aa139 94 #define FIFO_CONTROL 0x1C
rwclough 2:bd5afc5aa139 95 #define TX_LENGTH_BYTE_1 0x1D
rwclough 2:bd5afc5aa139 96 #define TX_LENGTH_BYTE_2 0x1E
rwclough 2:bd5afc5aa139 97 #define FIFO 0x1F
rwclough 2:bd5afc5aa139 98
rwclough 2:bd5afc5aa139 99 // BITs
rwclough 2:bd5afc5aa139 100 #define BIT0 0x01 // 0b00000001
rwclough 2:bd5afc5aa139 101 #define BIT1 0x02 // 0b00000010
rwclough 2:bd5afc5aa139 102 #define BIT2 0x40 // 0b00000100
rwclough 2:bd5afc5aa139 103 #define BIT3 0x08 // 0b00001000
rwclough 2:bd5afc5aa139 104 #define BIT4 0x10 // 0b00010000
rwclough 2:bd5afc5aa139 105 #define BIT5 0x20 // 0b00100000
rwclough 2:bd5afc5aa139 106 #define BIT6 0x40 // 0b01000000
rwclough 2:bd5afc5aa139 107 #define BIT7 0x80 // 0b10000000
rwclough 2:bd5afc5aa139 108
rwclough 2:bd5afc5aa139 109 // Misc
rwclough 2:bd5afc5aa139 110 #define SIXTEEN_SLOTS 0x06
rwclough 2:bd5afc5aa139 111 #define ONE_SLOT 0x26
soumi_ghsoh 5:93c612f43ec2 112