ACDC Senior Project v1.0.0
Senior Project for Textron Aviation
|
Implentation of clock configuration functions for STM32F103xB MCU. More...
Macros | |
#define | MAX_MCO_CLK_SPEED 50000000 |
Functions | |
void | CLOCK_SetSystemClockSpeed (SystemClockSpeed SCS_x) |
Sets the SYSCLK speed, and sets the perepherals to their fastest speed available. | |
SystemClockSpeed | CLOCK_GetSystemClockSpeed (void) |
Retrieves the current SYSCLK. | |
SystemClockSpeed | CLOCK_GetAPB1ClockSpeed (void) |
Retrieves the clock speed of the APB1 Clock. | |
SystemClockSpeed | CLOCK_GetAPB2ClockSpeed (void) |
Retrieves the clock speed of the APB2 Clock. | |
SystemClockSpeed | CLOCK_GetAPB1TimerClockSpeed (void) |
Retrieves the clock speed of the APB2 Timer Clock. | |
void | CLOCK_SetMcoOutput (MicroClockOutput MCO_x) |
Enables the MCO output on Pin PA8 using MCO_x as the clock source. | |
void | CLOCK_SetADCPrescaler (ADC_Prescaler ADC_DIV_x) |
Sets the ADC's Prescaler to either 2, 4, 6, 8. | |
void | CLOCK_SetAPB1Prescaler (APB_Prescaler APB_DIV_x) |
Sets the Advanced Peripheral Bus 1 Prescaler to either 1, 2, 4, 8, 16. | |
void | CLOCK_SetAPB2Prescaler (APB_Prescaler APB_DIV_x) |
Sets the Advanced Peripheral Bus 2 Prescaler to either 1, 2, 4, 8, 16. | |
Implentation of clock configuration functions for STM32F103xB MCU.
#define MAX_MCO_CLK_SPEED 50000000 |
SystemClockSpeed CLOCK_GetAPB1ClockSpeed | ( | void | ) |
Retrieves the clock speed of the APB1 Clock.
SystemClockSpeed CLOCK_GetAPB1TimerClockSpeed | ( | void | ) |
Retrieves the clock speed of the APB2 Timer Clock.
SystemClockSpeed CLOCK_GetAPB2ClockSpeed | ( | void | ) |
Retrieves the clock speed of the APB2 Clock.
SystemClockSpeed CLOCK_GetSystemClockSpeed | ( | void | ) |
Retrieves the current SYSCLK.
void CLOCK_SetADCPrescaler | ( | ADC_Prescaler | ADC_DIV_x | ) |
Sets the ADC's Prescaler to either 2, 4, 6, 8.
PRE_DIV_x | ADC Prescaler (Ex. ADC_DIV_2, ADC_DIV_4, ...) |
void CLOCK_SetAPB1Prescaler | ( | APB_Prescaler | APB_DIV_x | ) |
Sets the Advanced Peripheral Bus 1 Prescaler to either 1, 2, 4, 8, 16.
APB_DIV_x | APB1 Prescaler Divider (Ex. APB_DIV_1, APB_DIV_2, ...) |
void CLOCK_SetAPB2Prescaler | ( | APB_Prescaler | APB_DIV_x | ) |
Sets the Advanced Peripheral Bus 2 Prescaler to either 1, 2, 4, 8, 16.
APB_DIV_x | APB2 Prescaler Divider (Ex. APB_DIV_1, APB_DIV_2, ...) |
void CLOCK_SetMcoOutput | ( | MicroClockOutput | MCO_x | ) |
Enables the MCO output on Pin PA8 using MCO_x as the clock source.
MCO_x | Clock output source (Ex. MCO_NO_CLK, MCO_SYSCLK, ...) |
void CLOCK_SetSystemClockSpeed | ( | SystemClockSpeed | SCS_x | ) |
Sets the SYSCLK speed, and sets the perepherals to their fastest speed available.
SCS_x | System Clock Speed (Ex. SCS_72Mhz, SCS_36Mhz, ...) |