📄 config.h
字号:
/*
*Copyright (c) 2000-2002 Viola Systems Ltd.
*All rights reserved.
*
*Redistribution and use in source and binary forms, with or without
*modification, are permitted provided that the following conditions
*are met:
*
*1. Redistributions of source code must retain the above copyright
*notice, this list of conditions and the following disclaimer.
*
*2. Redistributions in binary form must reproduce the above copyright
*notice, this list of conditions and the following disclaimer in the
*documentation and/or other materials provided with the distribution.
*
*3. The end-user documentation included with the redistribution, if
*any, must include the following acknowledgment:
* "This product includes software developed by Viola
* Systems (http://www.violasystems.com/)."
*
*Alternately, this acknowledgment may appear in the software itself,
*if and wherever such third-party acknowledgments normally appear.
*
*4. The names "OpenTCP" and "Viola Systems" must not be used to
*endorse or promote products derived from this software without prior
*written permission. For written permission, please contact
*opentcp@opentcp.org.
*
*5. Products derived from this software may not be called "OpenTCP",
*nor may "OpenTCP" appear in their name, without prior written
*permission of the Viola Systems Ltd.
*
*THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
*WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
*MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
*IN NO EVENT SHALL VIOLA SYSTEMS LTD. OR ITS CONTRIBUTORS BE LIABLE
*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
*CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
*SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
*WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
*OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
*EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*====================================================================
*
*OpenTCP is the unified open source TCP/IP stack available on a series
*of 8/16-bit microcontrollers, please see <http://www.opentcp.org>.
*
*For more information on how to network-enable your devices, or how to
*obtain commercial technical support for OpenTCP, please see
*<http://www.violasystems.com/>.
*/
/** \file config.h
* \ingroup opentcp_config
* \brief OpenTCP hardware configuration file
* \author
* \li Vladan Jovanovic (vladan.jovanovic@violasystems.com)
* \version 1.0
* \date 20.9.2002
*
* Various MCU and hardware-dependant configuration stuff is located here.
*/
#ifndef INCLUDE_CONFIG_H /* USED TO CHECK THAT THERE IS SOME CHIP DEFINED */
#define INCLUDE_CONFIG_H
//#define MB90F553A /**<Define this for Fujitsu's MB90F553A MCU */
#define AT89S8252 /**<Define this for Atmel's AT89S8252 MCU */
//#define C167
/* Based on chip information, define certain constants here.
These are used mostly in ethernet.c to make it as
platform independent as possible. For now only one */
/* what to include ? */
#ifdef MB90F553A
#include <inet/arch/mb90f553a/mb90550.h>
/* what to put to data direction registers to make them in/out */
#define DDR_OUT 0xFF /**< Value for data direction register so that pins
* are configured as outputs
*/
#define DDR_IN 0x00 /**< Value for data direction register so that pins
* are configured as inputs
*/
/* ISA & Chip Specific bus signals */
#define DATABUS PDR1 /**< Port used as databus towards
* the Ethernet controller
*/
#define DATADIR DDR1 /**< Data direction register for the
* data bus
*/
#define ADRBUS PDR2 /**< Port used as address bus towards
* the Ethernet controller
*/
#define IOW PDR2_P26 /**< Write pin */
#define IOR PDR2_P25 /**< Read pin */
#define IOCHRDY PDR0_P05 /**< IOCHRDY pin */
#define RESETPIN_NE2000 PDR2_P27 /**< Reset pin */
#endif /* mb90f553a */
#ifdef AT89S8252
#include <inet/arch/at89s8252/at89s8252.h>
#define XTAL 11059200 /* Hz */
/* Define Timer 1 and Timer 0 reload values */
#define T1FREQ 100 /* Hz */
#define T0FREQ 1000 /* Hz */
#define UART_SPEED 115200 /* nice speed */
#define T1_HIGH (UINT8)((65536 - (XTAL / T1FREQ) / 12) >> 8)
#define T1_LOW (UINT8)((65536 - (XTAL / T1FREQ) / 12) & 0x00FF)
#define T0_HIGH (UINT8)((65536 - (XTAL / T0FREQ) / 12) >> 8)
#define T0_LOW (UINT8)((65536 - (XTAL / T0FREQ) / 12) & 0x00FF)
/* Define Timer 2 reload values to set UART baudrate */
#define RCAP2_HIGH (unsigned char)((65536 - (XTAL / UART_SPEED) / 32) >> 8)
#define RCAP2_LOW (unsigned char)((65536 - (XTAL / UART_SPEED) / 32) & 0x00FF)
#endif //AT89S8252
#ifdef C167
#include <inet/arch/c167/reg167.h>
#define XTAL 20000000UL /* Hz */
#define UART_SPEED 9600UL
#define S0_BAUDRATE ((XTAL / 32UL) / UART_SPEED)
#endif //C167
#endif //INCLUDE_CONFIG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -