📄 rdio.lst
字号:
C51 COMPILER V7.20 RDIO 12/08/2004 10:59:27 PAGE 1
C51 COMPILER V7.20, COMPILATION OF MODULE RDIO
OBJECT MODULE PLACED IN RDIO.OBJ
COMPILER INVOKED BY: C:\winXP\keil\C51\BIN\C51.EXE RDIO.C LARGE WARNINGLEVEL(0) BROWSE INCDIR(D:\UsefulDocument\Mifare\M
-F RC500\MFRC500 Demo Reader\RC500\For Test) DEBUG OBJECTEXTEND CODE LISTINCLUDE SYMBOLS
line level source
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c), Philips Semiconductors Gratkorn
3 //
4 // (C)PHILIPS Electronics N.V.2000
5 // All rights are reserved. Reproduction in whole or in part is
6 // prohibited without the written consent of the copyright owner.
7 // Philips reserves the right to make changes without notice at any time.
8 // Philips makes no warranty, expressed, implied or statutory, including but
9 // not limited to any implied warranty of merchantibility or fitness for any
10 //particular purpose, or that the use will not infringe any third party patent,
11 // copyright or trademark. Philips must not be liable for any loss or damage
12 // arising from its use.
13 ///////////////////////////////////////////////////////////////////////////////
14 #include <rdio.h>
1 =1 ///////////////////////////////////////////////////////////////////////////////
2 =1 // Copyright (c), Philips Semiconductors Gratkorn
3 =1 //
4 =1 // (C)PHILIPS Electronics N.V.2000
5 =1 // All rights are reserved. Reproduction in whole or in part is
6 =1 // prohibited without the written consent of the copyright owner.
7 =1 // Philips reserves the right to make changes without notice at any time.
8 =1 // Philips makes no warranty, expressed, implied or statutory, including but
9 =1 // not limited to any implied warranty of merchantibility or fitness for any
10 =1 //particular purpose, or that the use will not infringe any third party patent,
11 =1 // copyright or trademark. Philips must not be liable for any loss or damage
12 =1 // arising from its use.
13 =1 ///////////////////////////////////////////////////////////////////////////////
14 =1 //
15 =1 // Projekt : M500
16 =1 // Files : RdIO.h RdIO.c
17 =1 // Created : 01.03.00
18 =1 // COMMENT : Reader IO routines
19 =1 //================== M O D I F I C A T I O N S ================================
20 =1 // Date : 01.03.00 User : HB
21 =1 // Comment: File created
22 =1 ///////////////////////////////////////////////////////////////////////////////
23 =1 #ifndef RDIO_H
24 =1 #define RDIO_H
25 =1
26 =1 // _____________________________________________________________________________
27 =1 //
28 =1 // FUNCTION: OpenIO
29 =1 // IN: -
30 =1 // OUT: -
31 =1 // RETURN: 0 no error occured
32 =1 // != 0 error opening IO
33 =1 // COMMENT: open and initialise communication channel to the reader module
34 =1 //
35 =1 char OpenIO(void);
36 =1
37 =1 // _____________________________________________________________________________
38 =1 //
39 =1 // FUNCTION: WriteIO
40 =1 // IN: address register address in the reader module address space
C51 COMPILER V7.20 RDIO 12/08/2004 10:59:27 PAGE 2
41 =1 // value value, which should be written
42 =1 // OUT: -
43 =1 // RETURN: -
44 =1 // COMMENT: This function determines the necessary page address of the
45 =1 // reader module and writes the page number to the page
46 =1 // register and the value to the specified address.
47 =1 //
48 =1 void WriteIO(unsigned char Address, unsigned char value);
49 =1
50 =1 // _____________________________________________________________________________
51 =1 //
52 =1 // FUNCTION: ReadIO
53 =1 // IN: address register address in the reader module address space
54 =1 // OUT: -
55 =1 // RETURN: value value, which should be read
56 =1 // COMMENT: This function determines the necessary page address of the
57 =1 // reader module and writes the page number to the page
58 =1 // register and the value to the specified address.
59 =1 //
60 =1 unsigned char ReadIO(unsigned char Address);
61 =1
62 =1 #ifndef SEC_NO_MICORE
63 =1 //_____________________________________________________________________________
64 =1 //
65 =1 // FUNCTION: WriteIOBlock
66 =1 // IN: addr_data byte stream alternating address and data
67 =1 // len number of address/data pairs
68 =1 // OUT: -
69 =1 // RETURN:
70 =1 // COMMENT: This function expects a byte stream with alternating one
71 =1 // address byte and the corresponding value byte.
72 =1 // The parameter "len" indicates the number of
73 =1 // address/value pairs in the "addr_data" array.
74 =1 // e. g.
75 =1 // addr_data = addr1,val1,addr2,val2,addr3,val3,....,addrN,valN
76 =1 // len = N
77 =1 //
78 =1 void WriteIOBlock(unsigned char *Addr_Data, unsigned short len);
79 =1
80 =1 // _____________________________________________________________________________
81 =1 //
82 =1 // FUNCTION: ReadIOBlock
83 =1 // IN: addr_data byte stream alternating address and data
84 =1 // len number of address/data pairs
85 =1 // OUT: addr_data byte stream alternating address and data
86 =1 // RETURN:
87 =1 // COMMENT: This function expects a byte stream with alternating one
88 =1 // address byte followed and the corresponding value byte.
89 =1 // The parameter "len" indicates the number of
90 =1 // address/value pairs in the "addr_data" array.
91 =1 // The value bytes are filled in by this function.
92 =1 // e. g.
93 =1 // addr_data = addr1,val1,addr2,val2,addr3,val3,....,addrN,valN
94 =1 // len = N
95 =1 //
96 =1 void ReadIOBlock(unsigned char *Addr_Data, unsigned short len);
97 =1 #endif
98 =1
99 =1 // _____________________________________________________________________________
100 =1 //
101 =1 // FUNCTION: CloseIO
102 =1 // IN: -
C51 COMPILER V7.20 RDIO 12/08/2004 10:59:27 PAGE 3
103 =1 // OUT: -
104 =1 // RETURN: -
105 =1 // COMMENT: Closing the communication channel to the reader module
106 =1 //
107 =1 void CloseIO(void);
108 =1
109 =1 // _____________________________________________________________________________
110 =1 //
111 =1 // FUNCTION: WriteRawIO
112 =1 // IN: addr address within the reader address space (0x00 to 0xFF),
113 =1 // where the value should be written.
114 =1 // value value, which should be written
115 =1 // OUT: -
116 =1 // RETURN: -
117 =1 // COMMENT: Inline code for reading one char from the reader module
118 =1 // The reader module is connected to a 8 bit multiplexed data address
119 =1 // bus, therefore the lower address byte is directly mapped to the
120 =1 // reader module is mapped as follows:
121 =1 // uC Reader
122 =1 // AD0 A0
123 =1 // AD1 A1
124 =1 // . .
125 =1 // AD7 A7
126 =1 //
127 =1 #define WriteRawIO(addr,value) *(GpBase + addr) = value;
128 =1
129 =1 // _____________________________________________________________________________
130 =1 //
131 =1 // FUNCTION: ReadRawIO
132 =1 // IN: addr address within the reader address space (0x00 to 0xFF),
133 =1 // which shoud be read.
134 =1 // OUT: -
135 =1 // RETURN: value of the reader module
136 =1 // COMMENT: Inline code for reading one char from the reader module
137 =1 // The reader module is connected to a 8 bit multiplexed data address
138 =1 // bus, therefore the lower address byte is directly mapped to the
139 =1 // reader module is mapped as follows:
140 =1 // uC Reader
141 =1 // AD0 A0
142 =1 // AD1 A1
143 =1 // . .
144 =1 // AD7 A7
145 =1 //
146 =1 #define ReadRawIO(addr) (*(GpBase + addr))
147 =1
148 =1 extern unsigned char xdata *GpBase; // variable only for internal use
149 =1 #endif
15 #include <main.h>
1 =1 /****************************************************************************
2 =1 * *
3 =1 * File: MAIN.H *
4 =1 * *
5 =1 * Version: *
6 =1 * *
7 =1 * Created: 30.08.2001 *
8 =1 * Last Change: 30.08.2001 *
9 =1 * *
10 =1 * Author: Chua Joo Ming *
11 =1 * *
12 =1 * Compiler: KEIL C51 V4.10 *
13 =1 * *
14 =1 * Description: 89C52RD2-Firmware for MFRC500 Demo Serial Reader *
C51 COMPILER V7.20 RDIO 12/08/2004 10:59:27 PAGE 4
15 =1 * *
16 =1 ****************************************************************************/
17 =1
18 =1
19 =1 #define AUTODELAY
20 =1
21 =1 #ifdef __SRC
=1 #define EXTERN
=1 #else
24 =1 #define EXTERN extern
25 =1 #endif
26 =1
27 =1
28 =1 // Common Defines
29 =1
30 =1 #define uchar unsigned char
31 =1 #define uint unsigned int
32 =1 #define ulong unsigned long
33 =1
34 =1 #define FALSE 0
35 =1 #define TRUE 1
36 =1
37 =1
38 =1 #define INFO_CNT 23
39 =1
40 =1
41 =1 // Ports
42 =1
43 =1 #define ON 1
44 =1 #define OFF 0
45 =1
46 =1 // Configuration for the reader timeout counter
47 =1 // Timer 2 (modify OSC_FREQ if another crystal frequency is used)
48 =1 #define OSC_FREQ 22118400L
49 =1 // *note: when using the 8051RD2 (in 6 clk instructiion cycle,
50 =1 // use a crystal that is half the value state in OSC_FREQ.
51 =1 // Example: for OSC_FREQ=22118400, use 11059000 crystal.
52 =1
53 =1 #define BAUD_CNT 7
54 =1
55 =1 #define BAUD_115200 256 - (OSC_FREQ/192L)/115200L // 255
56 =1 #define BAUD_57600 256 - (OSC_FREQ/192L)/57600L // 254
57 =1 #define BAUD_38400 256 - (OSC_FREQ/192L)/38400L // 253
58 =1 #define BAUD_28800 256 - (OSC_FREQ/192L)/28800L // 252
59 =1 #define BAUD_19200 256 - (OSC_FREQ/192L)/19200L // 250
60 =1 #define BAUD_14400 256 - (OSC_FREQ/192L)/14400L // 248
61 =1 #define BAUD_9600 256 - (OSC_FREQ/192L)/9600L // 244
62 =1
63 =1 #ifdef __SRC
=1 uchar code BaudRateTable[BAUD_CNT] = {
=1 BAUD_115200,
=1 BAUD_57600,
=1 BAUD_38400,
=1 BAUD_28800,
=1 BAUD_19200,
=1 BAUD_14400,
=1 BAUD_9600
=1 };
=1 #else
74 =1 extern uchar code BaudRateTable[BAUD_CNT];
75 =1 #endif
76 =1
C51 COMPILER V7.20 RDIO 12/08/2004 10:59:27 PAGE 5
77 =1 #ifdef __SRC
=1 uint code CmpTable[BAUD_CNT + 1] = {
=1 0x078,
=1 0x095,
=1 0x129,
=1 0x1BD,
=1 0x252,
=1 0x37A,
=1 0x4A3,
=1 0x6F4
=1 };
=1 #else
89 =1 extern uint code CmpTable[BAUD_CNT + 1];
90 =1 #endif
91 =1
92 =1 // Serial Protocol
93 =1
94 =1 #define SOH 0x01 // Start of header
95 =1 #define STX 0x02 // Start of text
96 =1 #define ETX 0x03 // End of text
97 =1 #define ENQ 0x05 // Enquire
98 =1 #define ACK 0x06 // Acknowledge
99 =1 #define DLE 0x10 // Data link escape
100 =1 #define NAK 0x15 // Not acknowledge
101 =1
102 =1
103 =1 #define MAXREPCNT 2
104 =1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -