📄 cs8900_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Procyon AVRlib: net/cs8900.h Source File</title><link href="dox.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div><div class="nav"><a class="el" href="dir_000001.html">net</a></div><h1>cs8900.h</h1><a href="cs8900_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file cs8900.h \brief Crystal CS8900 Ethernet Interface Driver. */</span>00002 <span class="comment">//*****************************************************************************</span>00003 <span class="comment">//</span>00004 <span class="comment">// File Name : 'cs8900.h'</span>00005 <span class="comment">// Title : Crystal CS8900 Ethernet Interface Driver</span>00006 <span class="comment">// Author : Pascal Stang</span>00007 <span class="comment">// Created : 11/7/2004</span>00008 <span class="comment">// Revised : 8/22/2005</span>00009 <span class="comment">// Version : 0.1</span>00010 <span class="comment">// Target MCU : Atmel AVR series</span>00011 <span class="comment">// Editor Tabs : 4</span>00012 <span class="comment">//</span><span class="comment"></span>00013 <span class="comment">/// \ingroup network</span>00014 <span class="comment">/// \defgroup cs8900 Crystal CS8900 Ethernet Interface Driver (cs8900.c)</span>00015 <span class="comment">/// \code #include "net/cs8900.h" \endcode</span>00016 <span class="comment">/// \par Overview</span>00017 <span class="comment">/// This driver provides initialization and transmit/receive</span>00018 <span class="comment">/// functions for the Crystal CS8900 10Mb Ethernet Controller and PHY.</span>00019 <span class="comment"></span><span class="comment">//</span>00020 <span class="comment">//*****************************************************************************</span><span class="comment"></span>00021 <span class="comment">//@{</span>00022 <span class="comment"></span>00023 <span class="preprocessor">#ifndef CS8900_H</span>00024 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_H</span>00025 <span class="preprocessor"></span>00026 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>00027 00028 <span class="preprocessor">#define nop() asm volatile ("nop")</span>00029 <span class="preprocessor"></span>00030 00031 <span class="comment">// Crystal ESIA product ID</span>00032 <span class="preprocessor">#define CS8900_ESIA_ID (0x630e)</span>00033 <span class="preprocessor"></span>00034 <span class="comment">// CS8900 IO Registers</span>00035 <span class="preprocessor">#define CS8900_IO_RXTX_DATA_PORT0 (0x0000)</span>00036 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_RXTX_DATA_PORT1 (0x0002)</span>00037 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_TXCMD (0x0004)</span>00038 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_TXLENGTH (0x0006)</span>00039 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_ISQ (0x0008)</span>00040 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_PP_PTR (0x000a)</span>00041 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_PP_DATA_PORT0 (0x000c)</span>00042 <span class="preprocessor"></span><span class="preprocessor">#define CS8900_IO_PP_DATA_PORT1 (0x000e)</span>00043 <span class="preprocessor"></span>00044 <span class="comment">// definitions for Crystal CS8900 ethernet-controller</span>00045 <span class="comment">// based on linux-header by Russel Nelson</span>00046 00047 <span class="preprocessor">#define PP_ChipID 0x0000 // offset 0h -> Corp-ID</span>00048 <span class="preprocessor"></span> <span class="comment">// offset 2h -> Model/Product Number</span>00049 <span class="comment">// offset 3h -> Chip Revision Number</span>00050 00051 <span class="preprocessor">#define PP_ISAIOB 0x0020 // IO base address</span>00052 <span class="preprocessor"></span><span class="preprocessor">#define PP_CS8900_ISAINT 0x0022 // ISA interrupt select</span>00053 <span class="preprocessor"></span><span class="preprocessor">#define PP_CS8900_ISADMA 0x0024 // ISA Rec DMA channel</span>00054 <span class="preprocessor"></span><span class="preprocessor">#define PP_ISASOF 0x0026 // ISA DMA offset</span>00055 <span class="preprocessor"></span><span class="preprocessor">#define PP_DmaFrameCnt 0x0028 // ISA DMA Frame count</span>00056 <span class="preprocessor"></span><span class="preprocessor">#define PP_DmaByteCnt 0x002A // ISA DMA Byte count</span>00057 <span class="preprocessor"></span><span class="preprocessor">#define PP_CS8900_ISAMemB 0x002C // Memory base</span>00058 <span class="preprocessor"></span><span class="preprocessor">#define PP_ISABootBase 0x0030 // Boot Prom base</span>00059 <span class="preprocessor"></span><span class="preprocessor">#define PP_ISABootMask 0x0034 // Boot Prom Mask</span>00060 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxFrameByteCnt 0x0050</span>00061 <span class="preprocessor"></span>00062 <span class="comment">// EEPROM data and command registers</span>00063 <span class="preprocessor">#define PP_EECMD 0x0040 // NVR Interface Command register</span>00064 <span class="preprocessor"></span><span class="preprocessor">#define PP_EEData 0x0042 // NVR Interface Data Register</span>00065 <span class="preprocessor"></span>00066 <span class="comment">// Configuration and control registers</span>00067 <span class="preprocessor">#define PP_RxCFG 0x0102 // Rx Bus config</span>00068 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxCTL 0x0104 // Receive Control Register</span>00069 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxCFG 0x0106 // Transmit Config Register</span>00070 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxCMD 0x0108 // Transmit Command Register</span>00071 <span class="preprocessor"></span><span class="preprocessor">#define PP_BufCFG 0x010A // Bus configuration Register</span>00072 <span class="preprocessor"></span><span class="preprocessor">#define PP_LineCTL 0x0112 // Line Config Register</span>00073 <span class="preprocessor"></span><span class="preprocessor">#define PP_SelfCTL 0x0114 // Self Command Register</span>00074 <span class="preprocessor"></span><span class="preprocessor">#define PP_BusCTL 0x0116 // ISA bus control Register</span>00075 <span class="preprocessor"></span><span class="preprocessor">#define PP_TestCTL 0x0118 // Test Register</span>00076 <span class="preprocessor"></span>00077 <span class="comment">// Status and Event Registers</span>00078 <span class="preprocessor">#define PP_ISQ 0x0120 // Interrupt Status</span>00079 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxEvent 0x0124 // Rx Event Register</span>00080 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxEvent 0x0128 // Tx Event Register</span>00081 <span class="preprocessor"></span><span class="preprocessor">#define PP_BufEvent 0x012C // Bus Event Register</span>00082 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxMiss 0x0130 // Receive Miss Count</span>00083 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxCol 0x0132 // Transmit Collision Count</span>00084 <span class="preprocessor"></span><span class="preprocessor">#define PP_LineST 0x0134 // Line State Register</span>00085 <span class="preprocessor"></span><span class="preprocessor">#define PP_SelfST 0x0136 // Self State register</span>00086 <span class="preprocessor"></span><span class="preprocessor">#define PP_BusST 0x0138 // Bus Status</span>00087 <span class="preprocessor"></span><span class="preprocessor">#define PP_TDR 0x013C // Time Domain Reflectometry</span>00088 <span class="preprocessor"></span>00089 <span class="comment">// Initiate Transmit Registers</span>00090 <span class="preprocessor">#define PP_TxCommand 0x0144 // Tx Command</span>00091 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxLength 0x0146 // Tx Length</span>00092 <span class="preprocessor"></span>00093 <span class="comment">// Address Filter Registers</span>00094 <span class="preprocessor">#define PP_LAF 0x0150 // Hash Table</span>00095 <span class="preprocessor"></span><span class="preprocessor">#define PP_IA 0x0158 // Physical Address Register</span>00096 <span class="preprocessor"></span>00097 <span class="comment">// Frame Location</span>00098 <span class="preprocessor">#define PP_RxStatus 0x0400 // Receive start of frame</span>00099 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxLength 0x0402 // Receive Length of frame</span>00100 <span class="preprocessor"></span><span class="preprocessor">#define PP_RxFrame 0x0404 // Receive frame pointer</span>00101 <span class="preprocessor"></span><span class="preprocessor">#define PP_TxFrame 0x0A00 // Transmit frame pointer</span>00102 <span class="preprocessor"></span>00103 <span class="comment">// Primary I/O Base Address. If no I/O base is supplied by the user, then this</span>00104 <span class="comment">// can be used as the default I/O base to access the PacketPage Area.</span>00105 <span class="preprocessor">#define DEFAULTIOBASE 0x0300</span>00106 <span class="preprocessor"></span>00107 <span class="comment">// PP_RxCFG - Receive Configuration and Interrupt Mask bit definition - Read/write</span>00108 <span class="preprocessor">#define SKIP_1 0x0040</span>00109 <span class="preprocessor"></span><span class="preprocessor">#define RX_STREAM_ENBL 0x0080</span>00110 <span class="preprocessor"></span><span class="preprocessor">#define RX_OK_ENBL 0x0100</span>00111 <span class="preprocessor"></span><span class="preprocessor">#define RX_DMA_ONLY 0x0200</span>00112 <span class="preprocessor"></span><span class="preprocessor">#define AUTO_RX_DMA 0x0400</span>00113 <span class="preprocessor"></span><span class="preprocessor">#define BUFFER_CRC 0x0800</span>00114 <span class="preprocessor"></span><span class="preprocessor">#define RX_CRC_ERROR_ENBL 0x1000</span>00115 <span class="preprocessor"></span><span class="preprocessor">#define RX_RUNT_ENBL 0x2000</span>00116 <span class="preprocessor"></span><span class="preprocessor">#define RX_EXTRA_DATA_ENBL 0x4000</span>00117 <span class="preprocessor"></span>00118 <span class="comment">// PP_RxCTL - Receive Control bit definition - Read/write</span>00119 <span class="preprocessor">#define RX_IA_HASH_ACCEPT 0x0040</span>00120 <span class="preprocessor"></span><span class="preprocessor">#define RX_PROM_ACCEPT 0x0080</span>00121 <span class="preprocessor"></span><span class="preprocessor">#define RX_OK_ACCEPT 0x0100</span>00122 <span class="preprocessor"></span><span class="preprocessor">#define RX_MULTCAST_ACCEPT 0x0200</span>00123 <span class="preprocessor"></span><span class="preprocessor">#define RX_IA_ACCEPT 0x0400</span>00124 <span class="preprocessor"></span><span class="preprocessor">#define RX_BROADCAST_ACCEPT 0x0800</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -