1 /******************************************************************************
6 * This module provides information about the project configuration
7 * Copyright 2004, R O SoftWare
8 * No guarantees, warrantees, or promises, implied or otherwise.
9 * May be used for hobby or commercial purposes provided copyright
10 * notice remains intact.
12 *****************************************************************************/
28 #define BIT(n) (1 << (n))
31 // declare functions and values from crt0.S & the linker control file
32 extern void reset(void);
33 // extern void exit(void);
34 extern void abort(void);
35 // maybe add interrupt vector addresses
37 #define HOST_BAUD (115200)
41 // PLL setup values are computed within the LPC include file
42 // It relies upon the following defines
43 #define FOSC (7372800) // Master Oscillator Freq.
44 #define PLL_MUL (4) // PLL Multiplier
45 #define CCLK (FOSC * PLL_MUL) // CPU Clock Freq.
47 // Pheripheral Bus Speed Divider
48 #define PBSD 2 // MUST BE 1, 2, or 4
49 #define PCLK (CCLK / PBSD) // Pheripheal Bus Clock Freq.
51 // Do some value range testing
52 #if ((FOSC < 10000000) || (FOSC > 25000000))
53 //#error Fosc out of range (10MHz-25MHz)
54 //#error correct and recompile
57 #if ((CCLK < 10000000) || (CCLK > 60000000))
58 #error cclk out of range (10MHz-60MHz)
59 #error correct PLL_MUL and recompile
62 #if ((FCCO < 150000000) || (FCCO > 320000000))
63 #error Fcco out of range (156MHz-320MHz)
64 #error internal algorithm error
67 #if ((PBSD != 1) && (PBSD != 2) && (PBSD != 4))
68 #error Pheripheal Bus Speed Divider (PBSD) illegal value (1, 2, or 4)
71 // The following are for the Olimex LPC-P2106 TESTER Board
72 // Port Bit Definitions & Macros: Description - initial conditions
73 #define TXD0_BIT BIT(0) // used by UART0
74 #define RXD0_BIT BIT(1) // used by UART0
75 #define P02_UNUSED_BIT BIT(2) // P0.02 unused - low output
76 #define P03_UNUSED_BIT BIT(3) // P0.03 unused - low output
77 #define P04_UNUSED_BIT BIT(4) // P0.04 unused - low output
78 #define P05_UNUSED_BIT BIT(5) // P0.05 unused - low output
79 #define P06_UNUSED_BIT BIT(6) // P0.06 unused - low output
80 #define LED1_BIT BIT(7) // LED 1 - active low output
81 #define P08_UNUSED_BIT BIT(8) // P0.08 unused - low output
82 #define P09_UNUSED_BIT BIT(9) // P0.09 unused - low output
83 #define P10_UNUSED_BIT BIT(10) // P0.10 unused - low output
84 #define P11_UNUSED_BIT BIT(11) // P0.11 unused - low output
85 #define P12_UNUSED_BIT BIT(12) // P0.12 unused - low output
86 #define P13_UNUSED_BIT BIT(13) // P0.13 unused - low output
87 #define P14_UNUSED_BIT BIT(14) // P0.14 unused - low output
88 #define P15_UNUSED_BIT BIT(15) // P0.15 unused - low output
89 #define P16_UNUSED_BIT BIT(16) // P0.16 unused - low output
90 #define P17_UNUSED_BIT BIT(17) // used by JTAG
91 #define P18_UNUSED_BIT BIT(18) // used by JTAG
92 #define P19_UNUSED_BIT BIT(19) // used by JTAG
93 #define P20_UNUSED_BIT BIT(20) // used by JTAG
94 #define P21_UNUSED_BIT BIT(21) // used by JTAG
95 #define P22_UNUSED_BIT BIT(22) // P0.22 unused - low output
96 #define P23_UNUSED_BIT BIT(23) // P0.23 unused - low output
97 #define P24_UNUSED_BIT BIT(24) // P0.24 unused - low output
98 #define P25_UNUSED_BIT BIT(25) // P0.25 unused - low output
99 #define P26_UNUSED_BIT BIT(26) // P0.26 unused - low output
100 #define P27_UNUSED_BIT BIT(27) // P0.27 unused - low output
101 #define P28_UNUSED_BIT BIT(28) // P0.28 unused - low output
102 #define P29_UNUSED_BIT BIT(29) // P0.29 unused - low output
103 #define P30_UNUSED_BIT BIT(30) // P0.30 unused - low output
104 #define SW1_BIT BIT(31) // Switch 1 - active low input
106 #define PIO_INPUT_BITS (uint32_t) ( \
110 #define PIO_ZERO_BITS (uint32_t) ( \
136 #define PIO_ONE_BITS (uint32_t) ( \
140 #define PIO_OUTPUT_BITS (uint32_t) ( \