1 /*******************************************************************
2 Components for embedded applications builded for
3 laboratory and medical instruments firmware
5 system_def.h - common cover for definition of hardware adresses,
6 registers, timing and other hardware dependant
7 parts of embedded hardware
9 Copyright (C) 2001 by Pavel Pisa pisa@cmp.felk.cvut.cz
10 (C) 2002 by PiKRON Ltd. http://www.pikron.com
12 *******************************************************************/
14 #ifndef _SYSTEM_DEF_H_
15 #define _SYSTEM_DEF_H_
18 #include <system_stub.h>
27 #define VER_CODE(major,minor,patch) (major*0x10000+minor*0x100+patch)
28 /* Software version */
29 #define SW_VER_ID "MX_USBL"
30 #define SW_VER_MAJOR 0
31 #define SW_VER_MINOR 2
32 #define SW_VER_PATCH 0
33 #define SW_VER_CODE VER_CODE(SW_VER_MAJOR,SW_VER_MINOR,SW_VER_PATCH)
34 /* Hardware version */
35 #define HW_VER_ID "MX_CPU"
36 #define HW_VER_MAJOR 1
37 #define HW_VER_MINOR 0
38 #define HW_VER_PATCH 0
39 #define HW_VER_CODE VER_CODE(HW_VER_MAJOR,HW_VER_MINOR,HW_VER_PATCH)
40 /* Version of mechanical */
41 #define MECH_VER_ID "MX_USBL"
42 #define MECH_VER_MAJOR 0
43 #define MECH_VER_MINOR 0
44 #define MECH_VER_PATCH 0
45 #define MECH_VER_CODE VER_CODE(MECH_VER_MAJOR,MECH_VER_MINOR,MECH_VER_PATCH)
48 // PLL setup values are computed within the LPC include file
49 // It relies upon the following defines
50 #define FOSC (11059200) // Master Oscillator Freq.
51 #define PLL_MUL (4) // PLL Multiplier
52 #define CCLK (FOSC * PLL_MUL) // CPU Clock Freq.
54 // Pheripheral Bus Speed Divider
55 #define PBSD 1 // MUST BE 1, 2, or 4
56 #define PCLK (CCLK / PBSD) // Pheripheal Bus Clock Freq.
58 #define CPU_SYS_HZ 1000
61 #define BIT(n) (1 << (n))
64 // Port Bit Definitions & Macros: Description - initial conditions
65 #define TXD0_BIT BIT(0) // used by UART0
66 #define RXD0_BIT BIT(1) // used by UART0
67 #define P0_02_UNUSED_BIT BIT(2) // P0.02 unused - low output
68 #define P0_03_UNUSED_BIT BIT(3) // P0.03 unused - low output
69 #define P0_04_UNUSED_BIT BIT(4) // P0.04 unused - low output
70 #define P0_05_UNUSED_BIT BIT(5) // P0.05 unused - low output
71 #define P0_06_UNUSED_BIT BIT(6) // P0.06 unused - low output
72 #define P0_07_UNUSED_BIT BIT(7) // P0.07 unused - low output
73 #define TXD1_BIT BIT(8) // used by UART1
74 #define RXD1_BIT BIT(9) // used by UART1
75 #define RTS1_BIT BIT(10) // used by UART1
76 #define CTS1_BIT BIT(11) // used by UART1
77 #define DSR1_BIT BIT(12) // used by UART1
78 #define P0_13_UNUSED_BIT BIT(13) // P0.13 unused - low output
79 #define BOOT_BIT BIT(14) // SWITCH
80 #define P0_15_UNUSED_BIT BIT(15) // P0.15 unused - low output
81 #define P0_16_UNUSED_BIT BIT(16) // P0.16 unused - low output
82 #define P0_17_UNUSED_BIT BIT(17) // P0.17 unused - low output
83 #define P0_18_UNUSED_BIT BIT(18) // P0.18 unused - low output
84 #define P0_19_UNUSED_BIT BIT(19) // P0.19 unused - low output
85 #define P0_20_UNUSED_BIT BIT(20) // P0.20 unused - low output
86 #define LED1_BIT BIT(21) // used by LED
87 #define LED2_BIT BIT(22) // used by LED
88 #define P0_23_UNUSED_BIT BIT(23) // P0.23 unused - low output
89 #define P0_24_UNUSED_BIT BIT(24) // P0.24 unused - low output
90 #define P0_25_UNUSED_BIT BIT(25) // P0.25 unused - low output
91 #define P0_26_UNUSED_BIT BIT(26) // P0.26 unused - low output
92 #define P0_27_UNUSED_BIT BIT(27) // P0.27 unused - low output
93 #define P0_28_UNUSED_BIT BIT(28) // P0.28 unused - low output
94 #define P0_29_UNUSED_BIT BIT(29) // P0.29 unused - low output
95 #define P0_30_UNUSED_BIT BIT(30) // P0.30 unused - low output
96 #define P0_31_UNUSED_BIT BIT(31) // P0.31 unused - low output
99 #define P1_16_UNUSED_BIT BIT(16) // P1.16 unused - low output
100 #define P1_17_UNUSED_BIT BIT(17) // P1.17 unused - low output
101 #define P1_18_UNUSED_BIT BIT(18) // P1.18 unused - low output
102 #define P1_19_UNUSED_BIT BIT(19) // P1.19 unused - low output
103 #define P1_20_UNUSED_BIT BIT(20) // P1.20 unused - low output
104 #define P1_21_UNUSED_BIT BIT(21) // P1.21 unused - low output
105 #define P1_22_UNUSED_BIT BIT(22) // P1.22 unused - low output
106 #define P1_23_UNUSED_BIT BIT(23) // P1.23 unused - low output
107 #define P1_24_UNUSED_BIT BIT(24) // P1.24 unused - low output
108 #define P1_25_UNUSED_BIT BIT(25) // P1.25 unused - low output
109 #define P1_26_UNUSED_BIT BIT(26) // used by JTAG
110 #define P1_27_UNUSED_BIT BIT(27) // used by JTAG
111 #define P1_28_UNUSED_BIT BIT(28) // used by JTAG
112 #define P1_29_UNUSED_BIT BIT(29) // used by JTAG
113 #define P1_30_UNUSED_BIT BIT(30) // used by JTAG
114 #define P1_31_UNUSED_BIT BIT(31) // used by JTAG
116 #define P0IO_INPUT_BITS (uint32_t) ( \
120 #define P1IO_INPUT_BITS (uint32_t) ( \
123 #define P0IO_ZERO_BITS (uint32_t) ( \
148 #define P1IO_ZERO_BITS (uint32_t) ( \
168 #define P0IO_ONE_BITS (uint32_t) ( \
174 #define P1IO_ONE_BITS (uint32_t) ( \
177 #define P0IO_OUTPUT_BITS (uint32_t) ( \
181 #define P1IO_OUTPUT_BITS (uint32_t) ( \
185 /***************************************************************************/
186 /* uLan configuration */
192 #ifdef ULD_DEFAULT_BUFFER_SIZE
193 #undef ULD_DEFAULT_BUFFER_SIZE
194 #define ULD_DEFAULT_BUFFER_SIZE 0x0800
197 #define UL_DRV_SYSLESS_PORT 0xE0010000
198 #define UL_DRV_SYSLESS_BAUD 19200
199 #define UL_DRV_SYSLESS_MY_ADR_DEFAULT 1
201 #endif /* _SYSTEM_DEF_H_ */