Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# global.h

Go to the documentation of this file.

    00001 /*! \file global.h \brief ARMlib project global include. */
    00002 //*****************************************************************************
    00003 //
    00004 // File Name    : 'global.h'
    00005 // Title        : ARM project global include
    00006 // Author       : Pascal Stang
    00007 // Created      : 7/12/2001
    00008 // Revised      : 4/29/2004
    00009 // Version      : 1.1
    00010 // Target MCU   : ARM
    00011 // Editor Tabs  : 4
    00012 //
    00013 //  Description : This include file is designed to contain the specific
    00014 //                  configuration for this project.
    00015 //
    00016 // This code is distributed under the GNU Public License
    00017 //      which can be found at http://www.gnu.org/licenses/gpl.txt
    00018 //
    00019 //*****************************************************************************
    00020
    00021 #ifndef GLOBAL_H
    00022 #define GLOBAL_H
    00023
    00024 // global ARMLIB defines
    00025 #include "armlibdefs.h"
    00026 // global ARMLIB types definitions
    00027 #include "armlibtypes.h"
    00028
    00029 // project/system dependent defines
    00030
    00031 // declare functions and values from crt0.S & the linker control file
    00032 //extern void reset(void);
    00033 //extern void exit(void);
    00034 //extern void abort(void);
    00035 // maybe add interrupt vector addresses
    00036
    00037 // PLL setup values are computed within the LPC include file
    00038 // It relies upon the following defines
    00039 #define FOSC                (14745000)      // Master Oscillator Freq.
    00040 #define PLL_MUL             (4)             // PLL Multiplier
    00041 //#define CCLK              (FOSC*PLL_MUL)  // CPU Clock Freq.
    00042
    00043 // Pheripheral Bus Speed Divider
    00044 #define PBSD                2               // MUST BE 1, 2, or 4
    00045 #define PCLK                (CCLK / PBSD)   // Pheripheal Bus Clock Freq.
    00046
    00047 // Do some value range testing
    00048 #if ((FOSC < 10000000) || (FOSC > 25000000))
    00049 #error Fosc out of range (10MHz-25MHz)
    00050 #error correct and recompile
    00051 #endif
    00052
    00053 #if ((CCLK < 10000000) || (CCLK > 60000000))
    00054 //#error cclk out of range (10MHz-60MHz)
    00055 //#error correct PLL_MUL and recompile
    00056 #endif
    00057
    00058 //#if ((FCCO < 150000000) || (FCCO > 320000000))
    00059 //#error Fcco out of range (156MHz-320MHz)
    00060 //#error internal algorithm error
    00061 //#endif
    00062
    00063 #if ((PBSD != 1) && (PBSD != 2) && (PBSD != 4))
    00064 #error Pheripheal Bus Speed Divider (PBSD) illegal value (1, 2, or 4)
    00065 #endif
    00066
    00067 #endif