projekty/Source/example1/src/include/lpc2100/lpc2100/lpcSCB.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * $RCSfile: $
00004  * $Revision: $
00005  *
00006  * Header file for Philips LPC ARM Processors.
00007  * Copyright 2004 R O SoftWare
00008  *
00009  * No guarantees, warrantees, or promises, implied or otherwise.
00010  * May be used for hobby or commercial purposes provided copyright
00011  * notice remains intact.
00012  *
00013  *****************************************************************************/
00014 #ifndef INC_LPC_SCB_H
00015 #define INC_LPC_SCB_H
00016 
00017 // System Control Block Registers
00018 typedef struct
00019 {
00020   // Memory Accelerator Module Registers (MAM)
00021   struct
00022     {
00023     REG_8 cr;                           // Control Register
00024     REG_8 _pad0[3];
00025     REG_8 tim;                          // Timing Control Register
00026     REG32 _pad1[14];
00027     } mam;
00028 
00029   // Memory Mapping Control Register
00030   REG_8 memmap;
00031   REG32 _pad0[15];
00032 
00033   // Phase Locked Loop Registers (PLL)
00034   struct
00035     {
00036     REG_8 con;                          // Control Register
00037     REG_8 _pad0[3];
00038     REG_8 cfg;                          // Configuration Register
00039     REG_8 _pad1[3];
00040     REG16 stat;                         // Status Register
00041     REG16 _pad2;
00042     REG_8 feed;                         // Feed Register
00043     REG32 _pad3[12];
00044     } pll;
00045 
00046   // Power Control Registers
00047   struct
00048     {
00049     REG_8 con;                          // Control Register
00050     REG_8 _pad0[3];
00051     REG32 conp;                         // Peripherals Register
00052     REG32 _pad1[14];
00053     } p;
00054 
00055   // VPB Divider Register
00056   REG_8 vpbdiv;
00057   REG32 _pad1[15];
00058 
00059   // External Interrupt Registers
00060   struct
00061     {
00062     REG_8 flag;                         // Flag Register
00063     REG_8 _pad0[3];
00064     REG_8 wake;                         // Wakeup Register
00065     REG_8 _pad1[3];
00066     REG_8 mode;                         // Mode Register
00067     REG_8 _pad2[3];
00068     REG_8 polar;                        // Polarity Register
00069     REG32 _pad3[12];
00070     } ext;
00071 } scbRegs_t;
00072 
00073 
00075 // MAM defines
00076 #define MAMCR_OFF     0
00077 #define MAMCR_PART    1
00078 #define MAMCR_FULL    2
00079 
00080 #define MAMTIM_CYCLES (((CCLK) + 19999999) / 20000000)
00081 
00083 // MEMMAP defines
00084 #define MEMMAP_BBLK   0                 // Interrupt Vectors in Boot Block
00085 #define MEMMAP_FLASH  1                 // Interrupt Vectors in Flash
00086 #define MEMMAP_SRAM   2                 // Interrupt Vectors in SRAM
00087 
00089 // PLL defines & computations
00090 // Compute the value of PLL_DIV and test range validity
00091 // FOSC & PLL_MUL should be defined in project configuration file (config.h)
00092 #ifndef CCLK
00093 #define CCLK          (FOSC * PLL_MUL)  // CPU Clock Freq.
00094 #endif
00095 
00096 #define FCCO_MAX      (320000000)       // Max CC Osc Freq.
00097 #define PLL_DIV       (FCCO_MAX / (2 * CCLK)) // PLL Divider
00098 #define FCCO          (FOSC * PLL_MUL * 2 * PLL_DIV) // CC Osc. Freq.
00099 
00100 // PLLCON Register Bit Definitions
00101 #define PLLCON_PLLE   (1 << 0)          // PLL Enable
00102 #define PLLCON_PLLC   (1 << 1)          // PLL Connect
00103 
00104 // PLLCFG Register Bit Definitions
00105 #define PLLCFG_MSEL   ((PLL_MUL - 1) << 0) // PLL Multiplier
00106 #define PLLCFG_PSEL   ((PLL_DIV - 1) << 5) // PLL Divider
00107 
00108 // PLLSTAT Register Bit Definitions
00109 #define PLLSTAT_LOCK  (1 << 10)         // PLL Lock Status Bit
00110 
00112 // VPBDIV defines & computations
00113 #define VPBDIV_VALUE  (PBSD & 0x03)     // VPBDIV value
00114 #define XCLKDIV_1     (1 << 4)          // XCLK = cclk/1
00115 #define XCLKDIV_2     (2 << 4)          // XCLK = cclk/2
00116 #define XCLKDIV_4     (0 << 4)          // XCLK = cclk/4
00117 
00118 
00119 #endif

Generated on Fri Sep 21 13:41:54 2007 for example1 by  doxygen 1.4.7