Пример #1
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /*!< At this stage the microcontroller clock setting is already configured, 
       this is done through SystemInit() function which is called from startup
       file (startup_stm32l1xx_xx.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32l1xx.c file
     */

  /* Initialize LEDs mounted on STM32L1XX-EVAL board */
  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);
  STM_EVAL_LEDInit(LED3);
  STM_EVAL_LEDInit(LED4);

  /* Configure PA0 in interrupt mode */
  EXTI0_Config();
  /* Configure (PE8 and PE9) or PG8 in interrupt mode */
  EXTI9_5_Config();
  /* Configure PE10 or (PG13 and PG11) in interrupt mode */
  EXTI15_10_Config();

  /* Generate software interrupt: simulate a falling edge applied on EXTI0 line */
  EXTI_GenerateSWInterrupt(EXTI_Line0);

  while (1)
  {
  }
}
Пример #2
0
/**
  * @brief  Description 外设初始化
  * @param  None
  * @retval None
  */
void PeripheralInit(void)
{
	RCC_Config();
	
	SysTick_Init();
	
    TIM2_Configuration();
    
	LED_GPIO_Config();
	KEY_GPIO_Config();
	EXTI15_10_Config();
	
	General_GPIO_Config();
	
	LCD_GLASS_Init();
	
	USART1_Config(115200);
    
//	Delay_ms(10);   //开启滴答定时
	LCD_GLASS_Clear();
	
	AVCC1_POWER(OFF);    //关ADC1电源
    BATTEST_POWER(OFF);  //关电池电压检测电源
	MODEL_PWRCTRL(ON);	//开对外接口电源
	ADC1_Init();
    
    /* 8M串行flash W25Q64初始化 */
	SPI_FLASH_Init();
	
	I2C_GPIO_Config();
    
    //rtc  初始化
    rtc_init();
    
    
}