system_hc32f448mcti.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. *******************************************************************************
  3. * @file system_hc32f448mcti.h
  4. * @brief This file contains all the functions prototypes of the HC32 System.
  5. @verbatim
  6. Change Logs:
  7. Date Author Notes
  8. 2022-12-31 CDT First version
  9. @endverbatim
  10. *******************************************************************************
  11. * Copyright (C) 2022, Xiaohua Semiconductor Co., Ltd. All rights reserved.
  12. *
  13. * This software component is licensed by XHSC under BSD 3-Clause license
  14. * (the "License"); You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. *******************************************************************************
  19. */
  20. #ifndef __SYSTEM_HC32F448MCTI_H__
  21. #define __SYSTEM_HC32F448MCTI_H__
  22. /* C binding of definitions if building with C++ compiler */
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. /*******************************************************************************
  28. * Include files
  29. ******************************************************************************/
  30. #include <stdint.h>
  31. /**
  32. * @addtogroup CMSIS
  33. * @{
  34. */
  35. /**
  36. * @addtogroup HC32F448_System
  37. * @{
  38. */
  39. /*******************************************************************************
  40. * Global pre-processor symbols/macros ('define')
  41. ******************************************************************************/
  42. /**
  43. * @addtogroup HC32F448_System_Global_Macros
  44. * @{
  45. */
  46. /**
  47. * @addtogroup HC32F448_System_Clock_Source
  48. * @{
  49. */
  50. #if !defined (MRC_VALUE)
  51. #define MRC_VALUE (8000000UL) /*!< Internal middle speed RC freq. */
  52. #endif
  53. #if !defined (LRC_VALUE)
  54. #define LRC_VALUE (32768UL) /*!< Internal low speed RC freq. */
  55. #endif
  56. #if !defined (XTAL_VALUE)
  57. #define XTAL_VALUE (16000000UL) /*!< External high speed OSC freq. */
  58. #endif
  59. #if !defined (XTAL32_VALUE)
  60. #define XTAL32_VALUE (32768UL) /*!< External low speed OSC freq. */
  61. #endif
  62. #if !defined (HCLK_VALUE)
  63. #define HCLK_VALUE (SystemCoreClock >> ((CM_CMU->SCFGR & CMU_SCFGR_HCLKS) >> CMU_SCFGR_HCLKS_POS))
  64. #endif
  65. /**
  66. * @}
  67. */
  68. /**
  69. * @}
  70. */
  71. /*******************************************************************************
  72. * Global variable definitions ('extern')
  73. ******************************************************************************/
  74. /**
  75. * @addtogroup HC32F448_System_Exported_Variable
  76. * @{
  77. */
  78. extern uint32_t SystemCoreClock; /*!< System clock frequency (Core clock) */
  79. extern uint32_t HRC_VALUE; /*!< HRC frequency */
  80. /**
  81. * @}
  82. */
  83. /*******************************************************************************
  84. * Global function prototypes (definition in C source)
  85. ******************************************************************************/
  86. /**
  87. * @addtogroup HC32F448_System_Global_Functions
  88. * @{
  89. */
  90. extern void SystemInit(void); /*!< Initialize the system */
  91. extern void SystemCoreClockUpdate(void); /*!< Update SystemCoreClock variable */
  92. /**
  93. * @}
  94. */
  95. /**
  96. * @}
  97. */
  98. /**
  99. * @}
  100. */
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __SYSTEM_HC32F448MCTI_H__ */
  105. /*******************************************************************************
  106. * EOF (not truncated)
  107. ******************************************************************************/