+// ISO15693 COMMANDS
+#define ISO15693_INVENTORY 0x01
+#define ISO15693_STAYQUIET 0x02
+#define ISO15693_READBLOCK 0x20
+#define ISO15693_WRITEBLOCK 0x21
+#define ISO15693_LOCKBLOCK 0x22
+#define ISO15693_READ_MULTI_BLOCK 0x23
+#define ISO15693_SELECT 0x25
+#define ISO15693_RESET_TO_READY 0x26
+#define ISO15693_WRITE_AFI 0x27
+#define ISO15693_LOCK_AFI 0x28
+#define ISO15693_WRITE_DSFID 0x29
+#define ISO15693_LOCK_DSFID 0x2A
+#define ISO15693_GET_SYSTEM_INFO 0x2B
+#define ISO15693_READ_MULTI_SECSTATUS 0x2C
+
+// ISO15693 REQUEST FLAGS
+#define ISO15693_REQ_SUBCARRIER_TWO (1<<0)
+#define ISO15693_REQ_DATARATE_HIGH (1<<1)
+#define ISO15693_REQ_INVENTORY (1<<2)
+#define ISO15693_REQ_PROTOCOL_EXT (1<<3) // RFU
+#define ISO15693_REQ_OPTION (1<<6) // Command specific option selector
+// when REQ_INVENTORY is not set
+#define ISO15693_REQ_SELECT (1<<4) // only selected cards response
+#define ISO15693_REQ_ADDRESS (1<<5) // this req contains an address
+// when REQ_INVENTORY is set
+#define ISO15693_REQINV_AFI (1<<4) // AFI Field is present
+#define ISO15693_REQINV_SLOT1 (1<<5) // 1 Slot (16 slots if not set)
+
+// ISO15693 RESPONSE FLAGS
+#define ISO15693_RES_ERROR (1<<0)
+#define ISO15693_RES_EXT (1<<3) // Protocol Extention
+
+// ISO15693 RESPONSE ERROR CODES
+#define ISO15693_NOERROR 0x00
+#define ISO15693_ERROR_CMD_NOT_SUP 0x01 // Command not supported
+#define ISO15693_ERROR_CMD_NOT_REC 0x02 // Command not recognized (eg. parameter error)
+#define ISO15693_ERROR_CMD_OPTION 0x03 // Command option not supported
+#define ISO15693_ERROR_GENERIC 0x0F // No additional Info about this error
+#define ISO15693_ERROR_BLOCK_UNAVAILABLE 0x10
+#define ISO15693_ERROR_BLOCK_LOCKED_ALREADY 0x11 // cannot lock again
+#define ISO15693_ERROR_BLOCK_LOCKED 0x12 // cannot be changed
+#define ISO15693_ERROR_BLOCK_WRITE 0x13 // Writing was unsuccessful
+#define ISO15693_ERROR_BLOCL_WRITELOCK 0x14 // Locking was unsuccessful
+
+
+// Topaz command set:
+#define TOPAZ_REQA 0x26 // Request
+#define TOPAZ_WUPA 0x52 // WakeUp
+#define TOPAZ_RID 0x78 // Read ID
+#define TOPAZ_RALL 0x00 // Read All (all bytes)
+#define TOPAZ_READ 0x01 // Read (a single byte)
+#define TOPAZ_WRITE_E 0x53 // Write-with-erase (a single byte)
+#define TOPAZ_WRITE_NE 0x1a // Write-no-erase (a single byte)
+// additional commands for Dynamic Memory Model
+#define TOPAZ_RSEG 0x10 // Read segment
+#define TOPAZ_READ8 0x02 // Read (eight bytes)
+#define TOPAZ_WRITE_E8 0x54 // Write-with-erase (eight bytes)
+#define TOPAZ_WRITE_NE8 0x1B // Write-no-erase (eight bytes)
+
+// HITAG1 commands
+#define HITAG1_SET_CCNEW 0xC2 // left 5 bits only
+#define HITAG1_READ_ID 0x00 // not a real command, consists of 5 bits length, <length> bits partial SN, 8 bits CRC
+#define HITAG1_SELECT 0x00 // left 5 bits only, followed by 32 bits SN and 8 bits CRC
+#define HITAG1_WRPPAGE 0x80 // left 4 bits only, followed by 8 bits page and 8 bits CRC
+#define HITAG1_WRPBLK 0x90 // left 4 bits only, followed by 8 bits block and 8 bits CRC
+#define HITAG1_WRCPAGE 0xA0 // left 4 bits only, followed by 8 bits page or key information and 8 bits CRC
+#define HITAG1_WRCBLK 0xB0 // left 4 bits only, followed by 8 bits block and 8 bits CRC
+#define HITAG1_RDPPAGE 0xC0 // left 4 bits only, followed by 8 bits page and 8 bits CRC
+#define HITAG1_RDPBLK 0xD0 // left 4 bits only, followed by 8 bits block and 8 bits CRC
+#define HITAG1_RDCPAGE 0xE0 // left 4 bits only, followed by 8 bits page and 8 bits CRC
+#define HITAG1_RDCBLK 0xF0 // left 4 bits only, followed by 8 bits block and 8 bits CRC
+#define HITAG1_HALT 0x70 // left 4 bits only, followed by 8 bits (dummy) page and 8 bits CRC
+
+// HITAG2 commands
+#define HITAG2_START_AUTH 0xC0 // left 5 bits only
+#define HITAG2_READ_PAGE 0xC0 // page number in bits 5 to 3, page number inverted in bit 0 and following 2 bits
+#define HITAG2_READ_PAGE_INVERTED 0x44 // page number in bits 5 to 3, page number inverted in bit 0 and following 2 bits
+#define HITAG2_WRITE_PAGE 0x82 // page number in bits 5 to 3, page number inverted in bit 0 and following 2 bits
+#define HITAG2_HALT 0x00 // left 5 bits only
+
+#define ISO_14443A 0
+#define ICLASS 1
+#define ISO_14443B 2
+#define TOPAZ 3
+#define PROTO_MIFARE 4
+#define ISO_7816_4 5
+#define ISO_15693 6
+#define ISO_14443_4 7
+