/**
******************************************************************************
* @file stm32f4xx_rcc.c
* @author MCD Application Team
* @version V1.8.0
* @date 04-November-2016
* @brief This file provides firmware functions to manage the following
* functionalities of the Reset and clock control (RCC) peripheral:
* + Internal/external clocks, PLL, CSS and MCO configuration
* + System, AHB and APB busses clocks configuration
* + Peripheral clocks configuration
* + Interrupts and flags management
*
@verbatim
===============================================================================
##### RCC specific features #####
===============================================================================
[..]
After reset the device is running from Internal High Speed oscillator
(HSI 16MHz) with Flash 0 wait state, Flash prefetch buffer, D-Cache
and I-Cache are disabled, and all peripherals are off except internal
SRAM, Flash and JTAG.
(+) There is no prescaler on High speed (AHB) and Low speed (APB) busses;
all peripherals mapped on these busses are running at HSI speed.
(+) The clock for all peripherals is switched off, except the SRAM and FLASH.
(+) All GPIOs are in input floating state, except the JTAG pins which
are assigned to be used for debug purpose.
[..]
Once the device started from reset, the user application has to:
(+) Configure the clock source to be used to drive the System clock
(if the application needs higher frequency/performance)
(+) Configure the System clock frequency and Flash settings
(+) Configure the AHB and APB busses prescalers
(+) Enable the clock for the peripheral(s) to be used
(+) Configure the clock source(s) for peripherals which clocks are not
derived from the System clock (I2S, RTC, ADC, USB OTG FS/SDIO/RNG)
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_rcc.h"
/** @addtogroup STM32F4xx_StdPeriph_Driver
* @{
*/
/** @defgroup RCC
* @brief RCC driver modules
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* ------------ RCC registers bit address in the alias region ----------- */
#define RCC_OFFSET (RCC_BASE - PERIPH_BASE)
/* --- CR Register ---*/
/* Alias word address of HSION bit */
#define CR_OFFSET (RCC_OFFSET + 0x00)
#define HSION_BitNumber 0x00
#define CR_HSION_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (HSION_BitNumber * 4))
/* Alias word address of CSSON bit */
#define CSSON_BitNumber 0x13
#define CR_CSSON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (CSSON_BitNumber * 4))
/* Alias word address of PLLON bit */
#define PLLON_BitNumber 0x18
#define CR_PLLON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLON_BitNumber * 4))
/* Alias word address of PLLI2SON bit */
#define PLLI2SON_BitNumber 0x1A
#define CR_PLLI2SON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLI2SON_BitNumber * 4))
/* Alias word address of PLLSAION bit */
#define PLLSAION_BitNumber 0x1C
#define CR_PLLSAION_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLSAION_BitNumber * 4))
/* --- CFGR Register ---*/
/* Alias word address of I2SSRC bit */
#define CFGR_OFFSET (RCC_OFFSET + 0x08)
#define I2SSRC_BitNumber 0x17
#define CFGR_I2SSRC_BB (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (I2SSRC_BitNumber * 4))
/* --- BDCR Register ---*/
/* Alias word address of RTCEN bit */
#define BDCR_OFFSET (RCC_OFFSET + 0x70)
#define RTCEN_BitNumber 0x0F
#define BDCR_RTCEN_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (RTCEN_BitNumber * 4))
/* Alias word address of BDRST bit */
#define BDRST_BitNumber 0x10
#define BDCR_BDRST_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4))
/* --- CSR Register ---*/
/* Alias word address of LSION bit */
#define CSR_OFFSET (RCC_OFFSET + 0x74)
#define LSION_BitNumber 0x00
#define CSR_LSION_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (LSION_BitNumber * 4))
/* --- DCKCFGR Register ---*/
/* Alias word address of TIMPRE bit */
#define DCKCFGR_OFFSET (RCC_OFFSET + 0x8C)
#define TIMPRE_BitNumber 0x18
#define DCKCFGR_TIMPRE_BB (PERIPH_BB_BASE + (DCKCFGR_OFFSET * 32) + (TIMPRE_BitNumber * 4))
/* --- CFGR Register ---*/
#define RCC_CFGR_OFFSET (RCC_OFFSET + 0x08)
#if defined(STM32F410xx)
/* Alias word address of MCO1EN bit */
#define RCC_MCO1EN_BIT_NUMBER 0x8
#define RCC_CFGR_MCO1EN_BB (PERIPH_BB_BASE + (RCC_CFGR_OFFSET * 32) + (RCC_MCO1EN_BIT_NUMBER * 4))
/* Alias word address of MCO2EN bit */
#define RCC_MCO2EN_BIT_NUMBER 0x9
#define RCC_CFGR_MCO2EN_BB (PERIPH_BB_BASE + (RCC_CFGR_OFFSET * 32) + (RCC_MCO2EN_BIT_NUMBER * 4))
#endif /* STM32F410xx */
/* ---------------------- RCC registers bit mask ------------------------ */
/* CFGR register bit mask */
#define CFGR_MCO2_RESET_MASK ((uint32_t)0x07FFFFFF)
#define CFGR_MCO1_RESET_MASK ((uint32_t)0xF89FFFFF)
/* RCC Flag Mask */
#define FLAG_MASK ((uint8_t)0x1F)
/* CR register byte 3 (Bits[23:16]) base address */
#define CR_BYTE3_ADDRESS ((uint32_t)0x40023802)
/* CIR register byte 2 (Bits[15:8]) base address */
#define CIR_BYTE2_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x01))
/* CIR register byte 3 (Bits[23:16]) base address */
#define CIR_BYTE3_ADDRESS ((uint32_t)(RCC_BASE + 0x0C + 0x02))
/* BDCR register base address */
#define BDCR_ADDRESS (PERIPH_BASE + BDCR_OFFSET)
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup RCC_Private_Functions
* @{
*/
/** @defgroup RCC_Group1 Internal and external clocks, PLL, CSS and MCO configuration functions
* @brief Internal and external clocks, PLL, CSS and MCO configuration functions
*
@verbatim
===================================================================================
##### Internal and external clocks, PLL, CSS and MCO configuration functions #####
===================================================================================
[..]
This section provide functions allowing to configure the internal/exter
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
嵌入式优质项目,资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松copy复刻,拿到资料包后可轻松复现出一样的项目。 本人单片机开发经验充足,深耕嵌入式领域,有任何使用问题欢迎随时与我联系,我会及时为你解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明,项目具体内容可查看下方的资源详情。 【附带帮助】: 若还需要嵌入式物联网单片机相关领域开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步。 【本人专注嵌入式领域】: 有任何使用问题欢迎随时与我联系,我会及时解答,第一时间为你提供帮助,CSDN博客端可私信,为你解惑,欢迎交流。 【建议小白】: 在所有嵌入式开发中硬件部分若不会画PCB/电路,可选择根据引脚定义将其代替为面包板+杜邦线+外设模块的方式,只需轻松简单连线,下载源码烧录进去便可轻松复刻出一样的项目 【适合场景】: 相关项目设计中,皆可应用在项目开发、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面中 可借鉴此优质项目实现复刻,也可以基于此项目进行扩展来开发出更多功能
资源推荐
资源详情
资源评论
收起资源包目录
基于STM32设计的小车寻路系统.zip (毕设/课设/竞赛/实训/项目开发) (444个子文件)
project_car.uvguix.29102 90KB
project_car.axf 625KB
project_car.axf 323KB
stm32f4xx_rcc.c 134KB
stm32f4xx_tim.c 122KB
stm32f4xx_rtc.c 101KB
stm32f4xx_dfsdm.c 85KB
stm32f4xx_adc.c 67KB
stm32f4xx_can.c 65KB
stm32f4xx_flash.c 62KB
stm32f4xx_fmc.c 61KB
stm32f4xx_dsi.c 61KB
system_stm32f4xx.c 60KB
stm32f4xx_cryp_aes.c 57KB
stm32f4xx_fmpi2c.c 57KB
stm32f4xx_usart.c 57KB
stm32f4xx_i2c.c 53KB
stm32f4xx_dma.c 52KB
stm32f4xx_spi.c 52KB
stm32f4xx_sai.c 48KB
stm32f4xx_fsmc.c 45KB
stm32f4xx_pwr.c 42KB
stm32f4xx_ltdc.c 39KB
stm32f4xx_sdio.c 38KB
stm32f4xx_cryp.c 35KB
stm32f4xx_lptim.c 34KB
stm32f4xx_qspi.c 32KB
stm32f4xx_dma2d.c 27KB
stm32f4xx_dac.c 26KB
stm32f4xx_hash.c 26KB
stm32f4xx_gpio.c 25KB
stm32f4xx_cec.c 24KB
stm32f4xx_dcmi.c 18KB
stm32f4xx_spdifrx.c 17KB
stm32f4xx_syscfg.c 17KB
stm32f4xx_rng.c 14KB
misc.c 11KB
stm32f4xx_cryp_tdes.c 11KB
stm32f4xx_wwdg.c 10KB
stm32f4xx_cryp_des.c 10KB
stm32f4xx_exti.c 10KB
stm32f4xx_hash_sha1.c 10KB
stm32f4xx_hash_md5.c 9KB
stm32f4xx_iwdg.c 9KB
stm32f4xx_dbgmcu.c 7KB
stm32f4xx_flash_ramfunc.c 5KB
stm32f4xx_it.c 4KB
exti_key.c 4KB
stm32f4xx_crc.c 4KB
exti_key copy.c 3KB
car.c 3KB
usart_PC.c 3KB
bluetooth.c 3KB
motor.c 2KB
led.c 2KB
motor copy.c 2KB
main.c 1KB
infrared.c 1KB
key.c 998B
beep.c 624B
stm32f4xx_tim.crf 454KB
stm32f4xx_tim.crf 454KB
stm32f4xx_rtc.crf 451KB
stm32f4xx_rtc.crf 451KB
stm32f4xx_ltdc.crf 449KB
stm32f4xx_ltdc.crf 449KB
stm32f4xx_cryp_aes.crf 447KB
stm32f4xx_cryp_aes.crf 447KB
stm32f4xx_sai.crf 446KB
stm32f4xx_sai.crf 446KB
stm32f4xx_rcc.crf 444KB
stm32f4xx_rcc.crf 444KB
stm32f4xx_dma2d.crf 444KB
stm32f4xx_dma2d.crf 444KB
stm32f4xx_can.crf 443KB
stm32f4xx_can.crf 443KB
stm32f4xx_fsmc.crf 441KB
stm32f4xx_fsmc.crf 441KB
stm32f4xx_adc.crf 441KB
stm32f4xx_adc.crf 441KB
stm32f4xx_flash.crf 441KB
stm32f4xx_flash.crf 441KB
stm32f4xx_dma.crf 440KB
stm32f4xx_dma.crf 440KB
stm32f4xx_i2c.crf 439KB
stm32f4xx_i2c.crf 439KB
main.crf 439KB
stm32f4xx_cryp.crf 439KB
stm32f4xx_cryp.crf 439KB
stm32f4xx_usart.crf 439KB
stm32f4xx_usart.crf 439KB
stm32f4xx_spi.crf 439KB
stm32f4xx_spi.crf 439KB
stm32f4xx_sdio.crf 438KB
stm32f4xx_sdio.crf 438KB
stm32f4xx_dac.crf 437KB
stm32f4xx_dac.crf 437KB
stm32f4xx_pwr.crf 436KB
stm32f4xx_pwr.crf 436KB
stm32f4xx_hash.crf 436KB
共 444 条
- 1
- 2
- 3
- 4
- 5
资源评论
阿齐Archie
- 粉丝: 1w+
- 资源: 2303
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- gzip-1.12-3.1.x86-64.rpm
- student_manager.py
- stomp.js用于uniapp实现socket连接
- 网络安全相关的RSS订阅列表,这个项目记录了个人订阅的一些Hackers的博客地址,一些安全团队的博客,一些国外著名的安全新闻平
- SQLDumpSplitter3.rar
- java文字转语音示例
- (2024.3.19版本)最新全国三级(省-市-区县)行政区划表
- about edge deteetcionabout edge deteetcion
- about edge deteetcionabout edge deteetcion
- 基于java springboot高校工作室管理系统毕业设计源码+数据库,送文档
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功