GlobLib
HAL and API libraries for MCUs and hardware.
stm32f103cb_clock.c
Go to the documentation of this file.
1 
17 #include "stm32f103cb_clock.h"
18 
20 
21  switch(option){
22 
23  case CLOCK_IN_OUT_64:
24 
25  rcc_clock_setup_in_hsi_out_64mhz();
26  break;
27 
28  case CLOCK_IN_OUT_48:
29 
30  rcc_clock_setup_in_hsi_out_48mhz();
31  break;
32 
33  case CLOCK_IN_OUT_24:
34 
35  rcc_clock_setup_in_hsi_out_24mhz();
36  break;
37 
38  case CLOCK_EX_8_OUT_24:
39 
40  rcc_clock_setup_in_hse_8mhz_out_24mhz();
41  break;
42 
43  case CLOCK_EX_8_OUT_72:
44 
45  rcc_clock_setup_in_hse_8mhz_out_72mhz();
46  break;
47  default:
48 
49  return E_CLOCK_NOSPEED;
50  break;
51  }
52 
53  return E_CLOCK_NOERROR;
54 
55 }
56 
57 uint32_t CLOCK_getSpeed(void){
58 
59  return rcc_apb2_frequency;
60 
61 }
62 
63 uint32_t CLOCK_getSpeedAlternate(void){
64 
65  return rcc_apb1_frequency;
66 
67 }
External 8MHz oscillator, multiplied to 24MHz final.
External 8MHz oscillator, multiplied to 72MHz final.
Error clock: No error.
Error clock: Clock speed doesn't exist.
clock_option
Clock configuration available for MCU.
uint32_t CLOCK_getSpeed(void)
Get the current clock speed of the device.
Internal oscillator, multiplied to 48MHz final.
Internal oscillator, multiplied to 64MHz final.
uint32_t CLOCK_getSpeedAlternate(void)
Get the current clock speed of the alternate bus.
Header file for stm32f103 CLOCK.
Internal oscillator, multiplied to 24MHz final.
mcu_error CLOCK_setSpeed(clock_option option)
Set the final clock speed of the device.
mcu_error
Error enumerators for the Debug peripheral.