The different source code files and their dependencies
The
actual TCP/IP stack and the driver for the ethernet chip consists
of the following files:
- enc28j60.c
- enc28j60.h
- ip_arp_udp_tcp.c
- ip_arp_udp_tcp.h
- ip_config.h
- timeout.h
- net.h
The main file you have to interface from an application
point of view is ip_arp_udp_tcp.h. The ip_config.h allows you to
customize the stack and switch off features that you might not
need. This will keep the size always to the minimal. It is
recommended to use the Makefile for compiling the files and thus
keep track of the dependencies. Windows users might want to
customize winmake.bat which will then call the Makefile.
The files websrv_help_functions.c and websrv_help_functions.h contain
useful helper function for parsing URLs or for
URL-encoding/decoding.
The files dnslkup.c and dnslkup.h implement a tiny but very
capable DNS resolver.
The following are examples for different uses of the stack:
- main.c (compiles to eth_rem_dev_tcp.hex) -- a web server to switch on/off a relay
remotely
- basic_web_server_example.c -- a basic web server
example. A good starting point to build your own application.
- test_readSiliconRev.c -- a very basic web server
example that reads the chip revision of the ethernet chip
and displays it on a web page.
- test_OKworks.c -- a very basic web server
example. Just prints "OK works".
- test_web_client.c -- a web client (=web browser) that
uploads data to http://tuxgraphics.org/cgi-bin/upld
when you ping it once.
- test_emailnotify.c -- send email notifications when you
connect PD6 to GND. You need a tuxgraphics microcontroller mail
account to use this. There is a timeout of 3min to prevent too
many mails.
- test_twitter.c -- post a message on twitter. To trigger the
posting of a message you connect PD6 to GND. You need a twitter
account to use this. There is a timeout of 3min to prevent too
many posts. Note that twitter ignores repeated identical
posts.
- test_identi_ca.c -- post a message on identi.ca. To trigger
the sending of the message connect PD6 to GND. You need a
identi.ca account to use this. There is a timeout of 3min to
prevent too many posts.
Open the files and edit the IP address and other information such as twitter/identi.ca
password before you compile the application files. Inside the application files there is a description of the different variables that might need customization. All variables and parameters that need to be customized are near the top of the file.
There is also very simple test program which causes just an LED
to blink. It is useful to test your compiler and your
programmer:
- test0.c/test0.hex -- microcontroller test, causes an LED on PIN PB1
to blink
- The sub-directory "files" contains a collection of screen-shots and captures taken with wireshark.
- Sub-directory udpcom contain a UDP application. Some application such as the relay on/off switch can also be controlled via UDP.
A description as to how to program the fuse bytes of the microcontroller
can be found in README.htm. You need to set
the fuse bytes once for a new microcontroller.
Copyright of the software and all diagrams: Guido Socher, tuxgraphics.org
License for everything: GPL V2
See http://www.gnu.org/licenses/gpl.html
Other licenses are available on request.
For more detailed documentation see http://tuxgraphics.org/electronics/
vim:sw=8:ts=8:si:et