system_MIMXRT1052.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. ** ###################################################################
  3. ** Processors: MIMXRT1052CVJ5B
  4. ** MIMXRT1052CVL5B
  5. ** MIMXRT1052DVJ6B
  6. ** MIMXRT1052DVL6B
  7. **
  8. ** Compilers: Keil ARM C/C++ Compiler
  9. ** Freescale C/C++ for Embedded ARM
  10. ** GNU C Compiler
  11. ** IAR ANSI C/C++ Compiler for ARM
  12. ** MCUXpresso Compiler
  13. **
  14. ** Reference manual: IMXRT1050RM Rev.1, 03/2018
  15. ** Version: rev. 0.1, 2017-01-10
  16. ** Build: b180509
  17. **
  18. ** Abstract:
  19. ** Provides a system configuration function and a global variable that
  20. ** contains the system frequency. It configures the device and initializes
  21. ** the oscillator (PLL) that is part of the microcontroller device.
  22. **
  23. ** The Clear BSD License
  24. ** Copyright 2016 Freescale Semiconductor, Inc.
  25. ** Copyright 2016-2018 NXP
  26. ** All rights reserved.
  27. **
  28. ** Redistribution and use in source and binary forms, with or without
  29. ** modification, are permitted (subject to the limitations in the
  30. ** disclaimer below) provided that the following conditions are met:
  31. **
  32. ** * Redistributions of source code must retain the above copyright
  33. ** notice, this list of conditions and the following disclaimer.
  34. **
  35. ** * Redistributions in binary form must reproduce the above copyright
  36. ** notice, this list of conditions and the following disclaimer in the
  37. ** documentation and/or other materials provided with the distribution.
  38. **
  39. ** * Neither the name of the copyright holder nor the names of its
  40. ** contributors may be used to endorse or promote products derived from
  41. ** this software without specific prior written permission.
  42. **
  43. ** NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  44. ** GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
  45. ** HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  46. ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  47. ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  48. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  49. ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  50. ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  51. ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  52. ** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  53. ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  54. ** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  55. ** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  56. **
  57. ** http: www.nxp.com
  58. ** mail: support@nxp.com
  59. **
  60. ** Revisions:
  61. ** - rev. 0.1 (2017-01-10)
  62. ** Initial version.
  63. **
  64. ** ###################################################################
  65. */
  66. /*!
  67. * @file MIMXRT1052
  68. * @version 0.1
  69. * @date 2017-01-10
  70. * @brief Device specific configuration file for MIMXRT1052 (header file)
  71. *
  72. * Provides a system configuration function and a global variable that contains
  73. * the system frequency. It configures the device and initializes the oscillator
  74. * (PLL) that is part of the microcontroller device.
  75. */
  76. #ifndef _SYSTEM_MIMXRT1052_H_
  77. #define _SYSTEM_MIMXRT1052_H_ /**< Symbol preventing repeated inclusion */
  78. #ifdef __cplusplus
  79. extern "C" {
  80. #endif
  81. #include <stdint.h>
  82. #ifndef DISABLE_WDOG
  83. #define DISABLE_WDOG 1
  84. #endif
  85. /* Define clock source values */
  86. #define CPU_XTAL_CLK_HZ 24000000UL /* Value of the external crystal or oscillator clock frequency in Hz */
  87. #define CPU_CLK1_HZ 0UL /* Value of the CLK1 (select the CLK1_N/CLK1_P as source) frequency in Hz */
  88. /* If CLOCK1_P,CLOCK1_N is choose as the pll bypass clock source, please implement the CLKPN_FREQ define, otherwise 0 will be returned. */
  89. #define DEFAULT_SYSTEM_CLOCK 528000000UL /* Default System clock value */
  90. /**
  91. * @brief System clock frequency (core clock)
  92. *
  93. * The system clock frequency supplied to the SysTick timer and the processor
  94. * core clock. This variable can be used by the user application to setup the
  95. * SysTick timer or configure other parameters. It may also be used by debugger to
  96. * query the frequency of the debug timer or configure the trace clock speed
  97. * SystemCoreClock is initialized with a correct predefined value.
  98. */
  99. extern uint32_t SystemCoreClock;
  100. /**
  101. * @brief Setup the microcontroller system.
  102. *
  103. * Typically this function configures the oscillator (PLL) that is part of the
  104. * microcontroller device. For systems with variable clock speed it also updates
  105. * the variable SystemCoreClock. SystemInit is called from startup_device file.
  106. */
  107. void SystemInit (void);
  108. /**
  109. * @brief Updates the SystemCoreClock variable.
  110. *
  111. * It must be called whenever the core clock is changed during program
  112. * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
  113. * the current core clock.
  114. */
  115. void SystemCoreClockUpdate (void);
  116. /**
  117. * @brief SystemInit function hook.
  118. *
  119. * This weak function allows to call specific initialization code during the
  120. * SystemInit() execution.This can be used when an application specific code needs
  121. * to be called as close to the reset entry as possible (for example the Multicore
  122. * Manager MCMGR_EarlyInit() function call).
  123. * NOTE: No global r/w variables can be used in this hook function because the
  124. * initialization of these variables happens after this function.
  125. */
  126. void SystemInitHook (void);
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif /* _SYSTEM_MIMXRT1052_H_ */