⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rom400_init.h

📁 tini的http-slientC程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/*---------------------------------------------------------------------------
 *  Copyright (C) 2003-2004 Dallas Semiconductor Corporation, All Rights Reserved.
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a
 *  copy of this software and associated documentation files (the "Software"),
 *  to deal in the Software without restriction, including without limitation
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *  and/or sell copies of the Software, and to permit persons to whom the
 *  Software is furnished to do so, subject to the following conditions:
 * 
 *  The above copyright notice and this permission notice shall be included
 *  in all copies or substantial portions of the Software.
 * 
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
 *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *  OTHER DEALINGS IN THE SOFTWARE.
 * 
 *  Except as contained in this notice, the name of Dallas Semiconductor
 *  shall not be used except as stated in the Dallas Semiconductor
 *  Branding Policy.
 * ---------------------------------------------------------------------------
 *
 * This file contains function definitions for the built-in ROM functions 
 * of the Dallas Semiconductor 400 processor.  This file is intended for use 
 * with the Keil MicroVision (uVision) C compiler.
 *
 * ---------------------------------------------------------------------------
 */
#ifndef __rom400_init_
#define __rom400_init_

/** \file rom400_init.h
 *  \brief ROM Initialization functions in the DS80C400 ROM
 *
 *  This library contains functions for initializing the functionality
 *  in the ROM.  Note that the preferred way of initializing the ROM is
 *  to simply call the <i>#init_rom</i> function.  However, you can also
 *  initialize the various modules individually.  To do this, call 
 *  these functions in this order:
 *     -# <i> #init_clearXSEG </i>
 *     -# <i> #init_copyivt </i>
 *     -# <i> #init_redirect </i>
 *     -# <i> #init_clearSystemRAM </i>
 *     -# <i> #init_mm </i>
 *     -# <i> #init_km </i>
 *     -# <i> #init_ow </i>
 *     -# <i> #init_network </i>
 *     -# <i> #init_eth </i>
 *     -# <i> #init_sockets </i>
 *     -# <i> #init_tick </i>
 *     -# <i> #task_genesis </i> [in the process scheduler library]
 *     -# <i> #init_enableinterrupts </i>
 *
 *  For detailed information on the DS80C400 please see the
 *  <a href="http://pdfserv.maxim-ic.com/arpdf/Design/DS80C400UG.pdf">
 *  High-Speed Microcontroller User's Guide: DS80C400 Supplement</a>.
 *
 *  Functions in this library should only be called once on startup.
 *  The safety of calling these functions from multiple processes at
 *  the same time is irrelevant.
 *  
 */

/** Version number associated with this header file.  Should be the same as
 * the version number returned by the <i>#init_version</i> function.
 * \sa #init_version */
#define ROM400_INIT_VERSION         16


/**
 *  Macro that allows the use of a define to determine whether or not
 * to call the function <i>#init_usekeilmonitor</i>.  This macro can
 * be called after calling <i>#init_rom</i>, and will correct some
 * monitor configuration details that are destroyed when <i>#init_rom</i>
 * is called.
 * 
 * \sa       #init_rom
 * \sa       #init_usekeilmonitor
 * 
 */
#ifdef MONITOR
  #define USE_KEIL_MONITOR init_usekeilmonitor();
#else
  #define USE_KEIL_MONITOR
#endif


/**
 * 1-Wire divisor value for operating frequencies greater than 3 MHz but less than 4 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_3MHZ    0x01      // 00000001B

/**
 * 1-Wire divisor value for operating frequencies greater than 4 MHz but less than 5 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_4MHZ    0x08      // 00001000B

/**
 * 1-Wire divisor value for operating frequencies greater than 5 MHz but less than 6 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_5MHZ    0x02      // 00000010B

/**
 * 1-Wire divisor value for operating frequencies greater than 6 MHz but less than 7 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_6MHZ    0x05      // 00000101B

/**
 * 1-Wire divisor value for operating frequencies greater than 7 MHz but less than 8 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_7MHZ    0x03      // 00000011B

/**
 * 1-Wire divisor value for operating frequencies greater than 8 MHz but less than 10 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_8MHZ    0x0C      // 00001100B

/**
 * 1-Wire divisor value for operating frequencies greater than 10 MHz but less than 12 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_10MHZ   0x06      // 00000110B

/**
 * 1-Wire divisor value for operating frequencies greater than 12 MHz but less than 14 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_12MHZ   0x09      // 00001001B

/**
 * 1-Wire divisor value for operating frequencies greater than 14 MHz but less than 16 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_14MHZ   0x07      // 00000111B

/**
 * 1-Wire divisor value for operating frequencies greater than 16 MHz but less than 20 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_16MHZ   0x10      // 00010000B

/**
 * 1-Wire divisor value for operating frequencies greater than 20 MHz but less than 24 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_20MHZ   0x0A      // 00001010B

/**
 * 1-Wire divisor value for operating frequencies greater than 24 MHz but less than 28 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_24MHZ   0x0D      // 00001101B

/**
 * 1-Wire divisor value for operating frequencies greater than 28 MHz but less than 32 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_28MHZ   0x0B      // 00001011B

/**
 * 1-Wire divisor value for operating frequencies greater than 32 MHz but less than 40 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_32MHZ   0x14      // 00010100B

/**
 * 1-Wire divisor value for operating frequencies greater than 40 MHz but less than 48 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_40MHZ   0x0E      // 00001110B

/**
 * 1-Wire divisor value for operating frequencies greater than 48 MHz but less than 56 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_48MHZ   0x11      // 00010001B

/**
 * 1-Wire divisor value for operating frequencies greater than 56 MHz but less than 64 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_56MHZ   0x0F      // 00001111B

/**
 * 1-Wire divisor value for operating frequencies greater than 64 MHz but less than 80 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_64MHZ   0x18      // 00011000B

/**
 * 1-Wire divisor value for operating frequencies greater than 80 MHz but less than 96 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_80MHZ   0x12      // 00010010B

/**
 * 1-Wire divisor value for operating frequencies greater than 96 MHz but less than 112 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_96MHZ   0x15      // 00010101B

/**
 * 1-Wire divisor value for operating frequencies greater than 112 MHz but less than 128 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_112MHZ  0x13      // 00010011B

/**
 * 1-Wire divisor value for operating frequencies greater than 128 MHz.
 * \sa #init_ow
 */
#define INIT_DIVISOR_128MHZ  0x1C      // 00011100B

/*
OWM_DIVISOR_TABLE:
        ; Clock Rate (MHz)   Divisor to use
        db      3,           00001B
        db      4,           01000B
        db      5,           00010B
        db      6,           00101B
        db      7,           00011B
        db      8,           01100B
        db      10,          00110B
        db      12,          01001B
        db      14,          00111B
        db      16,          10000B
        db      20,          01010B
        db      24,          01101B
        db      28,          01011B
        db      32,          10100B
        db      40,          01110B
        db      48,          10001B
        db      56,          01111B
        db      64,          11000B
        db      80,          10010B
        db      96,          10101B
        db      112,         10011B
OWM_DIVISOR_TABLE_MAX:
        db      128,         11100B
*/


/**
 * Power fail reset status.
 * \sa #init_getbootstate
 */
#define INIT_POWERFAIL_RESET	0x08

/**
 * Watchdog reset status.
 * \sa #init_getbootstate
 */
#define INIT_WATCHDOG_RESET	0x10

/**
 * Crystal failure reset status.
 * \sa #init_getbootstate
 */
#define INIT_CRYSTALFAIL_RESET	0x20


/**
 * Defines the default start address for the heap.
 * \sa #init_rom
 */
extern void HEAP_START(void);
#define DEFAULT_HEAP_START ((((long)&HEAP_START)&0x7fffffL)-0x10000L)


/**
 * \brief     Initializes the modules in the ROM.
 *
 * Initializes the network stack, memory manager, process scheduler, and 
 * other modules in the DS80C400 Silicon Software.  Calling this method is
 * the preferred way of initializing the ROM.
 *
 * Note that calling this function will cause the ROM to copy its own
 * interrupt table into memory.  If you have any interrupts installed
 * before calling this function (for instance, you use the Keil compilers
 * <i>interrupt</i> keyword to declare your function an interrupt handler), 
 * the entry in the interrupt table will be erased.
 *
 * <i>init_rom</i> prints status information to the serial port if serial 0
 * is set to use timer 2. If that is not desired, clear <i>tr2</i>.
 * <code>
 *   #include "reg400.h"
 *   ...
 *   TR2 = 0;
 *   init_rom(...);
 *   TR2 = 1;
 * </code>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -