]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/config/conf_clock.h
Add SAM4L demo.
[freertos] / FreeRTOS / Demo / CORTEX_M4_ATSAM4L_Atmel_Studio / src / config / conf_clock.h
1 /**\r
2  * \file\r
3  *\r
4  * \brief Chip-specific system clock manager configuration\r
5  *\r
6  * Copyright (c) 2012 Atmel Corporation. All rights reserved.\r
7  *\r
8  * \asf_license_start\r
9  *\r
10  * \page License\r
11  *\r
12  * Redistribution and use in source and binary forms, with or without\r
13  * modification, are permitted provided that the following conditions are met:\r
14  *\r
15  * 1. Redistributions of source code must retain the above copyright notice,\r
16  *    this list of conditions and the following disclaimer.\r
17  *\r
18  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
19  *    this list of conditions and the following disclaimer in the documentation\r
20  *    and/or other materials provided with the distribution.\r
21  *\r
22  * 3. The name of Atmel may not be used to endorse or promote products derived\r
23  *    from this software without specific prior written permission.\r
24  *\r
25  * 4. This software may only be redistributed and used in connection with an\r
26  *    Atmel microcontroller product.\r
27  *\r
28  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
29  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
31  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
32  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
36  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
37  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
38  * POSSIBILITY OF SUCH DAMAGE.\r
39  *\r
40  * \asf_license_stop\r
41  *\r
42  */\r
43 #ifndef CONF_CLOCK_H_INCLUDED\r
44 #define CONF_CLOCK_H_INCLUDED\r
45 \r
46 //#define CONFIG_SYSCLK_INIT_CPUMASK  0\r
47 //#define CONFIG_SYSCLK_INIT_PBAMASK  ((1 << SYSCLK_USART2))\r
48 //#define CONFIG_SYSCLK_INIT_PBBMASK  ((1 << SYSCLK_HFLASHC_REGS))\r
49 //#define CONFIG_SYSCLK_INIT_PBCMASK  ((1 << SYSCLK_PM) | (1 << SYSCLK_SCIF) | (1 << SYSCLK_GPIO))\r
50 //#define CONFIG_SYSCLK_INIT_PBDMASK  ((1 << SYSCLK_BPM) | (1 << SYSCLK_BSCIF) | (1 << SYSCLK_AST))\r
51 //#define CONFIG_SYSCLK_INIT_HSBMASK  ((1 << SYSCLK_HFLASHC_DATA) | (SYSCLK_PBA_BRIDGE) | (SYSCLK_PBC_BRIDGE) | (SYSCLK_PBD_BRIDGE))\r
52 \r
53 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_RCSYS\r
54 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_OSC0\r
55 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_PLL0\r
56 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_DFLL\r
57 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_RC80M\r
58 #define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_RCFAST\r
59 //#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_RC1M\r
60 \r
61 /* RCFAST frequency selection: 0 for 4MHz, 1 for 8MHz and 2 for 12MHz */\r
62 //#define CONFIG_RCFAST_FRANGE    0\r
63 //#define CONFIG_RCFAST_FRANGE    1\r
64 #define CONFIG_RCFAST_FRANGE    2\r
65 \r
66 /* Fbus = Fsys / (2 ^ BUS_div) */\r
67 #define CONFIG_SYSCLK_CPU_DIV         0\r
68 #define CONFIG_SYSCLK_PBA_DIV         0\r
69 #define CONFIG_SYSCLK_PBB_DIV         0\r
70 #define CONFIG_SYSCLK_PBC_DIV         2\r
71 #define CONFIG_SYSCLK_PBD_DIV         2\r
72 \r
73 //#define CONFIG_USBCLK_SOURCE        USBCLK_SRC_OSC0\r
74 //#define CONFIG_USBCLK_SOURCE        USBCLK_SRC_PLL0\r
75 \r
76 /* Fusb = Fsys / USB_div */\r
77 //#define CONFIG_USBCLK_DIV           1\r
78 \r
79 //#define CONFIG_PLL0_SOURCE          PLL_SRC_OSC0\r
80 \r
81 /* Fpll0 = (Fclk * PLL_mul) / PLL_div */\r
82 //#define CONFIG_PLL0_MUL             (48000000UL / BOARD_OSC0_HZ)\r
83 //#define CONFIG_PLL0_DIV             1\r
84 \r
85 //#define CONFIG_DFLL0_SOURCE         GENCLK_SRC_OSC0\r
86 //#define CONFIG_DFLL0_SOURCE         GENCLK_SRC_RCSYS\r
87 //#define CONFIG_DFLL0_SOURCE         GENCLK_SRC_OSC32K\r
88 //#define CONFIG_DFLL0_SOURCE         GENCLK_SRC_RC80M\r
89 //#define CONFIG_DFLL0_SOURCE         GENCLK_SRC_RC32K\r
90 \r
91 /* Fdfll = (Fclk * DFLL_mul) / DFLL_div */\r
92 //#define CONFIG_DFLL0_FREQ           96000000UL\r
93 //#define CONFIG_DFLL0_MUL            (CONFIG_DFLL0_FREQ / BOARD_OSC0_HZ)\r
94 //#define CONFIG_DFLL0_DIV            2\r
95 \r
96 #endif /* CONF_CLOCK_H_INCLUDED */\r
97 \r