⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rc500reg.h

📁 门禁系统原代码,KEIL开发环境,完整门禁协议,基于MFRC500和51单片机
💻 H
字号:
//////////////////////////////////////////////////////////////////////////////
// ChinaVision
// RC500 Header File - RC500 Register and Commaands
// Ver 0.00	
// Last Updated: 11/09/2002                                     
//
//////////////////////////////////////////////////////////////////////////////

//Register of MFRC500

#define RegPage				XBYTE[0xbf00]
#define RegCommand     		XBYTE[0xbf01]
#define RegFIFOData   		XBYTE[0xbf02]
#define RegPrimaryStatus  	XBYTE[0xbf03]
#define RegFIFOLength   	XBYTE[0xbf04]
#define RegSecondaryStatus XBYTE[0xbf05]
#define RegInterruptEn     XBYTE[0xbf06]
#define RegInterruptRq     XBYTE[0xbf07]
#define RegPage1      		XBYTE[0xbf08]
#define RegControl     		XBYTE[0xbf09]
#define RegErrorFlag    	XBYTE[0xbf0a]
#define RegCollPos     		XBYTE[0xbf0b]
#define RegTimerValue  		XBYTE[0xbf0c]
#define RegCRCResultLSB 	XBYTE[0xbf0d]
#define RegCRCResultMSB 	XBYTE[0xbf0e]
#define RegBitFraming  		XBYTE[0xbf0f]

#define RegPage2      		XBYTE[0xbf10]
#define RegTxControl   		XBYTE[0xbf11]
#define RegCwConductance 	XBYTE[0xbf12]
#define RFU13      			XBYTE[0xbf13]
#define RegCoderControl		XBYTE[0xbf14]
#define RegModWidth   		XBYTE[0xbf15]
#define RFU16      			XBYTE[0xbf16]
#define RFU17      			XBYTE[0xbf17]
#define RegPage3      		XBYTE[0xbf18]
#define RegRxControl1  		XBYTE[0xbf19]
#define RegDecoderControl 	XBYTE[0xbf1a]
#define RegBitPhase      	XBYTE[0xbf1b]
#define RegRxThreshold     XBYTE[0xbf1c]
#define RFU1D      			XBYTE[0xbf1d]
#define RegRxControl2  		XBYTE[0xbf1e]
#define RegClockQControl 	XBYTE[0xbf1f]

#define RegPage4    			XBYTE[0xbf20]
#define RegRxWait   			XBYTE[0xbf21]
#define RegChannelRedundancy 	XBYTE[0xbf22]
#define RegCRCPresetLSB      	XBYTE[0xbf23]
#define RegCRCPresetMSB	 		XBYTE[0xbf24]
#define RFU25   					XBYTE[0xbf25]
#define RegMfOutSelect      	XBYTE[0xbf26]
#define RFU27      				XBYTE[0xbf27]
#define RegPage5      			XBYTE[0xbf28]
#define RegFIFOLevel  			XBYTE[0xbf29]
#define RegTimerClock      	XBYTE[0xbf2a]
#define RegTimerControl      	XBYTE[0xbf2b]
#define RegTimerReload      	XBYTE[0xbf2c]
#define RegIRqPinConfig      	XBYTE[0xbf2d]
#define RFU2E   					XBYTE[0xbf2e]
#define RFU2F     				XBYTE[0xbf2f]

#define RegPage6  				XBYTE[0xbf30]
#define RFU31   					XBYTE[0xbf31]
#define RFU32           		XBYTE[0xbf32]
#define RFU33      				XBYTE[0xbf33]
#define RFU34	        			XBYTE[0xbf34]
#define RFU35   					XBYTE[0xbf35]
#define RFU36      				XBYTE[0xbf36]
#define RFU37      				XBYTE[0xbf37]
#define RegPage7      			XBYTE[0xbf38]
#define RFU39  	        		XBYTE[0xbf39]
#define RegTestAnaSelect   	XBYTE[0xbf3a]
#define RFU3B      				XBYTE[0xbf3b]
#define RFU3C      				XBYTE[0xbf3c]
#define RegTestDigiSelect  	XBYTE[0xbf3d]
#define RFU3E   					XBYTE[0xbf3e]
#define RegTestDigiAccess  	XBYTE[0xbf3f]
//------------------------------------------------

//------------------------------------------------
//                   P C D - C O M M A N D S
#define PCD_IDLE           0x00 /*!< No action: cancel current command
                                or home state */
#define PCD_WRITEE2        0x01 //!< Get data from FIFO and write it to the E2PROM
#define PCD_READE2         0x03 /*!< Read data from E2PROM and put it into the
                                FIFO */
#define PCD_LOADCONFIG     0x07 /*!< Read data from E2PROM and initialise the
                                registers */
#define PCD_LOADKEYE2      0x0B /*!< Read a master key from the E2PROM and put
                                it into the master key buffer */
#define PCD_AUTHENT1       0x0C /*!< Perform the first part of the card
                                authentication using the Crypto1 algorithm.

                                Remark: The master key is automatically taken
                                from the master key buffer. this implies,
                                that the command LoadKeyE2 has to be executed
                                before using a certain key for card
                                authentication */
#define PCD_CALCCRC        0x12 /*!< Activate the CRC-Coprocessor

                                Remark: The result of the CRC calculation can
                                be read from the register CRCResultXXX */
#define PCD_AUTHENT2       0x14 /*!< Perform the second part of the card
                                authentication using the Crypto1 algorithm. */
#define PCD_RECEIVE        0x16 /*!< Activate Receiver Circuitry. Before the
                                receiver actually starts, the state machine
                                waits until the time configured in the
                                register RxWait has passed.

                                Remark: It is possible to read any received
                                data from the FIFO while the Receive command
                                is active. Thus it is possible to receive an
                                unlimited number of bytes by reading them
                                from the FIFO in timer. */
#define PCD_LOADKEY        0x19 /*!< Read a master key from the FIFO and put it
                                into the master key buffer

                                Remark: The master key has to be prepared in
                                a certain format. Thus, 12 byte have to be
                                passed to load a 6 byte master key */
#define PCD_TRANSMIT       0x1A /*!< Transmit data from FIFO to the card

                                Remark: If data is already in the FIFO when
                                the command is activated, this data is
                                transmitted immediately. It is possible to
                                write data to the FIFO while the Transmit
                                command is active. Thus it is possible to
                                transmit an unlimited number of bytes in one
                                stream by writting them to the FIFO in time.*/
#define PCD_TRANSCEIVE     0x1E /*!< Transmits data from FIFO to the card and
                                after that automatically activates the
                                receiver. Before the receiver actually
                                starts,the state machine waits until the
                                time configured in the register RxWait has
                                passed.

                                Remark: This command is the combination of
                                Transmit and Receive.*/
#define PCD_RESETPHASE     0x3F /*!< Runs the Reset- and Initialisation Phase
                                Remark: This command can not be activated by
                                software, but only by a Power-On or
                                Hard Reset */
//-------------------------------
// General Include File for serveral defines concerning conditional library
// compilation and microcontroller usage

#define PICC_REQIDL        0x26         //!< request idle
#define PICC_REQALL        0x52         //!< request all
#define PICC_ANTICOLL1     0x93         //!< anticollision level 1 106 kBaud
#define PICC_ANTICOLL2     0x95         //!< anticollision level 2
#define PICC_ANTICOLL3     0x97         //!< anticollision level 3
#define PICC_AUTHENT1A     0x60         //!< authentication using key A
#define PICC_AUTHENT1B     0x61         //!< authentication using key B
#define PICC_READ          0x30         //!< read block
#define PICC_WRITE         0xA0         //!< write block
#define PICC_DECREMENT     0xC0         //!< decrement value
#define PICC_INCREMENT     0xC1         //!< increment value
#define PICC_RESTORE       0xC2         //!< restore command code
#define PICC_TRANSFER      0xB0         //!< transfer command code
#define PICC_HALT          0x50         //!< halt


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -