RCC时钟代码详解<一步一注释>

void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Configure the main internal regulator output voltage
  */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-26 19:16:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-26 19:16:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-26 19:16:01       82 阅读
  4. Python语言-面向对象

    2024-03-26 19:16:01       91 阅读

热门阅读

  1. LEETCODE-DAY28

    2024-03-26 19:16:01       39 阅读
  2. 网络安全知识核心之RIP的工作原理

    2024-03-26 19:16:01       38 阅读
  3. Windows与Linux端口占用查看、杀死的方法

    2024-03-26 19:16:01       33 阅读
  4. # 15 React 使用useEffect获取网络数据

    2024-03-26 19:16:01       45 阅读
  5. C++中string容器的元素访问

    2024-03-26 19:16:01       44 阅读
  6. 6. C++ 内存分布

    2024-03-26 19:16:01       34 阅读
  7. 大数据中TopK问题

    2024-03-26 19:16:01       37 阅读
  8. vue中动态路由是什么该如何实现

    2024-03-26 19:16:01       43 阅读
  9. Dockerfile, nginx.conf文件解读

    2024-03-26 19:16:01       39 阅读