📄 mfrc500.h
字号:
/*
* Copyright (c), Philips Semiconductors Gratkorn / Austria
*
* (C)PHILIPS Electronics N.V.2000
* All rights are reserved. Reproduction in whole or in part is
* prohibited without the written consent of the copyright owner.
* Philips reserves the right to make changes without notice at any time.
* Philips makes no warranty, expressed, implied or statutory, including but
* not limited to any implied warranty of merchantability or fitness for any
*particular purpose, or that the use will not infringe any third party patent,
* copyright or trademark. Philips must not be liable for any loss or damage
* arising from its use.
*/
#ifndef MFRC500_H
#define MFRC500_H
#ifdef __cplusplus
extern "C"
{
#endif
// General Include File for serveral defines concerning conditional library
// compilation and microcontroller usage
#include "OsDefs.h"
#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
/*
* This function has to be called before the first data is written to the
* MF RC500 in order to perform the internal configuration. A reset of the
* MF RC500 is done and several registers are set.
*/
FCT_PREF Mf500PcdConfig(void);
/*
* The MF RC500 reader IC configured in the slave configuration is able to
* communicate with another MF RC500 configured in the master configuration
* via the digital <em>MFin</em> and <em>MFOut</em> pins.
*
* The master MF RC500 reader IC sends commands and data using the
* <em>MFOut</em> pin. The slave reader IC receives the data via
* <em>MFin</em> pin. Sending data back from the slave IC is done connecting the
* <em>MFOut</em> for the slave IC and <em>MFin</em> for the master MF RC500.
*
* In this configuration the slave module can not be initialized by the
* microcontroller because only the <em>mifare in/out</em> interface is
* connected between both MF RC500's. The slave module has to be initialized
* before the connection is established. During this initialization the
* appropriate parameter settings are written to the E2PROM.
* After POR (power on reset) the IC reads these settings and initializes
* itself automatically as slave IC.
*
* Additionally, it is possible to connect the slave reader Ic to the 礐
* to have the possibility to change the setting in the application later.
*/
FCT_PREF Mf500ActiveAntennaSlaveConfig(void);
/*
* This function initializes the master reader IC to use it in an active antenna
* configuration.
*
* This function is additional to the standard configuration
* <em>Mf500PcdConfig</em>.
*
* The MF RC500 reader IC configured in the master
* configuration is able to communicate with another MF RC500 configured in the
* slave configuration via the digital <em>MFin</em> and <em>MFout</em> pins.
* The corresponding slave configuration routine for the slave MF RC 500 can be
* initialized by the function <em>MF500ActiveAntennaSlaveConfig</em>.
*/
FCT_PREF Mf500ActiveAntennaMasterConfig(void);
/*
* Set MIFARE PCD (Proximity Coupling Device) with
* default values for the baudrate divider (106 kBaud).
*/
FCT_PREF Mf500PcdSetDefaultAttrib(void);
/*
* This function accesses the reader module and activates sending the REQ code
* to the MIFARE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -