system_MIMXRT1021.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. ** ###################################################################
  3. ** Processors: MIMXRT1021CAF4A
  4. ** MIMXRT1021CAG4A
  5. ** MIMXRT1021DAF5A
  6. ** MIMXRT1021DAG5A
  7. **
  8. ** Compilers: Freescale C/C++ for Embedded ARM
  9. ** GNU C Compiler
  10. ** IAR ANSI C/C++ Compiler for ARM
  11. ** Keil ARM C/C++ Compiler
  12. ** MCUXpresso Compiler
  13. **
  14. ** Reference manual: IMXRT1020RM Rev.2, 01/2021 | IMXRT102XSRM Rev.0
  15. ** Version: rev. 1.2, 2021-08-10
  16. ** Build: b210811
  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. ** Copyright 2016 Freescale Semiconductor, Inc.
  24. ** Copyright 2016-2021 NXP
  25. ** All rights reserved.
  26. **
  27. ** SPDX-License-Identifier: BSD-3-Clause
  28. **
  29. ** http: www.nxp.com
  30. ** mail: support@nxp.com
  31. **
  32. ** Revisions:
  33. ** - rev. 0.1 (2017-11-06)
  34. ** Initial version.
  35. ** - rev. 1.0 (2018-11-27)
  36. ** Update header files to align with IMXRT1020RM Rev.1.
  37. ** - rev. 1.1 (2019-04-29)
  38. ** Add SET/CLR/TOG register group to register CTRL, STAT, CHANNELCTRL, CH0STAT, CH0OPTS, CH1STAT, CH1OPTS, CH2STAT, CH2OPTS, CH3STAT, CH3OPTS of DCP module.
  39. ** - rev. 1.2 (2021-08-10)
  40. ** Update header files to align with IMXRT1020RM Rev.2.
  41. **
  42. ** ###################################################################
  43. */
  44. /*!
  45. * @file MIMXRT1021
  46. * @version 1.2
  47. * @date 2021-08-10
  48. * @brief Device specific configuration file for MIMXRT1021 (header file)
  49. *
  50. * Provides a system configuration function and a global variable that contains
  51. * the system frequency. It configures the device and initializes the oscillator
  52. * (PLL) that is part of the microcontroller device.
  53. */
  54. #ifndef _SYSTEM_MIMXRT1021_H_
  55. #define _SYSTEM_MIMXRT1021_H_ /**< Symbol preventing repeated inclusion */
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. #include <stdint.h>
  60. #ifndef DISABLE_WDOG
  61. #define DISABLE_WDOG 1
  62. #endif
  63. /* Define clock source values */
  64. #define CPU_XTAL_CLK_HZ 24000000UL /* Value of the external crystal or oscillator clock frequency in Hz */
  65. #define DEFAULT_SYSTEM_CLOCK 297000000UL /* Default System clock value */
  66. /**
  67. * @brief System clock frequency (core clock)
  68. *
  69. * The system clock frequency supplied to the SysTick timer and the processor
  70. * core clock. This variable can be used by the user application to setup the
  71. * SysTick timer or configure other parameters. It may also be used by debugger to
  72. * query the frequency of the debug timer or configure the trace clock speed
  73. * SystemCoreClock is initialized with a correct predefined value.
  74. */
  75. extern uint32_t SystemCoreClock;
  76. /**
  77. * @brief Setup the microcontroller system.
  78. *
  79. * Typically this function configures the oscillator (PLL) that is part of the
  80. * microcontroller device. For systems with variable clock speed it also updates
  81. * the variable SystemCoreClock. SystemInit is called from startup_device file.
  82. */
  83. void SystemInit (void);
  84. /**
  85. * @brief Updates the SystemCoreClock variable.
  86. *
  87. * It must be called whenever the core clock is changed during program
  88. * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
  89. * the current core clock.
  90. */
  91. void SystemCoreClockUpdate (void);
  92. /**
  93. * @brief SystemInit function hook.
  94. *
  95. * This weak function allows to call specific initialization code during the
  96. * SystemInit() execution.This can be used when an application specific code needs
  97. * to be called as close to the reset entry as possible (for example the Multicore
  98. * Manager MCMGR_EarlyInit() function call).
  99. * NOTE: No global r/w variables can be used in this hook function because the
  100. * initialization of these variables happens after this function.
  101. */
  102. void SystemInitHook (void);
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* _SYSTEM_MIMXRT1021_H_ */