📄 netconf.lst
字号:
C51 COMPILER V8.02 NETCONF 10/17/2006 16:52:41 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE NETCONF
OBJECT MODULE PLACED IN NETCONF.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE NETCONF.C BROWSE DEBUG OBJECTEXTEND
line level source
1 /*
2 ###############################################################################
3 Wiznet.
4 5F Simmtech Bldg., 228-3, Nonhyun-dong, Kangnam-gu,
5 Seoul, Korea
6
7 (c) Copyright 2002, Wiznet, Seoul, Korea
8
9 File Name : NETCONF.C
10
11 Version : 1.1
12
13 Created : 2002/01/31
14
15 Description : Network Configuration Function for W3100A
16 For using Terminal device's Serial interface,Update network's informations.
17 It's implemented Function to Store and Read W3100A's Network Information and User-Specific Informati
-on into AT24C02(EEPROM).
18 <Memory-Map>
19 0x00-0x03 : Gateway IP Address of W3100A (4 Bytes)
20 0x04-0x07 : Subnet Mask of W3100A (4 Bytes)
21 0x08-0x0B : Local IP Address of W3100A (4 Bytes)
22 0x0C-0x21 : MAC Address (6 Bytes)
23 0x22-0xFD : User-Specific Information (236 Bytes)
24 0xFE-0xFF : Reserved. EEPROM Test (2 Bytes)
25
26 Modified History
27
28 Modified : 2002/04/12
29 Description :
30 inet_ntoa(), GetIPAddress(), GetGWAddress(),GetSubMask(),GetDotNotationAddr()
31
32 Modified : 2002/04/13
33 Description :
34
35 Modified : 2002/10/20
36 Description : Version Up
37 Move the followd function to sockutil.h
38 inet_ntoa(), GetIPAddress(), GetGWAddress(),GetSubMask(),GetDotNotationAddr()
39
40 ###############################################################################
41 */
42
43
44 /*
45 ###############################################################################
46 Include Part
47 ###############################################################################
48 */
49 #include <reg51.h> // SFR definition
50 #include <serial.h> // RS232C
51 #include <AT24C02.h> // EEPROM
52 #include <socket.h> // W3100A
53 #include <util.h> // Util
54 #include <sockutil.h> // Util of w3100A
C51 COMPILER V8.02 NETCONF 10/17/2006 16:52:41 PAGE 2
55 #include <NetConf.h> // Header
56
57 /*
58 ###############################################################################
59 Function Implementation Part
60 ###############################################################################
61 */
62
63
64 /*
65 ********************************************************************************
66 * Description: Display user's menu and update Network Information with selected menu by User.
67 * Arguments :
68 * Returns :
69 * Note :
70 ********************************************************************************
71 */
72 void Configure(void)
73 {
74 1 UCHAR Select; // Character to be input through Serial('D', 'G', 'S', 'I','H','E'. 'R')
75 1 int i;
76 1
77 1 Config_Load(); // Display Current Network Config.
78 1 GetNetConfig();
79 1 PutStringLn("\r\n< Network Configuration Mode >\r\n");
80 1 while(1)
81 1 {
82 2 Config_Menu(); // Menu Display
83 2
84 2 Select = GetByte(); // Read One Literal & Echo.
85 2
86 2 switch (Select) // Menu analyzation
87 2 {
88 3 case 'D' : // Display Current Network Config.
89 3 case 'd' :
90 3 Select = '*'; // Store '*' not to execute Config_Edit().
91 3 if(Config_Load() == 0)
92 3 PutStringLn("Config_Load() Error");
93 3 GetNetConfig();
94 3 break;
95 3 case 'G' : // Set Gateway IP Address
96 3 case 'g' :
97 3 Select = 'G';
98 3 PutString("\r\nEnter Gateway IP Address : ");
99 3 break;
100 3 case 'S' : // Set Subnet Mask
101 3 case 's' :
102 3 Select = 'S';
103 3 PutString("\r\nEnter Subnet Mask value : ");
104 3 break;
105 3 case 'I' : // Set Source IP Address
106 3 case 'i' :
107 3 Select = 'I';
108 3 PutString("\r\nEnter Source IP Address : ");
109 3 break;
110 3 case 'H' : // Set Mac Address
111 3 case 'h' :
112 3 Select = 'H';
113 3 PutString("\r\nEnter Hardware Address : ");
114 3 break;
115 3 case 'E' : // Exit Config Mode
116 3 case 'e' :
C51 COMPILER V8.02 NETCONF 10/17/2006 16:52:41 PAGE 3
117 3 PutString("\r\n\r\n>Exit Configuration Mode\r\n");
118 3 return;
119 3 case 'R':
120 3 case 'r':
121 3 PutStringLn("Erasing EEPROM...");
122 3 for(i = 0 ; i < 0x100; i++)
123 3 {
124 4 EEP_Write(i,0);
125 4 PutByte('*');
126 4 }
127 3 PutStringLn("");
128 3 Select = '*';
129 3 break;
130 3 default : // Usage
131 3 Select = '*'; // Store '*' not to execute Config_Edit().
132 3 PutStringLn("\r\nPress 'G', 'S', 'I', 'H', 'E' or 'R'");
133 3 break;
134 3 }
135 2 if(Select != '*')
136 2 Config_Edit(Select); // Config Update
137 2 }// END while(1)
138 1 }
139
140
141
142 /*
143 ********************************************************************************
144 * Description: Display User's Menu
145 * Arguments :
146 * Returns :
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -