]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/sys/_tms570_hydctr/port.h
Add comments to pinmux.h
[pes-rpp/rpp-lib.git] / rpp / include / sys / _tms570_hydctr / port.h
1 /**
2  * This file contains configuration parameters for the MCU.
3  *
4  * @file  port.h
5  *
6  * @copyright Copyright (C) 2012-2013 Czech Technical University in Prague
7  *
8  * @author Michal Horn <hornmich@fel.cvut.cz>
9  *
10  * Clock sources and parameters can be defined here in order of the clock tree and
11  * limitations of each MCU.
12  */
13
14 #ifndef PORT_H_
15 #define PORT_H_
16
17 /**
18  * MCU endianity. Define the constant as 1 for little endian.
19  */
20 #define __LITTLE_ENDIAN__       0
21 /*
22  * Clock configuration.
23  *
24  * The configuration of the clock sources consists of two steps.
25  * 1) Fill in all the multipliers, dividers and define all the sources.
26  * 2) Take the sources clocks values, apply the multipliers and dividers,
27  *    calculate the resulting requency and fill in the RPP_something_FREQ.
28  *    Those values are used in the code as a reference values and are not
29  *    calculated automatically.
30  *
31  * Consult the datasheet to the MCU for more information about the clock tree
32  * and limitations.
33  */
34 #define RPP_OSC_FR  16000000    /**< Main clock source frequency in Hz. */
35 /*
36  * PLL1 configuration.
37  */
38 #define RPP_PLL1_REF_CLK_DIV    6               /**< PLL1 Frequency clock divider. */
39 #define RPP_PLL1_CLK_MUL        120             /**< PLL1 Frequency multiplier. */
40 #define RPP_PLL1_CLK_OUT_DIV    2               /**< PLL1 output frequency internal divider. */
41 #define RPP_PLL1_CLK_DIV        1               /**< PLL1 final clock divider. */
42 #define RPP_PLL1_FREQ           160000000       /**< Desired frequency of PLL1 in Hz. Make sure this value is the result
43                                                          RPP_OSC_FR / RPP_PLL1_REF_CLK_DIV * RPP_PLL1_CLK_MUL / RPP_PLL1_CLK_OUT_DIV / RPP_PLL1_CLK_DIV
44                                                          because it is used in the code as a reference clock value.
45                                                      */
46 /*
47  * PLL2 configuration.
48  */
49 #define RPP_PLL2_REF_CLK_DIV    6               /**< PLL2 Frequency clock divider. */
50 #define RPP_PLL2_CLK_MUL        120             /**< PLL2 Frequency multiplier. */
51 #define RPP_PLL2_CLK_OUT_DIV    2               /**< PLL2 output frequency internal divider. */
52 #define RPP_PLL2_CLK_DIV        1               /**< PLL2 final clock divider. */
53 #define RPP_PLL2_FREQ           160000000       /**< Desired frequency of PLL2 in Hz. Make sure this value is the result
54                                                          RPP_OSC_FR / RPP_PLL1_REF_CLK_DIV * RPP_PLL1_CLK_MUL / RPP_PLL1_CLK_OUT_DIV / RPP_PLL1_CLK_DIV
55                                                          because it is used in the code as a reference clock value.
56                                                      */
57 /*
58  * Peripheral clocks configuration.
59  */
60 #define RPP_GHVSRC_CLK_SOURCE   SYS_PLL1        /**< Clock source for GCLK, HCLK and VCLK peripherals */
61 #define RPP_VCLK1_CLK_DIV       2               /**< Clock divider for VCLK1 */
62 #define RPP_VCLK1_FREQ          80000000        /**< Desired frequency of the VCLK1 in Hz. Make sure this value is the result
63                                                          RPP_GHVSRC_CLK_SOURCE / RPP_VCLK1_CLK_DIV
64                                                          because it is used in the code as a reference clock value.
65                                                      */
66 #define RPP_VCLK2_CLK_DIV       2               /**< Clock divider for VCLK2 */
67 #define RPP_VCLK2_FREQ          80000000        /**< Desired frequency of the VCLK2 in Hz. Make sure this value is the result
68                                                          RPP_GHVSRC_CLK_SOURCE / RPP_VCLK2_CLK_DIV
69                                                          because it is used in the code as a reference clock value.
70                                                      */
71 #define RPP_VCLK3_CLK_DIV       2               /**< Clock divider for VCLK3 */
72 #define RPP_VCLK3_FREQ          80000000        /**< Desired frequency of the VCLK3 in Hz. Make sure this value is the result
73                                                          RPP_GHVSRC_CLK_SOURCE / RPP_VCLK3_CLK_DIV
74                                                          because it is used in the code as a reference clock value.
75                                                      */
76 #define RPP_RCLK_CLK_SRC        SYS_VCLK        /**< Clock source for RTI */
77 #define RPP_RCLK_CLK_DIV        1               /**< Clock divider for RTI. Value between 0-3. RTI1DIV=2^RPP_RCLK_CLK_DIV  */
78 #define RPP_RCLK_FREQ           80000000        /**< Desired RTI clock in Hz. Make sure this value is the result
79                                                          RPP_RCLK_CLK_SRC / RPP_RCLK_CLK_DIV
80                                                          because it is used in the code as a reference clock value.
81                                                      */
82 #define RPP_VCLKA1_CLK_SRC      SYS_VCLK        /**< Clock source for VCLKA1 */
83 #define RPP_VCLKA1_FREQ         80000000        /**< Desired VCLKA1 clock in Hz. Make sure this value is the result
84                                                          RPP_VCLKA1_CLK_SRC
85                                                          because it is used in the code as a reference clock value.
86                                                      */
87 #define RPP_VCLKA2_CLK_SRC      SYS_VCLK        /**< Clock source for VCLKA2 */
88 #define RPP_VCLKA2_FREQ         80000000        /**< Desired VCLKA2 clock in Hz. Make sure this value is the result
89                                                          RPP_VCLKA2_CLK_SRC
90                                                          because it is used in the code as a reference clock value.
91                                                      */
92 #define RPP_VCLKA3_CLK_SRC      SYS_VCLK        /**< Clock source for VCLKA3 */
93 #define RPP_VCLKA3_DIV_OUT_DIS  0               /**< Disable the VCLKA3 divider output */
94 #define RPP_VCLKA3_CLK_DIV      2               /**< Clock divider for the VCLKA3 source */
95 #define RPP_VCLKA3_FREQ         80000000        /**< Desired VCLKA3 clock in Hz. Make sure this value is the result
96                                                          RPP_VCLKA3_CLK_SRC / RPP_VCLKA3_CLK_DIV if the divider is used, else RPP_VCLKA3_CLK_SRC
97                                                          because it is used in the code as a reference clock value.
98                                                      */
99 #define RPP_VCLKA4_CLK_SRC      SYS_VCLK        /**< Clock source for VCLKA4 */
100 #define RPP_VCLKA4_DIV_OUT_DIS  0               /**< Disable the VCLKA4 divider output */
101 #define RPP_VCLKA4_CLK_DIV      2               /**< Clock divider for the VCLKA4 source */
102 #define RPP_VCLKA4_FREQ         80000000        /**< Desired VCLKA4 clock in Hz. Make sure this value is the result
103                                                          RPP_VCLKA4_CLK_SRC / RPP_VCLKA4_CLK_DIV if the divider is used, else RPP_VCLKA4_CLK_SRC
104                                                          because it is used in the code as a reference clock value.
105                                                      */
106 #endif /* PORT_H_ */