📄 hwconf.h
字号:
/*
Copyright (c) 2003-2006 Vitesse Semiconductor Corporation "Vitesse".
All Rights Reserved. Unpublished rights reserved under the copyright laws
of the United States of America, other countries and international treaties.
The software is provided without a fee. Permission to use, copy, store and
modify, the software and its source code is granted. Permission to integrate
into other products, disclose, transmit and distribute the software in an
absolute machine readable format (e.g. HEX file) is also granted.
The source code of the software may not be disclosed, transmitted or
distributed without the written permission of Vitesse. The software and its
source code may only be used in products utilizing a Vitesse VSC73xx product.
This copyright notice must appear in any copy, modification, disclosure,
transmission or distribution of the software. Vitesse retains all ownership,
copyright, trade secret and proprietary rights in the software.
THIS SOFTWARE HAS BEEN PROVIDED "AS IS," WITHOUT EXPRESS OR IMPLIED WARRANTY
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR USE AND NON-INFRINGEMENT.
*/
#ifndef __HWCONF_H__
#define __HWCONF_H__
#include <REG52.H>
#include "swconf.h"
/* ************************************************************************ **
*
*
* Internal 8051 registers
*
*
*
* ************************************************************************ */
sfr CKCON = 0x8e;
sfr GPIO_IN = 0x80;
sfr GPIO_OUT = 0x90;
sfr GPIO_OE = 0xA0;
sfr GPIO_STAT = 0xA1;
sfr FPSTAT = 0xAA;
sfr SPC_FNC = 0x8F;
sfr PAGE_SEL = 0xB0;
sfr EPAGE_SEL = 0xC0;
sfr WDDA = 0xA2;
sfr WDCON = 0xA3;
sfr SPC_FNC2 = 0xF1;
sfr RA_STAT = 0xF8;
sfr RA_BLK = 0xF9;
sfr RA_AD_RD = 0xFA;
sfr RA_AD_WR = 0xFB;
sfr RA_DA0 = 0xFC;
sfr RA_DA1 = 0xFD;
sfr RA_DA2 = 0xFE;
sfr RA_DA3 = 0xFF;
sbit RA_DONE = RA_STAT^0;
sbit GPIO_OUT_0 = GPIO_OUT^0;
sbit GPIO_OUT_1 = GPIO_OUT^1;
sbit GPIO_OE_0 = GPIO_OE^0;
sbit GPIO_OE_1 = GPIO_OE^1;
sbit GPIO_IN_0 = GPIO_IN^0;
sbit GPIO_IN_1 = GPIO_IN^1;
/* ************************************************************************ **
*
*
* Select chip interface
*
*
*
* ************************************************************************ */
/*
** Define which chip interface to use, either 8-bit parallel interface,
** SI interface or SFR interface.
** Set USE_PI to 1 to use 8-bit interface, otherwise set it to 0.
** Set USE_SI to 1 to use SI interface, otherwise set it to 0.
** Set USE_SFR to 1 to use SFR interface, otherwise set it to 0.
** Please, keep assembler file hwconf.inc updated accordingly.
*/
#define USE_PI 0
#define USE_SI 0
#define USE_SFR 1
/* ************************************************************************ **
*
*
* MCU clock frequency
*
*
*
* ************************************************************************ */
#define CLOCK_FREQ 89285714
/* ************************************************************************ **
*
*
* Serial port baud rate
*
*
*
* ************************************************************************ */
/*
** Baud rate at RS232 interface.
** Choose value among 115200, 57600, 38400, 19200 and 9600.
*/
#define BAUD_RATE 9600
/* ************************************************************************ **
*
*
* SPI pins
*
*
*
* ************************************************************************ */
sbit SS = P1^4;
sbit MOSI = P1^5;
sbit MISO = P1^6;
sbit SCK = P1^7;
/* ************************************************************************ **
*
*
* GPIOs
*
*
*
* ************************************************************************ */
/* Physical port number with general LEDs connected to PHY GPIOs */
#define PHY_LED_GPIO_PORT 0
/* ************************************************************************ **
*
*
* Internal/External PHY LED synchronization delay
*
*
*
* ************************************************************************ */
/* minimum 20 ms, maximum 255 ms. Test your system to find a suitable value */
#define LED_SYNC_DELAY 20
/* ************************************************************************ **
*
*
* Watchdog
*
*
*
* ************************************************************************ */
/*
** Define whether watchdog is present and whether it should be enabled.
** Set WATCHDOG_PRESENT to 1, if a watchdog is present and you want to use it,
** otherwise set it to 0
** Set WATCHDOG_ENABLE to 1, if watchdog should be running all the time, otherwise
** set it to 0 (in which case it will only be used in case of software reboot).
*/
#define WATCHDOG_PRESENT 0
#define WATCHDOG_ENABLE 0
/*
** Define macros to enable and kick watchdog, see hwport.c.
*/
#define ENABLE_WATCHDOG { \
WDCON = 1; \
}
#define KICK_WATCHDOG {}
/* ************************************************************************ **
*
*
* Control bits for paging
*
*
*
* ************************************************************************ */
sbit FLASH = GPIO_OUT^0;
/* ************************************************************************ **
*
*
* Select presence of PHY loopback test
*
*
*
* ************************************************************************ */
/*
** Define whether PHY loopback test should be supported
** Set LOOPBACK_TEST to 1, if loopback test should be supported, otherwise set
** it to 0
*/
#define LOOPBACK_TEST 1
/* ************************************************************************ **
*
*
* Enable/disable switch chip id check
*
*
*
* ************************************************************************ */
/*
** Define whether switch chip id should be checked as run-time check.
** Set H2_ID_CHECK to 1 to enable check, or to 0 to disable check.
*/
#define H2_ID_CHECK 0
/* ************************************************************************ **
*
*
* Configure any alive/debug LED
*
*
*
* ************************************************************************ */
/*
** Define macro for turning on debug/alive LED. If no LED, define
** an empty macro.
*/
#define ALIVE_LED_ON { \
GPIO_OE_1 = 1; \
GPIO_OUT_1 = 1; \
}
/*
** Define macro for toggling debug/alive LED. If no LED, define
** an empty macro.
*/
#define ALIVE_LED_TOGGLE { \
GPIO_OUT_1 = !GPIO_IN_1; \
}
/* ************************************************************************ **
*
*
* Configure any front panel LED
*
*
*
* ************************************************************************ */
/*
** Define whether a red/green front LED is present.
** Set FRONT_LED_PRESENT to 1, if present, otherwise set it to 0
*/
#define FRONT_LED_PRESENT 1
/* ************************************************************************ **
*
*
* Configure macros for asserting/deasserting chip reset
*
*
*
* ************************************************************************ */
/* ************************************************************************ **
*
*
* Enable/disable jumbo frame support
*
*
*
* ************************************************************************ */
/*
** Define whether to enable jumbo frames.
** Set JUMBO to 1 to enable jumbo frames, 0 to disable jumbo frames.
*/
#define JUMBO 0
/*
** Define size of jumbo frames, provided JUMBO is set to 1.
*/
#define JUMBO_SIZE 0
#endif /* __HWCONF_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -