![]() |
ACDC Senior Project v1.0.0
Senior Project for Textron Aviation
|
Header file containing functions for configuring the system clock and clock-related peripherals. More...
Go to the source code of this file.
Enumerations | |
| enum | SystemClockSpeed { SCS_1MHz = 1000000 , SCS_2MHz = 2000000 , SCS_3MHz = 3000000 , SCS_4MHz = 4000000 , SCS_5MHz = 5000000 , SCS_6MHz = 6000000 , SCS_7MHz = 7000000 , SCS_8MHz = 8000000 , SCS_9MHz = 9000000 , SCS_10MHz = 10000000 , SCS_11MHz = 11000000 , SCS_12MHz = 12000000 , SCS_13MHz = 13000000 , SCS_14MHz = 14000000 , SCS_15MHz = 15000000 , SCS_16MHz = 16000000 , SCS_18MHz = 18000000 , SCS_20MHz = 20000000 , SCS_22MHz = 22000000 , SCS_24MHz = 24000000 , SCS_26MHz = 26000000 , SCS_28MHz = 28000000 , SCS_30MHz = 30000000 , SCS_32MHz = 32000000 , SCS_36MHz = 36000000 , SCS_40MHz = 40000000 , SCS_44MHz = 44000000 , SCS_48MHz = 48000000 , SCS_52MHz = 52000000 , SCS_56MHz = 56000000 , SCS_60MHz = 60000000 , SCS_64MHz = 64000000 , SCS_72MHz = 72000000 } |
| enum | MicroClockOutput { MCO_NO_CLK = RCC_CFGR_MCO_NOCLOCK , MCO_SYSCLK = RCC_CFGR_MCO_SYSCLK , MCO_HSICLK = RCC_CFGR_MCO_HSI , MCO_HSECLK = RCC_CFGR_MCO_HSE , MCO_PLLCLK = RCC_CFGR_MCO_PLLCLK_DIV2 } |
| enum | ADC_Prescaler { ADC_DIV_2 = RCC_CFGR_ADCPRE_DIV2 , ADC_DIV_4 = RCC_CFGR_ADCPRE_DIV4 , ADC_DIV_6 = RCC_CFGR_ADCPRE_DIV6 , ADC_DIV_8 = RCC_CFGR_ADCPRE_DIV8 } |
| enum | APB_Prescaler { APB_DIV_1 = 0b000 , APB_DIV_2 = 0b100 , APB_DIV_4 = 0b101 , APB_DIV_8 = 0b110 , APB_DIV_16 = 0b111 } |
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. | |
Header file containing functions for configuring the system clock and clock-related peripherals.
This file defines enums and functions for configuring the system clock speed, enabling the MCO output, setting ADC and APB prescalers, and retrieving the current system clock speed.
| enum ADC_Prescaler |
| enum APB_Prescaler |
| enum MicroClockOutput |
| enum SystemClockSpeed |
| 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, ...) |