A bundled STM32F10x Std Periph and CMSIS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

system_stm32f10x.h 3.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. system_stm32f10x.h - This provides system clock functions and an exported
  3. variable for System init and clock configuration.
  4. includes:
  5. SystemInit, SystemCoreClockUpdate,
  6. Copyright (C) 2011 Houtouridis Christos (http://houtouridis.blogspot.com/)
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. Author: Houtouridis Christos <houtouridis.ch@gmail.com>
  18. Date: 11/2011
  19. Version: 0.1
  20. */
  21. #ifndef __stm32f10x_system_h__
  22. #define __stm32f10x_system_h__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include "stm32f10x.h"
  27. /*!< Uncomment the line corresponding to the desired System clock (SYSCLK)
  28. frequency (after reset the HSI is used as SYSCLK source)
  29. IMPORTANT NOTE:
  30. ==============
  31. 1. After each device reset the HSI is used as System clock source.
  32. 2. Please make sure that the selected System clock doesn't exceed your device's
  33. maximum frequency.
  34. 3. If none of the define below is enabled, the HSI is used as System clock
  35. source.
  36. 4. The System clock configuration functions provided within this file assume that:
  37. - For Low, Medium and High density Value line devices an external 8MHz
  38. crystal is used to drive the System clock.
  39. - For Low, Medium and High density devices an external 8MHz crystal is
  40. used to drive the System clock.
  41. - For Connectivity line devices an external 25MHz crystal is used to drive
  42. the System clock.
  43. If you are using different crystal you have to adapt those functions accordingly.
  44. */
  45. #if defined (STM32F10X_LD_VL) || (defined STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
  46. /* #define SYSCLK_FREQ_HSE HSE_VALUE */
  47. #define SYSCLK_FREQ_24MHz 24000000
  48. #else
  49. /* #define SYSCLK_FREQ_HSE HSE_VALUE */
  50. /* #define SYSCLK_FREQ_24MHz 24000000 */
  51. /* #define SYSCLK_FREQ_36MHz 36000000 */
  52. /* #define SYSCLK_FREQ_48MHz 48000000 */
  53. /* #define SYSCLK_FREQ_56MHz 56000000 */
  54. #define SYSCLK_FREQ_72MHz 72000000
  55. #endif
  56. /*!< Uncomment the following line if you need to use external SRAM mounted
  57. on STM3210E-EVAL board (STM32 High density and XL-density devices) or on
  58. STM32100E-EVAL board (STM32 High-density value line devices) as data memory */
  59. #if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
  60. /* #define DATA_IN_ExtSRAM */
  61. #endif
  62. /*!< Uncomment the following line if you need to relocate your vector Table in
  63. Internal SRAM. */
  64. /* #define VECT_TAB_SRAM */
  65. #define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
  66. This value must be a multiple of 0x200. */
  67. #ifdef __cplusplus
  68. extern
  69. #endif
  70. uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
  71. void SystemInit(void);
  72. void SystemCoreClockUpdate(void);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif //#ifndef __stm32f10x_system_h__