system_LPC54114_cm0plus.h 5.6 KB

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