mcuconf.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef _MCUCONF_H_
  14. #define _MCUCONF_H_
  15. #define K20x_MCUCONF
  16. /*
  17. * HAL driver system settings.
  18. */
  19. #define K20x7
  20. /* Select the MCU clocking mode below by enabling the appropriate block. */
  21. #define KINETIS_NO_INIT FALSE
  22. /* PEE mode - 48MHz system clock driven by external crystal. */
  23. #define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
  24. #define KINETIS_PLLCLK_FREQUENCY 72000000UL
  25. #define KINETIS_SYSCLK_FREQUENCY 72000000UL
  26. #define KINETIS_BUSCLK_FREQUENCY 36000000UL
  27. #define KINETIS_FLASHCLK_FREQUENCY 24000000UL
  28. #if 0
  29. /* FEI mode - 48 MHz with internal 32.768 kHz crystal */
  30. #define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
  31. #define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
  32. #define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
  33. #define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
  34. #define KINETIS_CLKDIV1_OUTDIV1 1
  35. #define KINETIS_CLKDIV1_OUTDIV2 1
  36. #define KINETIS_CLKDIV1_OUTDIV4 2
  37. #define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
  38. #define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
  39. #endif
  40. /*
  41. * SERIAL driver system settings.
  42. */
  43. #define KINETIS_SERIAL_USE_UART0 TRUE
  44. #define KINETIS_SERIAL_USE_UART1 TRUE
  45. /*
  46. * USB driver settings
  47. */
  48. #define KINETIS_USB_USE_USB0 TRUE
  49. /* Need to redefine this, since the default is for K20x */
  50. /* This is for Teensy LC; you should comment it out (or change to 5)
  51. * for Teensy 3.x */
  52. #define KINETIS_USB_USB0_IRQ_PRIORITY 2
  53. /*
  54. * SPI driver system settings.
  55. */
  56. #define KINETIS_SPI_USE_SPI0 TRUE
  57. #define KINETIS_I2C_USE_I2C0 TRUE
  58. #endif /* _MCUCONF_H_ */