bsp.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. *********************************************************************************************************
  3. * EXAMPLE CODE
  4. *
  5. * This file is provided as an example on how to use Micrium products.
  6. *
  7. * Please feel free to use any application code labeled as 'EXAMPLE CODE' in
  8. * your application products. Example code may be used as is, in whole or in
  9. * part, or may be used as a reference only. This file can be modified as
  10. * required to meet the end-product requirements.
  11. *
  12. * Please help us continue to provide the Embedded community with the finest
  13. * software available. Your honesty is greatly appreciated.
  14. *
  15. * You can find our product's user manual, API reference, release notes and
  16. * more information at https://doc.micrium.com.
  17. * You can contact us at www.micrium.com.
  18. *********************************************************************************************************
  19. */
  20. /*
  21. *********************************************************************************************************
  22. *
  23. * MICRIUM BOARD SUPPORT PACKAGE
  24. *
  25. * ST Microelectronics STM32
  26. * on the
  27. *
  28. * STM3240G-EVAL
  29. * Evaluation Board
  30. *
  31. * Filename : bsp.c
  32. * Version : V1.00
  33. * Programmer(s) : FF
  34. *********************************************************************************************************
  35. */
  36. /*
  37. *********************************************************************************************************
  38. * INCLUDE FILES
  39. *********************************************************************************************************
  40. */
  41. #define BSP_MODULE
  42. #include <bsp.h>
  43. /*
  44. *********************************************************************************************************
  45. * BSP_CPU_ClkFreq()
  46. *
  47. * Description : Read CPU registers to determine the CPU clock frequency of the chip.
  48. *
  49. * Argument(s) : none.
  50. *
  51. * Return(s) : The CPU clock frequency, in Hz.
  52. *
  53. * Caller(s) : Application.
  54. *
  55. * Note(s) : none.
  56. *********************************************************************************************************
  57. */
  58. CPU_INT32U BSP_CPU_ClkFreq(void)
  59. {
  60. // CPU_INT32U hclk_freq;
  61. RCC_ClocksTypeDef RCC_Clocks;
  62. RCC_GetClocksFreq(&RCC_Clocks);
  63. // hclk_freq = RCC_GetClocksFreq(HCLK_Frequency);
  64. return (RCC_Clocks.HCLK_Frequency);
  65. }