Prusa MINI Firmware overview
stm32_def.h File Reference

Go to the source code of this file.

Macros

#define STM32_CORE_VERSION_MAJOR   (0x01U)
 STM32 core version number. More...
 
#define STM32_CORE_VERSION_MINOR   (0x05U)
 
#define STM32_CORE_VERSION_PATCH   (0x01U)
 
#define STM32_CORE_VERSION_EXTRA   (0xF0U)
 
#define STM32_CORE_VERSION
 
#define F_CPU   SystemCoreClock
 
#define USE_HAL_DRIVER
 
#define CAN1   CAN
 

Functions

void SystemClock_Config (void)
 System Clock Configuration. More...
 

Macro Definition Documentation

◆ STM32_CORE_VERSION_MAJOR

#define STM32_CORE_VERSION_MAJOR   (0x01U)

STM32 core version number.

[31:24] major version

◆ STM32_CORE_VERSION_MINOR

#define STM32_CORE_VERSION_MINOR   (0x05U)

[23:16] minor version

◆ STM32_CORE_VERSION_PATCH

#define STM32_CORE_VERSION_PATCH   (0x01U)

[15:8] patch version

◆ STM32_CORE_VERSION_EXTRA

#define STM32_CORE_VERSION_EXTRA   (0xF0U)

[7:0] extra version

◆ STM32_CORE_VERSION

#define STM32_CORE_VERSION

◆ F_CPU

#define F_CPU   SystemCoreClock

◆ USE_HAL_DRIVER

#define USE_HAL_DRIVER

◆ CAN1

#define CAN1   CAN

Function Documentation

◆ SystemClock_Config()

void SystemClock_Config ( void  )

System Clock Configuration.

Libc porting layers

Return values
None
Parameters
None
Return values
None

Configure the main internal regulator output voltage

Initializes the CPU, AHB and APB busses clocks

Initializes the CPU, AHB and APB busses clocks

Configure the main internal regulator output voltage

Initializes the CPU, AHB and APB busses clocks

Initializes the CPU, AHB and APB busses clocks

Configure the Systick interrupt time

Configure the Systick

Configure the main internal regulator output voltage

Initializes the CPU, AHB and APB busses clocks

Initializes the CPU, AHB and APB busses clocks

Configure the Systick interrupt time

Configure the Systick

Configure the main internal regulator output voltage

Initializes the CPU, AHB and APB busses clocks

Initializes the CPU, AHB and APB busses clocks

295  {
296  RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
297  RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };
298 
299  /**Configure the main internal regulator output voltage
300  */
303  /**Initializes the CPU, AHB and APB busses clocks
304  */
306  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
307  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
308  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
309  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
310  RCC_OscInitStruct.PLL.PLLM = 6;
311  RCC_OscInitStruct.PLL.PLLN = 168;
312  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
313  RCC_OscInitStruct.PLL.PLLQ = 7;
314  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
315  Error_Handler();
316  }
317  /**Initializes the CPU, AHB and APB busses clocks
318  */
321  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
322  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
323  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
324  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
325 
326  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
327  Error_Handler();
328  }
329 }
RCC_PLLP_DIV2
#define RCC_PLLP_DIV2
Definition: stm32f4xx_hal_rcc.h:186
HAL_OK
Definition: stm32f4xx_hal_def.h:57
RCC_HCLK_DIV2
#define RCC_HCLK_DIV2
Definition: stm32f4xx_hal_rcc.h:260
RCC_PLLInitTypeDef::PLLP
uint32_t PLLP
Definition: stm32f4xx_hal_rcc_ex.h:78
RCC_ClkInitTypeDef
RCC System, AHB and APB busses clock configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:93
HAL_RCC_OscConfig
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
RCC_ClkInitTypeDef::SYSCLKSource
uint32_t SYSCLKSource
Definition: stm32f4xx_hal_rcc.h:98
RCC_HSE_ON
#define RCC_HSE_ON
Definition: stm32f4xx_hal_rcc.h:137
RCC_CLOCKTYPE_PCLK2
#define RCC_CLOCKTYPE_PCLK2
Definition: stm32f4xx_hal_rcc.h:209
RCC_CLOCKTYPE_PCLK1
#define RCC_CLOCKTYPE_PCLK1
Definition: stm32f4xx_hal_rcc.h:208
RCC_PLLInitTypeDef::PLLQ
uint32_t PLLQ
Definition: stm32f4xx_hal_rcc_ex.h:81
STM32_CORE_VERSION_MINOR
#define STM32_CORE_VERSION_MINOR
Definition: stm32_def.h:8
RCC_LSI_ON
#define RCC_LSI_ON
Definition: stm32f4xx_hal_rcc.h:168
RCC_PLLInitTypeDef::PLLSource
uint32_t PLLSource
Definition: stm32f4xx_hal_rcc_ex.h:68
RCC_OSCILLATORTYPE_LSI
#define RCC_OSCILLATORTYPE_LSI
Definition: stm32f4xx_hal_rcc.h:128
RCC_OscInitTypeDef::OscillatorType
uint32_t OscillatorType
Definition: stm32f4xx_hal_rcc.h:69
RCC_PLLInitTypeDef::PLLM
uint32_t PLLM
Definition: stm32f4xx_hal_rcc_ex.h:71
RCC_OscInitTypeDef::HSEState
uint32_t HSEState
Definition: stm32f4xx_hal_rcc.h:72
STM32_CORE_VERSION_PATCH
#define STM32_CORE_VERSION_PATCH
Definition: stm32_def.h:9
__HAL_PWR_VOLTAGESCALING_CONFIG
#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)
macros configure the main internal regulator output voltage.
Definition: stm32f4xx_hal_pwr_ex.h:153
RCC_PLLSOURCE_HSE
#define RCC_PLLSOURCE_HSE
Definition: stm32f4xx_hal_rcc.h:198
RCC_PLL_ON
#define RCC_PLL_ON
Definition: stm32f4xx_hal_rcc.h:178
RCC_HCLK_DIV4
#define RCC_HCLK_DIV4
Definition: stm32f4xx_hal_rcc.h:261
STM32_CORE_VERSION_EXTRA
#define STM32_CORE_VERSION_EXTRA
Definition: stm32_def.h:16
RCC_OscInitTypeDef::PLL
RCC_PLLInitTypeDef PLL
Definition: stm32f4xx_hal_rcc.h:87
RCC_CLOCKTYPE_SYSCLK
#define RCC_CLOCKTYPE_SYSCLK
Definition: stm32f4xx_hal_rcc.h:206
RCC_PLLInitTypeDef::PLLState
uint32_t PLLState
Definition: stm32f4xx_hal_rcc_ex.h:65
RCC_ClkInitTypeDef::APB1CLKDivider
uint32_t APB1CLKDivider
Definition: stm32f4xx_hal_rcc.h:104
STM32_CORE_VERSION_MAJOR
#define STM32_CORE_VERSION_MAJOR
STM32 core version number.
Definition: stm32_def.h:7
RCC_CLOCKTYPE_HCLK
#define RCC_CLOCKTYPE_HCLK
Definition: stm32f4xx_hal_rcc.h:207
RCC_ClkInitTypeDef::AHBCLKDivider
uint32_t AHBCLKDivider
Definition: stm32f4xx_hal_rcc.h:101
RCC_OSCILLATORTYPE_HSE
#define RCC_OSCILLATORTYPE_HSE
Definition: stm32f4xx_hal_rcc.h:125
RCC_SYSCLK_DIV1
#define RCC_SYSCLK_DIV1
Definition: stm32f4xx_hal_rcc.h:243
RCC_OscInitTypeDef::LSIState
uint32_t LSIState
Definition: stm32f4xx_hal_rcc.h:84
RCC_ClkInitTypeDef::ClockType
uint32_t ClockType
Definition: stm32f4xx_hal_rcc.h:95
__HAL_RCC_PWR_CLK_ENABLE
#define __HAL_RCC_PWR_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:528
RCC_SYSCLKSOURCE_PLLCLK
#define RCC_SYSCLKSOURCE_PLLCLK
Definition: stm32f4xx_hal_rcc.h:221
HAL_RCC_ClockConfig
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
RCC_ClkInitTypeDef::APB2CLKDivider
uint32_t APB2CLKDivider
Definition: stm32f4xx_hal_rcc.h:107
RCC_OscInitTypeDef
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:67
PWR_REGULATOR_VOLTAGE_SCALE1
#define PWR_REGULATOR_VOLTAGE_SCALE1
Definition: stm32f4xx_hal_pwr_ex.h:90
RCC_PLLInitTypeDef::PLLN
uint32_t PLLN
Definition: stm32f4xx_hal_rcc_ex.h:74
Error_Handler
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057