/* ********************************************************************************************************* * EXAMPLE CODE * * This file is provided as an example on how to use Micrium products. * * Please feel free to use any application code labeled as 'EXAMPLE CODE' in * your application products. Example code may be used as is, in whole or in * part, or may be used as a reference only. This file can be modified as * required to meet the end-product requirements. * * Please help us continue to provide the Embedded community with the finest * software available. Your honesty is greatly appreciated. * * You can find our product's user manual, API reference, release notes and * more information at https://doc.micrium.com. * You can contact us at www.micrium.com. ********************************************************************************************************* */ /* ********************************************************************************************************* * * MICRIUM BOARD SUPPORT PACKAGE * * ST Microelectronics STM32 * on the * * STM3240G-EVAL * Evaluation Board * * Filename : bsp.c * Version : V1.00 * Programmer(s) : FF ********************************************************************************************************* */ /* ********************************************************************************************************* * INCLUDE FILES ********************************************************************************************************* */ #define BSP_MODULE #include /* ********************************************************************************************************* * BSP_CPU_ClkFreq() * * Description : Read CPU registers to determine the CPU clock frequency of the chip. * * Argument(s) : none. * * Return(s) : The CPU clock frequency, in Hz. * * Caller(s) : Application. * * Note(s) : none. ********************************************************************************************************* */ CPU_INT32U BSP_CPU_ClkFreq(void) { // CPU_INT32U hclk_freq; RCC_ClocksTypeDef RCC_Clocks; RCC_GetClocksFreq(&RCC_Clocks); // hclk_freq = RCC_GetClocksFreq(HCLK_Frequency); return (RCC_Clocks.HCLK_Frequency); }