本文整理汇总了C++中FLASH_PrefetchBufferCmd函数的典型用法代码示例。如果您正苦于以下问题:C++ FLASH_PrefetchBufferCmd函数的具体用法?C++ FLASH_PrefetchBufferCmd怎么用?C++ FLASH_PrefetchBufferCmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLASH_PrefetchBufferCmd函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: RCC_Configuration
/*******************************************************************************
* Function Name : RCC_Configuration
* Description : Configures the different system clocks.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void RCC_Configuration(void)
{
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
/* Enable peripheral clocks --------------------------------------------------*/
/* DMA clock enable */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA2, ENABLE);
/* GPIOA Periph clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
/* DAC Periph clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
/* TIM6 Periph clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM6, ENABLE);
}
开发者ID:zaurus04,项目名称:cortexm3,代码行数:65,代码来源:main.c
示例2: RCC_Configuration
/**
* @brief Configures the different system clocks.
* @param None
* @retval : None
*/
void RCC_Configuration(void)
{
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/4 */
RCC_PCLK1Config(RCC_HCLK_Div16);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08)
{}
}
/* TIM4 clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
/* GPIOA and GPIOB clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
if (SysTick_Config(72000000 / 1000))
{
/* Capture error */
while (1);
}
}
开发者ID:20062230102,项目名称:PWM,代码行数:63,代码来源:main.c
示例3: SetSysClockTo72
/***************************************************************************//**
* @brief Sets System clock frequency to 72MHz and configure HCLK, PCLK2 and PCLK1 prescalers.
******************************************************************************/
void SetSysClockTo72(void)
{
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig( RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd( FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency( FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig( RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config( RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config( RCC_HCLK_Div2);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(0x00010000, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd( ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig( RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08)
{
}
}
else
{ /* If HSE fails to start-up, the application will have wrong clock configuration.
User can add here some code to deal with this error */
/* Go to infinite loop */
while (1)
{
}
}
}
开发者ID:pedrominatel,项目名称:embedded,代码行数:61,代码来源:RCC.c
示例4: RCC_Configuration
/*******************************************************************************
* Function Name : RCC_Configuration
* Description : Configures the different system clocks.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void RCC_Configuration(void)
{
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
/* Enable GPIOx clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOx, ENABLE);
/* Enable USARTx clocks */
#ifdef USE_USART1
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
#else
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USARTx, ENABLE);
#endif
}
开发者ID:zaurus04,项目名称:cortexm3,代码行数:65,代码来源:main.c
示例5: SetHSICLKToMSI
/**
* @brief To select MSI as System clock source
* @caller ADC_Icc_Test
* @param Frequence, DIV by 2 ot not , With or without RTC
* @retval None
*/
void SetHSICLKToMSI(uint32_t freq,bool div2,bool With_RTC)
{
/* RCC system reset */
RCC_DeInit();
/* Flash 1 wait state */
FLASH_SetLatency(FLASH_Latency_0);
/* Disable Prefetch Buffer */
FLASH_PrefetchBufferCmd(DISABLE);
/* Disable 64-bit access */
FLASH_ReadAccess64Cmd(DISABLE);
/* Disable FLASH during SLeep */
FLASH_SLEEPPowerDownCmd(ENABLE);
/* Enable the PWR APB1 Clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Select the Voltage Range 3 (1.2V) */
PWR_VoltageScalingConfig(PWR_VoltageScaling_Range3);
/* Wait Until the Voltage Regulator is ready */
while (PWR_GetFlagStatus(PWR_FLAG_VOS) != RESET)
{}
/* To configure the MSI frequency */
RCC_MSIRangeConfig(freq);
/* Select MSI as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_MSI);
/* Wait till MSI is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x00)
{}
if (div2)
{
RCC_HCLKConfig(RCC_SYSCLK_Div2);
}
RCC_HSICmd(DISABLE);
/* Disable HSE clock */
RCC_HSEConfig(RCC_HSE_OFF);
/* Disable LSE clock */
if (! With_RTC)
RCC_LSEConfig(RCC_LSE_OFF);
/* Disable LSI clock */
RCC_LSICmd(DISABLE);
}
开发者ID:nullsub,项目名称:stm32l-democode,代码行数:62,代码来源:icc_measure.c
示例6: PreSetupHardware
static void PreSetupHardware(void) {
extern unsigned int *__Vectors;
ErrorStatus HSEStartUpStatus;
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus == SUCCESS) {
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08) {}
}
/* Enable FSMC, GPIOD, GPIOE, GPIOF, GPIOG and AFIO clocks */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |
RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD |
RCC_APB2Periph_GPIOE | RCC_APB2Periph_GPIOF |
RCC_APB2Periph_GPIOG | RCC_APB2Periph_AFIO |
RCC_APB2Periph_USART1 | RCC_APB2Periph_SPI1
, ENABLE);
/* Enable peripheral clocks --------------------------------------------------*/
/* Enable DMA1 clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
/* Enable USART2 clock */
/* Enable UART4 clock */
/* TIM2 clock enable */
/* TIM3 clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3 | RCC_APB1Periph_PWR |
RCC_APB1Periph_BKP | RCC_APB1Periph_TIM2 |
RCC_APB1Periph_USART2 | RCC_APB1Periph_USART3 |
RCC_APB1Periph_UART4, ENABLE);
NVIC_SetVectorTable((unsigned int)&__Vectors, 0x0);
}
开发者ID:masuchen,项目名称:stm32_led,代码行数:56,代码来源:main.c
示例7: rcc_init
/*==================================================================================
* 函 数 名: rcc_init
* 参 数: None
* 功能描述: rcc初始化
* 返 回 值: None
* 备 注: 初始化系统时钟,需要注意stm32f10x.h中对系统时钟的定义
* 作 者: gaodb
* 创建时间: 2012.10
==================================================================================*/
static void rcc_init(void)
{
ErrorStatus HSEStartUpStatus;
RCC_DeInit();
wait_sys_peri_ready();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
RCC_HSEConfig(RCC_HSE_Bypass);//外部晶振为24M有源晶振
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus == SUCCESS)
{
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
FLASH_SetLatency(FLASH_Latency_2);
RCC_HCLKConfig(RCC_SYSCLK_Div1);
RCC_PCLK1Config(RCC_HCLK_Div2);//低速时钟最高36M
RCC_PCLK2Config(RCC_HCLK_Div1);
RCC_ADCCLKConfig(RCC_PCLK2_Div6);
/* PLLCLK = 24MHz * 3 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_3);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08)
{}
}
RCC_ClockSecuritySystemCmd(ENABLE); //Enable CSSON(Clock securuty system)
/* Enable the LSI OSC */
RCC_LSICmd(ENABLE); //为独立看门狗提供时钟
/* Wait till LSI is ready */
while (RCC_GetFlagStatus(RCC_FLAG_LSIRDY) == RESET)
{}
}
开发者ID:gaodebang,项目名称:stm32f103-eval,代码行数:64,代码来源:sys_peripheral.c
示例8: RCC_Configuration
/*******************************************************************************
* ����RCC
*******************************************************************************/
void RCC_Configuration(void)
{
//��λRCC�ⲿ�豸�Ĵ�����Ĭ��ֵ
RCC_DeInit(); //��RRC�Ĵ�����Ϊȱʡֵ
//�����ⲿ���پ���
RCC_HSEConfig(RCC_HSE_ON);
//�ȴ��ⲿ����ʱ������
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS) //�ⲿ����ʱ���Ѿ�����
{
//����FLASH��Ԥȡ����
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
//FLASH�ӳ�2������
FLASH_SetLatency(FLASH_Latency_2);
//����AHB(HCLK)ʱ��=SYSCLK
RCC_HCLKConfig(RCC_SYSCLK_Div1);
//����APB2(PCLK2)��=AHBʱ��
RCC_PCLK2Config(RCC_HCLK_Div1);
//����APB1(PCLK1)��=AHB 1/2ʱ��
RCC_PCLK1Config(RCC_HCLK_Div2);
//����PLLʱ�� == �ⲿ���پ���ʱ��*9 PLLCLK = 8MHz * 9 = 72 MHz
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
//ʹ��PLLʱ��
RCC_PLLCmd(ENABLE);
//�ȴ�PLLʱ�Ӿ���
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
//����ϵͳʱ�� = PLLʱ��
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
//����PLLʱ���Ƿ���Ϊϵͳʱ��
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
//����GPIOʱ��
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOx, ENABLE);
//��������ʱ��
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
}
开发者ID:zhongjixiuxing,项目名称:stm32f103-iap-bootload,代码行数:57,代码来源:main.c
示例9: RCC_Configuration
void RCC_Configuration(void)
{
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2); // 36MZH
/* On STICE the PLL output clock is fixed to 48 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP |
RCC_APB1Periph_TIM2, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIO_DISCONNECT |
RCC_APB2Periph_SPI1 | RCC_APB2Periph_GPIOB, ENABLE);
}
开发者ID:MaxStudio,项目名称:USB_HID_CODE,代码行数:54,代码来源:hw_config.c
示例10: RCC_Configuration
/*******************************************************************************
* 配置RCC
*******************************************************************************/
void RCC_Configuration(void)
{
//复位RCC外部设备寄存器到默认值
RCC_DeInit(); //将RRC寄存器设为缺省值
//打开外部高速晶振
RCC_HSEConfig(RCC_HSE_ON);
//等待外部高速时钟准备好
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS) //外部高速时钟已经准别好
{
//开启FLASH的预取功能
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
//FLASH延迟2个周期
FLASH_SetLatency(FLASH_Latency_2);
//配置AHB(HCLK)时钟=SYSCLK
RCC_HCLKConfig(RCC_SYSCLK_Div1);
//配置APB2(PCLK2)钟=AHB时钟
RCC_PCLK2Config(RCC_HCLK_Div1);
//配置APB1(PCLK1)钟=AHB 1/2时钟
RCC_PCLK1Config(RCC_HCLK_Div2);
//配置PLL时钟 == 外部高速晶体时钟*9 PLLCLK = 8MHz * 9 = 72 MHz
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
//使能PLL时钟
RCC_PLLCmd(ENABLE);
//等待PLL时钟就绪
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
//配置系统时钟 = PLL时钟
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
//检查PLL时钟是否作为系统时钟
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
//开启GPIO时钟
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOx, ENABLE);
//开启串口时钟
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
}
开发者ID:zhongjixiuxing,项目名称:STM32F103,代码行数:57,代码来源:main.c
示例11: initPowerSubsystem
void initPowerSubsystem() {
RCC_MSIRangeConfig(RCC_MSIRange_4);
new_power_state = POWER_STATE_MED_SPEED;
currentCPU_HZ = powerStateClockFrequency(new_power_state);
SysTick_Config(powerStateClockFrequency(new_power_state) / configTICK_RATE_HZ);
current_power_state = new_power_state;
PWR_VoltageScalingConfig(PWR_VoltageScaling_Range3);
FLASH_SetLatency(FLASH_Latency_0);
FLASH_PrefetchBufferCmd(DISABLE);
FLASH_ReadAccess64Cmd(DISABLE);
}
开发者ID:dlebed,项目名称:stm32l_freertos_ir_thermo,代码行数:11,代码来源:power.c
示例12: SetSysClock72
void SetSysClock72(void)
{
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus != SUCCESS)
{
ErrorLoop();
};
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div2, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
}
开发者ID:hollylxj,项目名称:Lab4,代码行数:53,代码来源:v9v1.c
示例13: System_ClockConfig
/**
* @fn void System_ClockConfig(void)
* @brief
* @li 시스템 클럭을 설정한다.
* @remarks
* @param void
* @return void
*/
void System_ClockConfig(void)
{
__IO ErrorStatus HSEStartUpStatus = SUCCESS;
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* AHB 클럭설정 : HCLK = SYSCLK = 72MHz */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* APB2( high-speed ) 클럭 설정 PCLK2 = HCLK = 72MHz */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* APB1 (low-speed) 클럭 설정 PCLK1 = HCLK/2 = 36MHz */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* PLL 설정 : PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
}
开发者ID:ajugurikang,项目名称:cortex_class_ref,代码行数:60,代码来源:system.c
示例14: ClkSwitch2HseSystemInit
void ClkSwitch2HseSystemInit (void)
{
ErrorStatus HSEStartUpStatus;
/* RCC system reset(for debug purpose) */
RCC_DeInit();
RCC_HSICmd(DISABLE); //Turn of the internal RC;
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* PLLCLK = 10MHz * 7 = 70 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_7);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
}
开发者ID:Ryoma521,项目名称:CHLMPZ103,代码行数:51,代码来源:timeapp.c
示例15: PIOS_Board_Init
void PIOS_Board_Init(void) {
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* Delay system */
PIOS_DELAY_Init();
/* Initialize the PiOS library */
PIOS_GPIO_Init();
}
开发者ID:LeeSaferite,项目名称:OpenPilot,代码行数:14,代码来源:pios_board.c
示例16: RCC_Configuration
/*****************************************************************************
* Function Name : RCC_Configuration
* Description : Reset and Clock Control configuration
* Input : None
* Output : None
* Return : None
******************************************************************************/
void RCC_Configuration(void)
{
ErrorStatus HSEStartUpStatus;
/* Reset the RCC clock configuration to default reset state */
RCC_DeInit();
/* Configure the High Speed External oscillator */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait for HSE start-up */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Set the code latency value: FLASH Two Latency cycles */
FLASH_SetLatency(FLASH_Latency_2);
/* Configure the AHB clock(HCLK): HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* Configure the High Speed APB2 clcok(PCLK2): PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* Configure the Low Speed APB1 clock(PCLK1): PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* Configure the PLL clock source and multiplication factor */
/* PLLCLK = HSE*PLLMul = 8*9 = 72MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Check whether the specified RCC flag is set or not */
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Get System Clock Source */
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08);
}
}
开发者ID:Tonio5978,项目名称:stm32-codes,代码行数:56,代码来源:rcc.c
示例17: SysClkSetHSI_4xPLLMul
void SysClkSetHSI_4xPLLMul (uint32_t PLLMul ) {
if (PLLMul > RCC_PLLMul_12) {
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
// Flash 2 wait state for freq > 4x12 48MHz
FLASH_SetLatency(FLASH_Latency_2);
}
else if (PLLMul > RCC_PLLMul_6) {
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
// Flash 1 wait state for freq > 4x6 24MHz
FLASH_SetLatency(FLASH_Latency_1);
}
// PLL provides frequency multiplier of (HSI/2) i.e. 4MHz x ...
RCC_PLLConfig(RCC_PLLSource_HSI_Div2, PLLMul);
// Enable PLL
RCC_PLLCmd(ENABLE);
// Wait till PLL is ready
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
// Select PLL as system clock source
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
// Wait till PLL is used as system clock source
while (RCC_GetSYSCLKSource() != 0x08);
// AHB, AP2 and AP1 clock are necessary for the peripherals to function
// HCLK for AHB = SYSCLK (max is SYSCLK, up to 72MHz)
RCC_HCLKConfig(RCC_SYSCLK_Div1);
// PCLK2 for APB2 = HCLK (max is SYSCLK, up to 72MHz)
RCC_PCLK2Config(RCC_HCLK_Div1);
if (PLLMul > RCC_PLLMul_9) {
// PCLK1 for APB1 = HCLK/2 (> 4x9MHz max of 36MHz, use slower clock)
RCC_PCLK1Config(RCC_HCLK_Div2);
}
else {
// PCLK1 for APB1 = HCLK (HCLK <= 36MHz)
RCC_PCLK1Config(RCC_HCLK_Div1);
}
RCC_GetClocksFreq(&ClksFreq); // update SYSCLK, HCLK, PCLK1 and PCLK2 in ClksFreq
}
开发者ID:CalcHack,项目名称:firmware,代码行数:36,代码来源:main.cpp
示例18: PIOS_Board_Init
void PIOS_Board_Init(void) {
if (board_init_complete) {
return;
}
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* Delay system */
PIOS_DELAY_Init();
/* Initialize the PiOS library */
PIOS_GPIO_Init();
#if defined(PIOS_INCLUDE_LED)
PIOS_LED_Init(&pios_led_cfg);
#endif /* PIOS_INCLUDE_LED */
#if defined(PIOS_INCLUDE_USB)
/* Initialize board specific USB data */
PIOS_USB_BOARD_DATA_Init();
/* Activate the HID-only USB configuration */
PIOS_USB_DESC_HID_ONLY_Init();
uint32_t pios_usb_id;
if (PIOS_USB_Init(&pios_usb_id, &pios_usb_main_cfg)) {
PIOS_Assert(0);
}
#if defined(PIOS_INCLUDE_USB_HID) && defined(PIOS_INCLUDE_COM_MSG)
uint32_t pios_usb_hid_id;
if (PIOS_USB_HID_Init(&pios_usb_hid_id, &pios_usb_hid_cfg, pios_usb_id)) {
PIOS_Assert(0);
}
if (PIOS_COM_MSG_Init(&pios_com_telem_usb_id, &pios_usb_hid_com_driver, pios_usb_hid_id)) {
PIOS_Assert(0);
}
#endif /* PIOS_INCLUDE_USB_HID && PIOS_INCLUDE_COM_MSG */
#endif /* PIOS_INCLUDE_USB */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);//TODO Tirar
board_init_complete = true;
}
开发者ID:Crash1,项目名称:TauLabs,代码行数:48,代码来源:pios_board.c
示例19: SetSysClockToHSE
/***************************************************************************//**
* @brief Selects HSE as System clock source and configure HCLK, PCLK2 and PCLK1 prescalers.
******************************************************************************/
void SetSysClockToHSE(void)
{
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig( RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if (HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 0 wait state */
FLASH_SetLatency( FLASH_Latency_0);
/* HCLK = SYSCLK */
RCC_HCLKConfig( RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config( RCC_HCLK_Div1);
/* PCLK1 = HCLK */
RCC_PCLK1Config(RCC_HCLK_Div1);
/* Select HSE as system clock source */
RCC_SYSCLKConfig( RCC_SYSCLKSource_HSE);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x04)
{
}
}
else
{ /* If HSE fails to start-up, the application will have wrong clock configuration.
User can add here some code to deal with this error */
/* Go to infinite loop */
while (1)
{
}
}
}
开发者ID:pedrominatel,项目名称:embedded,代码行数:50,代码来源:RCC.c
示例20: main
/**
* @brief Bootloader Main function
*/
int main() {
uint8_t GO_dfu = false;
/* Brings up System using CMSIS functions, enables the LEDs. */
PIOS_SYS_Init();
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
/* Delay system */
PIOS_DELAY_Init();
for (uint32_t t = 0; t < 10000000; ++t) {
if (NSS_HOLD_STATE == 1)
GO_dfu = TRUE;
else {
GO_dfu = FALSE;
break;
}
}
//while(TRUE)
// {
// PIOS_LED_Toggle(LED1);
// PIOS_DELAY_WaitmS(1000);
// }
//GO_dfu = TRUE;
PIOS_IAP_Init();
GO_dfu = GO_dfu | PIOS_IAP_CheckRequest();// OR with app boot request
if (GO_dfu == FALSE) {
jump_to_app();
}
if (PIOS_IAP_CheckRequest()) {
PIOS_DELAY_WaitmS(1000);
PIOS_IAP_ClearRequest();
}
PIOS_Board_Init();
boot_status = idle;
Fw_crc = PIOS_BL_HELPER_CRC_Memory_Calc();
PIOS_LED_On(LED1);
while (1) {
process_spi_request();
}
return 0;
}
开发者ID:LeeSaferite,项目名称:OpenPilot,代码行数:49,代码来源:main.c
注:本文中的FLASH_PrefetchBufferCmd函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论