当前位置: 首页>>代码示例>>C++>>正文


C++ FLASH_PrefetchBufferCmd函数代码示例

本文整理汇总了C++中FLASH_PrefetchBufferCmd函数的典型用法代码示例。如果您正苦于以下问题:C++ FLASH_PrefetchBufferCmd函数的具体用法?C++ FLASH_PrefetchBufferCmd怎么用?C++ FLASH_PrefetchBufferCmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FLASH_PrefetchBufferCmd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的FLASH_PrefetchBufferCmd函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。