pn53x.h

Go to the documentation of this file.
00001 
00024 #ifndef __NFC_CHIPS_PN53X_H__
00025 #define __NFC_CHIPS_PN53X_H__
00026 
00027 #include <nfc/nfc-types.h>
00028 
00029 #define MAX_FRAME_LEN       264
00030 
00031 // Registers and symbols masks used to covers parts within a register
00032 #define REG_CIU_TX_MODE           0x6302
00033   #define SYMBOL_TX_CRC_ENABLE      0x80
00034 #define REG_CIU_RX_MODE           0x6303
00035   #define SYMBOL_RX_CRC_ENABLE      0x80
00036   #define SYMBOL_RX_NO_ERROR        0x08
00037   #define SYMBOL_RX_MULTIPLE        0x04
00038 #define REG_CIU_TX_AUTO           0x6305
00039   #define SYMBOL_FORCE_100_ASK      0x40
00040   #define SYMBOL_AUTO_WAKE_UP       0x20
00041   #define SYMBOL_INITIAL_RF_ON      0x04
00042 #define REG_CIU_MANUAL_RCV        0x630D
00043   #define SYMBOL_PARITY_DISABLE     0x10
00044 #define REG_CIU_STATUS2           0x6338
00045   #define SYMBOL_MF_CRYPTO1_ON      0x08
00046 #define REG_CIU_CONTROL           0x633C
00047   #define SYMBOL_INITIATOR          0x10
00048   #define SYMBOL_RX_LAST_BITS       0x07
00049 #define REG_CIU_BIT_FRAMING       0x633D
00050   #define SYMBOL_TX_LAST_BITS       0x07
00051 
00052 // Internal parameters flags
00053 #define PARAM_NONE                  0x00
00054 #define PARAM_NAD_USED              0x01
00055 #define PARAM_DID_USED              0x02
00056 #define PARAM_AUTO_ATR_RES          0x04
00057 #define PARAM_AUTO_RATS             0x10
00058 #define PARAM_14443_4_PICC          0x20
00059 #define PARAM_NO_AMBLE              0x40
00060 
00061 // Radio Field Configure Items           // Configuration Data length
00062 #define RFCI_FIELD                  0x01 //  1 
00063 #define RFCI_TIMING                 0x02 //  3
00064 #define RFCI_RETRY_DATA             0x04 //  1
00065 #define RFCI_RETRY_SELECT           0x05 //  3
00066 #define RFCI_ANALOG_TYPE_A_106      0x0A // 11
00067 #define RFCI_ANALOG_TYPE_A_212_424  0x0B //  8
00068 #define RFCI_ANALOG_TYPE_B          0x0C //  3
00069 #define RFCI_ANALOG_TYPE_14443_4    0x0D //  9
00070 
00071 bool pn53x_transceive(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen, byte_t* pbtRx, size_t* pszRxLen);
00072 byte_t pn53x_get_reg(const nfc_device_t* pnd, uint16_t ui16Reg);
00073 bool pn53x_set_reg(const nfc_device_t* pnd, uint16_t ui16Reg, uint8_t ui8SybmolMask, uint8_t ui8Value);
00074 bool pn53x_set_parameters(const nfc_device_t* pnd, uint8_t ui8Value);
00075 bool pn53x_set_tx_bits(const nfc_device_t* pnd, uint8_t ui8Bits);
00076 bool pn53x_wrap_frame(const byte_t* pbtTx, const size_t szTxBits, const byte_t* pbtTxPar, byte_t* pbtFrame, size_t* pszFrameBits);
00077 bool pn53x_unwrap_frame(const byte_t* pbtFrame, const size_t szFrameBits, byte_t* pbtRx, size_t* pszRxBits, byte_t* pbtRxPar);
00078 
00079 #endif // __NFC_CHIPS_PN53X_H__
00080 
Generated by  doxygen 1.6.2-20100208