diff options
Diffstat (limited to 'lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h')
-rw-r--r-- | lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h new file mode 100644 index 000000000..5a9d3c35a --- /dev/null +++ b/lib/chibios-contrib/testhal/KINETIS/FRDM-K20D50M/I2C/mcuconf.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _MCUCONF_H_ | ||
18 | #define _MCUCONF_H_ | ||
19 | |||
20 | #define K20x_MCUCONF | ||
21 | |||
22 | /* | ||
23 | * HAL driver system settings. | ||
24 | */ | ||
25 | |||
26 | /* Select the MCU clocking mode below by enabling the appropriate block. */ | ||
27 | |||
28 | /* Enable clock initialization by HAL */ | ||
29 | #define KINETIS_NO_INIT FALSE | ||
30 | |||
31 | /* PEE mode - external (8 MHz) crystal with PLL for 48 MHz core/system clock. */ | ||
32 | #if 1 | ||
33 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE | ||
34 | #define KINETIS_PLLCLK_FREQUENCY 96000000UL | ||
35 | #define KINETIS_SYSCLK_FREQUENCY 48000000UL | ||
36 | #endif | ||
37 | |||
38 | /* FEI mode - 48 MHz with internal 32.768 kHz oscillator */ | ||
39 | #if 0 | ||
40 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI | ||
41 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
42 | #define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ | ||
43 | #define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ | ||
44 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide MCGCLKOUT (~48MHz) by 1 to SYSCLK */ | ||
45 | #define KINETIS_CLKDIV1_OUTDIV2 1 /* Divide by 1 for (~48MHz) peripheral clock */ | ||
46 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide by 2 for (~24MHz) flash clock */ | ||
47 | #define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY | ||
48 | #define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2 | ||
49 | #endif /* 0 */ | ||
50 | |||
51 | /* FEE mode - 24 MHz with external 32.768 kHz crystal */ | ||
52 | /* not implemented */ | ||
53 | #if 0 | ||
54 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEE | ||
55 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
56 | #define KINETIS_MCG_FLL_DRS 0 /* 732x FLL factor */ | ||
57 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide 48 MHz FLL by 1 => 24 MHz */ | ||
58 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide OUTDIV1 output by 2 => 12 MHz */ | ||
59 | #define KINETIS_SYSCLK_FREQUENCY 23986176UL /* 32.768 kHz*732 (~24 MHz) */ | ||
60 | #define KINETIS_UART0_CLOCK_FREQ (32768 * 732) /* FLL output */ | ||
61 | #define KINETIS_UART0_CLOCK_SRC 1 /* Select FLL clock */ | ||
62 | #define KINETIS_BUSCLK_FREQUENCY (KINETIS_SYSCLK_FREQUENCY / KINETIS_CLKDIV1_OUTDIV4) | ||
63 | #endif /* 0 */ | ||
64 | |||
65 | /* FEE mode - 48 MHz */ | ||
66 | /* not implemented */ | ||
67 | #if 0 | ||
68 | #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEE | ||
69 | #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */ | ||
70 | #define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */ | ||
71 | #define KINETIS_CLKDIV1_OUTDIV1 1 /* Divide 48 MHz FLL by 1 => 48 MHz */ | ||
72 | #define KINETIS_CLKDIV1_OUTDIV4 2 /* Divide OUTDIV1 output by 2 => 24 MHz */ | ||
73 | #define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */ | ||
74 | #endif /* 0 */ | ||
75 | |||
76 | /* | ||
77 | * SERIAL driver system settings. | ||
78 | */ | ||
79 | #define KINETIS_SERIAL_USE_UART0 FALSE | ||
80 | #define KINETIS_I2C_USE_I2C0 TRUE | ||
81 | #define KINETIS_I2C_I2C0_PRIORITY 8 | ||
82 | |||
83 | #endif /* _MCUCONF_H_ */ | ||