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

📄 prd_picoreadrf_pages_parameters.h

📁 读RF卡的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
//=============================================================================
//                  Copyright (C) INSIDE Contactless 1998-2005
//
// INSIDE Contactless reserves the right to make changes, without notice,
// to any product (including application note) herein to improve
// reliability, functionality, or design. INSIDE Contactless advises its
// customers to obtain the latest version of device data sheets to verify,
// before placing orders, that the information being relied upon by the
// customer is current.
//
// INSIDE Contactless makes no warranty that the use will not infringe any
// third party patent, copyright or trademark.
//
// Information furnished by INSIDE Contactless is believed to be accurate
// and reliable. However, INSIDE Contactless does not assume any liability
// resulting from the application or use of any product described within.
//
// All rights are reserved. Reproduction in whole or in part is prohibited
// without the written consent of the copyright owner.
//
//      Bat 11a,
//      Parc Club du Golf,
//      Z.A.C. du Pichaury                      Tel :   +33 (0)4.42.39.33.00
//      13856 Aix-en-Provence Cedex 3           Fax :   +33 (0)4.42.39.63.19
//      FRANCE                                  Email : info@insidefr.com
//
//-----------------------------------------------------------------------------
// Project Code : PICOREAD_RF C LIBRARY
// Project Name : PICOREAD_RF C LIBRARY
// Module Name  : PRD_PICOREADRF_PAGES_PARAMETERS.H
// Platform dev : Keil 礦ision 3 (IDE ) + Keil ARM Compiler
// Target       : LPC2129 (ARM7TDMI Core)
// Language     : C ANSI
// Revision     : 1.1
// Description  : Definition of PicoRead chip registers
//=============================================================================
// When     Who	Ver 	What
// 06-04-24	MCY	1.01	Added #ifndef __PICOREAD_DEFINES_H
// 06-06-28	MCY 1.02	Add some Errors code (from obsolete file General_Defines.h)
//                      ERR_NO_ERROR, ERR_COLL, ERR_NOCARD, ERR_CRC, ERR_ISOB              	

//=============================================================================
#ifndef __PRD_PICOREADRF_PAGES_PARAMETERS_H__ 	
#define	__PRD_PICOREADRF_PAGES_PARAMETERS_H__

//=====================================
// COMMON PARAMETERS
//=====================================
// Parameters[0] : Bit rate
#define P0_S106K            0x00    // 106kbps emission bit rate supported by reader
#define P0_S212K            0x01    // 212kbps emission bit rate supported by reader
#define P0_S424K            0x02    // 424kbps emission bit rate supported by reader
#define P0_S848K            0x04    // 848kbps emission bit rate supported by reader
#define P0_R106K            0x00    // 106kbps reception bit rate supported by reader
#define P0_R212K            0x10    // 212kbps reception bit rate supported by reader
#define P0_R424K            0x20    // 424kbps reception bit rate supported by reader
#define P0_R848K            0x40    // 848kbps reception bit rate supported by reader

#define P0_USE_CHIP_BR      0x08    // Use max bit rate supported by reader and chip



// Parameters[1] : Frame size
#define P1_FS16             0x00    // Reader max frame size is 16 bytes
#define P1_FS24             0x10    // Reader max frame size is 24 bytes
#define P1_FS32             0x20    // Reader max frame size is 32 bytes
#define P1_FS40             0x30    // Reader max frame size is 40 bytes
#define P1_FS48             0x40    // Reader max frame size is 48 bytes
#define P1_FS64             0x50    // Reader max frame size is 64 bytes
#define P1_FS96             0x60    // Reader max frame size is 96 bytes
#define P1_FS128            0x70    // Reader max frame size is 128 bytes
#define P1_FS256            0x80    // Reader max frame size is 256 bytes

#define P1_USE_CHIP_FS      0x01    // Use max frame size supported by reader and chip


//=====================================
// Page 0
#define P0_ACCESS_P5	    0x80    // Direct access to page 5
#define P0_REG_NO_RST       0x40    // =0 to apply a reset
#define P0_PAGE_SELECT_MSK         0x1C    // Mask for page number
#define P0_PAGE_SELECT_0           0x00    // Page 0 selection : This page
#define P0_PAGE_SELECT_1           0x04    // Page 1 selection : Protocol #1 definition
#define P0_PAGE_SELECT_2           0x08    // Page 2 selection : Protocol #2 definition
#define P0_PAGE_SELECT_3           0x0C    // Page 3 selection : Protocol #3 definition
#define P0_PAGE_SELECT_4           0x10    // Page 4 selection : Protocol #4 definition
#define P0_PAGE_SELECT_5           0x14    // Page 5 selection : RF Communication
#define P0_PAGE_SELECT_6           0x18    // Page 6 selection : Configuration
#define P0_PAGE_SELECT_7           0x1C    // Page 7 selection : RFU
#define P0_RW_BIT_READ			   0x20    // Toggles Read/Write into the config Block
#define P0_RW_BIT_WRITE			   0x00    // Write	


#define P0_RFON             	   0x02    // Put the RF ON if 1 or OFF if 0


//=====================================
// Page 1..4 : Protocol definitions

// Page 1..4 : Reg 0 : Frame Codec
#define SEND_EOF           0x40        // Send an End Of Frame sequence
#define SEND_STOP_BIT_0    0x00        // Don't send STOP bits
#define SEND_STOP_BIT_1    0x08        // Send 1 stop bit (ISO B only)
#define SEND_STOP_BIT_2    0x10        // Send 2 stop bit (ISO B only)
#define SEND_STOP_BIT_3    0x18        // Send 3 stop bit (ISO B only)
#define PARITY_EN          0x04        // Send a parity bit
#define SEND_START_BIT     0x02        // Send a start bit
#define SEND_SOF           0x01        // Send a Start Of Frame sequence


// Page 1..4 : Reg 1 : Frame DeCod
#define RCV_EOF           0x40        // Receive an End Of Frame sequence
#define RCV_STOP          0x10        // Receive a stop bit
#define PARITY_ODD        0x00        // Parity is ODD
#define PARITY_EVEN       0x08        // Parity is EVEN
#define RCV_START_BIT     0x02        // Receive a start bit
#define RCV_SOF           0x01        // Receive a Start Of Frame sequence


// Page 1..4 : Reg 2 : Bit Codec
#define CODING_ISO_15693      0x00        // Send data using ISO 15693 protocol
#define CODING_ISO_14443A     0x10        // Send data using ISO 14443-A protocol
#define CODING_ISO_14443B     0x20        // Send data using ISO 14443-B protocol
#define CODING_ISO_SONY       0x30        // Send data using SONY (FELICA) protocol

#define DECODING_ISO_15693      0x00        // Receive data using ISO 15693 protocol
#define DECODING_ISO_14443A     0x01        // Receive data using ISO 14443-A protocol
#define DECODING_ISO_14443B     0x02        // Receive data using ISO 14443-B protocol
#define DECODING_ISO_SONY       0x03        // Receive data using SONY (FELICA) protocol


// Page 1..4 : Reg 3 : Bit Rate, SOF, Header
#define CODING_BIT_RATE_106K          0xC0        // Emission rate is fixed to 106Kbits/s
#define CODING_BIT_RATE_212K          0x80        // Emission rate is fixed to 212Kbits/s
#define CODING_BIT_RATE_424K          0x40        // Emission rate is fixed to 424Kbits/s
#define CODING_BIT_RATE_848K          0x00        // Emission rate is fixed to 848Kbits/s

#define DECODING_BIT_RATE_106K          0x30        // Reception rate is fixed to 106Kbits/s
#define DECODING_BIT_RATE_212K          0x20        // Reception rate is fixed to 212Kbits/s
#define DECODING_BIT_RATE_424K          0x10        // Reception rate is fixed to 424Kbits/s
#define DECODING_BIT_RATE_848K          0x00        // Reception rate is fixed to 848Kbits/s

#define SOF_TYPE_RFU         0x0C        // SOF lenght is RFU
#define SOF_TYPE_0           0x08        // SOF is done with bit = 0
#define SOF_TYPE_1           0x04        // SOF is done with bit = 1 (ISO A)
#define SOF_TYPE_10          0x00        // SOF is 10 bits

#define HEADER_LEN_RFU        0x03        // HEAD length RFU
#define HEADER_LEN_32SUB      0x02        // HEAD = TR1 = 32 subcarrier clock before TR0
#define HEADER_LEN_10ETU      0x01        // HEAD = TR1 = 10 ETU before TR0
#define HEADER_LEN_4ETU       0x00        // HEAD = TR1 = 4 ETU before TR0


// Page 1..4 : Reg 4 : MOD_INDEX, CRC.....
#define MOD_RFU         0x00        // MOD_INDEX(page 6) is used

#define CRC_INV_ENABLE    0x10        // Invert CRC (!CRC) when sending or receiving data
#define CRC_INV_DISABLE   0x00        // Do not invert CRC when sending or receiving data

#define CRC_SKIP_8       0x08        // Skip 8 bytes before CRC activation when sending data (SONY)
#define CRC_SKIP_1       0x04        // Skip 1 byte before CRC activation when sending data (PicoXXX family)
#define CRC_SKIP_0       0x00        // CRC is calculated from the first byte

#define CRC_INIT_E012   0x03        // Initial CRC value point on predefined E012 value
#define CRC_INIT_6363   0x02        // Initial CRC value point on predefined 6363 value
#define CRC_INIT_FFFF   0x01        // Initial CRC value point on predefined FFFF value
#define CRC_INIT_CUST   0x00        // Initial CRC value point on custom value stored in page 6


//=====================================
// Page 5 : Reg 0 : Cofig Register
#define P5_ACCESS_P5    	0x80    // Directly connect to this page to send or receive data
#define P5_EMI_REC_RECEPTION      0x40    // Put the chip in reception mode
#define P5_EMI_REC_EMISSION    	  0x00    // Put the chip is emission mode
#define P5_PAGE_USED_4            0x30    // Choose protocol #3 to exchange data
#define P5_PAGE_USED_3            0x20    // Choose protocol #2 to exchange data
#define P5_PAGE_USED_2            0x10    // Choose protocol #1 to exchange data
#define P5_PAGE_USED_1            0x00    // Choose protocol #0 to exchange data
#define P5_CRC_EN           0x08    // Send the CRC in emission mode or reception mode
#define P5_SOF_ONLY         0x04    // Only send the SOF
#define P5_EOF_ONLY         0x02    // Only send the EOF
#define P5_EXT_REG          0x01    // Next byte is send if this bit is set to 1

// Page 5 : Reg 1 : Extension register
#define P5_OOB              0x80    // Send only one byte
#define P5_NB_BIT_7BITS           0x70    // Send 7 bits or 7 bits received
#define P5_NB_BIT_6BITS           0x60    // ...
#define P5_NB_BIT_5BITS           0x50
#define P5_NB_BIT_4BITS           0x40
#define P5_NB_BIT_3BITS           0x30
#define P5_NB_BIT_2BITS           0x20
#define P5_NB_BIT_1BITS           0x10    // ...
#define P5_NB_BIT_8BITS           0x00    // Full byte received

#define P5_OTB              0x08    // Only 2 bytes to send. only used in chip emulation for ISO A


//=====================================
// Page 6

// Page 6 : Reg 0 : Emitter configuration
#define P6_MOD_INDEX_MAX             0xFC    // Max MOD_INDEX value = 111111
#define P6_MOD_INDEX_MAX_R2R         0x00
#define P6_MOD_INDEX_MIN_R2R         0xF8
#define P6_MOD_INDEX_R2R             0x80
#define P6_ANT_TYPE_DIFFERENTIAL_NP  0x00    // Output antenna configuration : Differential, Nominal power

⌨️ 快捷键说明

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