]> rtime.felk.cvut.cz Git - sysless.git/blob - board/arm/lpc2364_addat/libs/hwinit/startcfg.h
2555079a689121f391a6924f774d4f3cf7c39ee6
[sysless.git] / board / arm / lpc2364_addat / libs / hwinit / startcfg.h
1 \r
2 \r
3 \r
4 /** Fosc is crystal oscilator / resonator\r
5  *  If is not defined, is used  14,745MHz nominal oscilator (CTU DRAGONS LPC BOARD )\r
6  */\r
7 #ifndef FOSC // FIXME: rename to CPU_REF_HZ\r
8   #define FOSC  14745\r
9 #endif\r
10 \r
11 \r
12 /** If memory is in RAM, it must be defined! Otherwise is defined MEM_FLASH\r
13  *  This is important for MAM module.\r
14  */\r
15 #ifndef MEM_RAM\r
16   #define MEM_FLASH     \r
17 #endif\r
18 \r
19 \r
20 /// Absolute minimum and maximum ratings\r
21 #define FCCO_MIN 156000         // internal minimal clock\r
22 #define FCCO_MAX 320000         // internal maximal clock\r
23 #define CCLK_MIN 10000          // processor minimal clock\r
24 #define CCLK_MAX 60000          // processor maximal clock\r
25 \r
26 \r
27 /// PLL Available multiplicators \r
28 #define PLL_MUL_1       0\r
29 #define PLL_MUL_2       1\r
30 #define PLL_MUL_3       2\r
31 #define PLL_MUL_4       3\r
32 #define PLL_MUL_5       4\r
33 #define PLL_MUL_6       5\r
34 #define PLL_MUL_7       6\r
35 \r
36 /// PLL Available divisors\r
37 #define PLL_DIV_2       2\r
38 #define PLL_DIV_4       4\r
39 #define PLL_DIV_8       8\r
40 #define PLL_DIV_16      16\r
41 \r
42 /// PLL mode\r
43 #define PLL_MODE_DISABLE        1\r
44 #define PLL_MODE_ENABLE         0\r
45 \r
46 /// MAM definitions\r
47 #define MAM_OFF         0       // MAM functions disabled\r
48 #define MAM_PARTIAL 1   // MAM functions partially enabled\r
49 #define MAM_FULL        2       // MAM functions fully enabled\r
50 \r
51 \r
52 /// APB divider\r
53 ///@{\r
54 #define APB_DIV_1       1\r
55 #define APB_DIV_2       2\r
56 #define APB_DIV_4       0\r
57 ///@}\r
58 \r
59 \r
60 \r
61 \r
62 \r
63 void wait(void);  // in future this should be deleted\r
64 \r
65 \r
66 \r
67 /** deb_led controls system debug leds\r
68  *  @param      leds    LED value\r
69  */\r
70 void deb_led(char leds);\r
71 \r
72 /** Enables PLL for higher Fosc values\r
73  *  @return 0 or #ERANGE\r
74  *  @param      mul             PLL multiplicator\r
75  *  @param      div             PLL divider\r
76  *  @param      disable disables PLL\r
77  */\r
78 unsigned char init_PLL(char mul,char div, char mode);\r
79 \r
80 /** get_sys_speed returns actual speed of Cclk (proc. frequency) in kHz\r
81  */\r
82 unsigned int get_sys_speed(void);\r
83 \r
84 \r
85 /** Setup MAM module\r
86  *  @return 0 or ERANGE\r
87  *  @param      mode    MAM mode\r
88  */\r
89 unsigned char init_MAM(char mode);\r
90 \r
91 /** Sets APB divisor\r
92  *  @return 0 \r
93  *  @note VPB = APB   - name conflict FIXME\r
94  *  @param      div     divisor of APB\r
95  */\r
96 unsigned char set_APB(char div);\r
97 \r
98 /** Returns actual speed of APB (peripheral frequency) in kHz\r
99  *  @note VPB = APB   - name conflict FIXME\r
100  */\r
101 unsigned int get_apb_speed(void);\r
102 \r