/**
******************************************************************************
* @file system_stm32f1xx.c
* @author MCD Application Team
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
*
* 1. This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
* factors, AHB/APBx prescalers and Flash settings).
* This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the "startup_stm32f1xx_xx.s" file.
*
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
* by the user application to setup the SysTick
* timer or configure other parameters.
*
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
*
* 2. After each device reset the HSI (8 MHz) is used as system clock source.
* Then SystemInit() function is called, in "startup_stm32f1xx_xx.s" file, to
* configure the system clock before to branch to main program.
*
* 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depending on
* the product used), refer to "HSE_VALUE".
* When HSE is used as system clock source, directly or through PLL, and you
* are using different crystal you have to adapt the HSE value to your own
* configuration.
*
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup stm32f1xx_system
* @{
*/
/** @addtogroup STM32F1xx_System_Private_Includes
* @{
*/
#include "stm32f1xx.h"
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_TypesDefinitions
* @{
*/
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_Defines
* @{
*/
#if !defined (HSE_VALUE)
#define HSE_VALUE 8000000U /*!< Default value of the External oscillator in Hz.
This value can be provided and adapted by the user application. */
#endif /* HSE_VALUE */
#if !defined (HSI_VALUE)
#define HSI_VALUE 8000000U /*!< Default value of the Internal oscillator in Hz.
This value can be provided and adapted by the user application. */
#endif /* HSI_VALUE */
/*!< Uncomment the following line if you need to use external SRAM */
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
/* #define DATA_IN_ExtSRAM */
#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
/* Note: Following vector table addresses must be defined in line with linker
configuration. */
/*!< Uncomment the following line if you need to relocate the vector table
anywhere in Flash or Sram, else the vector table is kept at the automatic
remap of boot address selected */
/* #define USER_VECT_TAB_ADDRESS */
#if defined(USER_VECT_TAB_ADDRESS)
/*!< Uncomment the following line if you need to relocate your vector Table
in Sram else user remap will be done in Flash. */
/* #define VECT_TAB_SRAM */
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#endif /* VECT_TAB_SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/******************************************************************************/
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_Macros
* @{
*/
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_Variables
* @{
*/
/* This variable is updated in three ways:
1) by calling CMSIS function SystemCoreClockUpdate()
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
Note: If you use this function to configure the system clock; then there
is no need to call the 2 first functions listed above, since SystemCoreClock
variable is updated automatically.
*/
uint32_t SystemCoreClock = 16000000;
const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_FunctionPrototypes
* @{
*/
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
#ifdef DATA_IN_ExtSRAM
static void SystemInit_ExtMemCtl(void);
#endif /* DATA_IN_ExtSRAM */
#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
/**
* @}
*/
/** @addtogroup STM32F1xx_System_Private_Functions
* @{
*/
/**
* @brief Setup the microcontroller system
* Initialize the Embedded Flash Interface, the PLL and update the
* SystemCoreClock variable.
* @note This function should be used only after reset.
* @param None
* @retval None
*/
void SystemInit (void)
{
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
#ifdef DATA_IN_ExtSRAM
SystemInit_ExtMemCtl();
#endif /* DATA_IN_ExtSRAM */
#endif
/* Configure the Vector Table location -------------------------------------*/
#if defined(USER_VECT_TAB_ADDRESS)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
#endif /* USER_VECT_TAB_ADDRESS */
}
/**
* @brief Update SystemCoreClock variable according to Clock Register Values.
* The SystemCoreClock variable contains the core clock (HCLK), it can
* be used by the user application to setup the SysTick timer or configure
* other parameters.
*
* @note Each time the core clock (HCLK) changes, this function must be called
* to update SystemCoreClock variable value. Otherwise, any configuration
* based on this variable will be incorrect.
*
* @note - The system frequency computed by this function is not the real
* frequency in the chip. It is calculated based on the predefined
* constant and the selected clock source:
*
*
没有合适的资源?快使用搜索试试~ 我知道了~
646987170863294IICOLED_alarm.zip
共192个文件
o:49个
d:49个
crf:47个
需积分: 0 0 下载量 182 浏览量
2023-10-29
17:19:43
上传
评论
收藏 13.74MB ZIP 举报
温馨提示
646987170863294IICOLED_alarm.zip
资源推荐
资源详情
资源评论
收起资源包目录
646987170863294IICOLED_alarm.zip (192个子文件)
IICOLED_alarm.uvguix.Administrator 88KB
IICOLED.axf 570KB
IICOLED.axf 560KB
system_stm32f1xx.c 15KB
main.c 13KB
oled.c 12KB
dht11.c 7KB
stm32f1xx_it.c 6KB
tim.c 6KB
DS1302.c 4KB
keyno.c 4KB
stm32f1xx_hal_msp.c 2KB
gpio.c 2KB
Buzzer.c 825B
stm32f1xx_hal_tim.crf 598KB
stm32f1xx_hal_tim.crf 598KB
stm32f1xx_hal_tim_ex.crf 562KB
stm32f1xx_hal_tim_ex.crf 562KB
oled.crf 550KB
main.crf 549KB
stm32f1xx_hal_rcc.crf 548KB
stm32f1xx_hal_rcc.crf 548KB
main.crf 547KB
oled.crf 547KB
stm32f1xx_hal_dma.crf 544KB
stm32f1xx_hal_dma.crf 544KB
stm32f1xx_hal_flash_ex.crf 542KB
stm32f1xx_hal_flash_ex.crf 542KB
ds1302.crf 542KB
ds1302.crf 542KB
stm32f1xx_hal_flash.crf 541KB
stm32f1xx_hal_flash.crf 541KB
dht11.crf 541KB
dht11.crf 541KB
tim.crf 540KB
tim.crf 540KB
stm32f1xx_hal_gpio.crf 540KB
stm32f1xx_hal_gpio.crf 540KB
keyno.crf 540KB
keyno.crf 540KB
stm32f1xx_hal_exti.crf 539KB
stm32f1xx_hal_exti.crf 539KB
stm32f1xx_hal_pwr.crf 539KB
stm32f1xx_hal_pwr.crf 539KB
stm32f1xx_hal_rcc_ex.crf 539KB
stm32f1xx_hal_rcc_ex.crf 539KB
stm32f1xx_hal.crf 538KB
stm32f1xx_hal.crf 538KB
stm32f1xx_hal_cortex.crf 537KB
stm32f1xx_hal_cortex.crf 537KB
buzzer.crf 537KB
stm32f1xx_it.crf 537KB
stm32f1xx_it.crf 537KB
stm32f1xx_hal_msp.crf 537KB
stm32f1xx_hal_msp.crf 537KB
system_stm32f1xx.crf 537KB
system_stm32f1xx.crf 537KB
gpio.crf 537KB
gpio.crf 537KB
stm32f1xx_hal_gpio_ex.crf 536KB
stm32f1xx_hal_gpio_ex.crf 536KB
stm32f1xx_hal_flash_ex.d 3KB
stm32f1xx_hal_flash_ex.d 3KB
stm32f1xx_hal_gpio_ex.d 3KB
stm32f1xx_hal_gpio_ex.d 3KB
stm32f1xx_hal_cortex.d 3KB
stm32f1xx_hal_rcc_ex.d 3KB
stm32f1xx_hal_tim_ex.d 3KB
stm32f1xx_hal_cortex.d 3KB
stm32f1xx_hal_rcc_ex.d 3KB
stm32f1xx_hal_tim_ex.d 3KB
stm32f1xx_hal_flash.d 3KB
stm32f1xx_hal_flash.d 3KB
stm32f1xx_hal_exti.d 3KB
stm32f1xx_hal_gpio.d 3KB
stm32f1xx_hal_exti.d 3KB
stm32f1xx_hal_gpio.d 3KB
stm32f1xx_hal_tim.d 3KB
stm32f1xx_hal_pwr.d 3KB
stm32f1xx_hal_rcc.d 3KB
stm32f1xx_hal_dma.d 3KB
stm32f1xx_hal_tim.d 3KB
stm32f1xx_hal_pwr.d 3KB
stm32f1xx_hal_rcc.d 3KB
stm32f1xx_hal_dma.d 3KB
stm32f1xx_hal_msp.d 3KB
stm32f1xx_hal_msp.d 3KB
main.d 3KB
main.d 3KB
system_stm32f1xx.d 3KB
system_stm32f1xx.d 3KB
stm32f1xx_hal.d 3KB
stm32f1xx_hal.d 3KB
stm32f1xx_it.d 3KB
stm32f1xx_it.d 3KB
oled.d 3KB
ds1302.d 3KB
ds1302.d 3KB
dht11.d 3KB
dht11.d 3KB
共 192 条
- 1
- 2
资源评论
2301_80246833
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功