system_hc32f448.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. *******************************************************************************
  3. * @file system_hc32f448.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_HC32F448_H__
  21. #define __SYSTEM_HC32F448_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 "hc32_ll_def.h"
  31. #include "hc32f4xx.h"
  32. #include "hc32f4xx_conf.h"
  33. /**
  34. * @addtogroup CMSIS
  35. * @{
  36. */
  37. /**
  38. * @addtogroup HC32F448_System
  39. * @{
  40. */
  41. /*******************************************************************************
  42. * Global pre-processor symbols/macros ('define')
  43. ******************************************************************************/
  44. /**
  45. * @addtogroup HC32F448_System_Global_Macros
  46. * @{
  47. */
  48. /**
  49. * @addtogroup HC32F448_System_Clock_Source
  50. * @{
  51. */
  52. #if !defined (MRC_VALUE)
  53. #define MRC_VALUE (8000000UL) /*!< Internal middle speed RC freq. */
  54. #endif
  55. #if !defined (LRC_VALUE)
  56. #define LRC_VALUE (32768UL) /*!< Internal low speed RC freq. */
  57. #endif
  58. #if !defined (SWDTLRC_VALUE)
  59. #define SWDTLRC_VALUE (10000UL) /*!< Internal SWDT low speed RC freq. */
  60. #endif
  61. #if !defined (XTAL_VALUE)
  62. #define XTAL_VALUE (8000000UL) /*!< External high speed OSC freq. */
  63. #endif
  64. #if !defined (XTAL32_VALUE)
  65. #define XTAL32_VALUE (32768UL) /*!< External low speed OSC freq. */
  66. #endif
  67. #if !defined (HCLK_VALUE)
  68. #define HCLK_VALUE (SystemCoreClock >> ((CM_CMU->SCFGR & CMU_SCFGR_HCLKS) >> CMU_SCFGR_HCLKS_POS))
  69. #endif
  70. /**
  71. * @}
  72. */
  73. /**
  74. * @}
  75. */
  76. /*******************************************************************************
  77. * Global variable definitions ('extern')
  78. ******************************************************************************/
  79. /**
  80. * @addtogroup HC32F448_System_Exported_Variable
  81. * @{
  82. */
  83. extern uint32_t SystemCoreClock; /*!< System clock frequency (Core clock) */
  84. extern uint32_t HRC_VALUE; /*!< HRC frequency */
  85. /**
  86. * @}
  87. */
  88. /*******************************************************************************
  89. * Global function prototypes (definition in C source)
  90. ******************************************************************************/
  91. /**
  92. * @addtogroup HC32F448_System_Global_Functions
  93. * @{
  94. */
  95. extern void SystemInit(void); /*!< Initialize the system */
  96. extern void SystemCoreClockUpdate(void); /*!< Update SystemCoreClock variable */
  97. #if defined (ROM_EXT_QSPI)
  98. void SystemInit_QspiMem(void);
  99. #endif
  100. /**
  101. * @}
  102. */
  103. /**
  104. * @}
  105. */
  106. /**
  107. * @}
  108. */
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif /* __SYSTEM_HC32F448_H__ */
  113. /*******************************************************************************
  114. * EOF (not truncated)
  115. ******************************************************************************/