Ejemplo n.º 1
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
    CMP_InitPara CMP_InitParaStruct;
    /* Configurate RCC */
    RCC_Configuration();
    /* Configurate GPIOA*/
    GPIO_Configuration();
    GD_EVAL_LEDInit(LED3);
    /* Initialize CMP1 */
    CMP_ParaInit(&CMP_InitParaStruct);
    CMP_InitParaStruct.CMP_InvertingInput = CMP_INVERTINGINPUT_1_4VREFINT;
    CMP_InitParaStruct.CMP_Output = CMP_OUTPUT_TIM2IC4;
    CMP_InitParaStruct.CMP_OutputPolarity = CMP_OUTPUTPOLARITY_NONINVERTED;
    CMP_InitParaStruct.CMP_Hysteresis = CMP_HYSTERESIS_NO;
    CMP_InitParaStruct.CMP_OperatingMode = CMP_OPERATINGMODE_VERYLOWSPEED;
    CMP_Init(CMP_CHANNEL_CMP1, &CMP_InitParaStruct);

    /* Configurate Timer2 and Interrupt */
    TIMER_Configuration();

    /* Enable CMP1 and Trigger Timer2 input capture */
    CMP_Enable(CMP_CHANNEL_CMP1, ENABLE);

    while(1);
}
Ejemplo n.º 2
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main()
{
    RCC_Configuration();
    GPIO_Configuration();
    GD_EVAL_LEDInit(LED1);
    SysTick_Configuration();
    TIMER_Configuration();

    while(1)
    {
        GD_EVAL_LEDOn(LED1);
        Delay_1ms(1000);
        GD_EVAL_LEDOff(LED1);
        Delay_1ms(1000);
    }
}
/********************************************************************************
	* sampleAcquisitionInit
	*
	*      Init the sampling routine.
	*				Blocking function.
	* 			
	* @param Void
	* @return 0 if working
	*******************************************************************************/
void sampleAcquisitionInit( void )
{
	/*****************
	 * SYSTEM CLOCKS *
	 *****************/
	
	RCC_Configuration();
	
	/********
	 * GPIO *
	 ********/

	GPIO_Configuration();
	
	/*******
	 * DMA *
	 *******/

	DMA_Configuration();
	
	/*******
	 * ADC *
	 *******/
	
	ADC_Configuration();

	/*********
	 * TIMER *
	 *********/
	
	TIMER_Configuration();
	
	/********
	 * NVIC *
	 ********/
	
	IT_Configuration();
	
	/*********
	 * START *
	 *********/

}
Ejemplo n.º 4
0
/*******************************
**函数名:ChipHalInit()
**功能:片内硬件初始化
*******************************/
void  ChipHalInit(void)
{
	//初始化时钟源
	RCC_Configuration();
	
	//初始化GPIO
	GPIO_Configuration();
	//初始化串口
	USART_Configuration();
	init_printf(printf_buf,uart1_putc);
	tfp_printf("tfp_printf Inital over\n");

	TIMER_Configuration();

	//初始化中断,在ucos启动后执行,其中包含两步,1,分配中断优先级,2,使能中断
	//NVIC_Configuration();

//	OLED_Configuration();
}
Ejemplo n.º 5
0
void Task1(void *Id)
{
	uint8_t  n = 0 ; 
	(void) Id;		
	SysTick_Config(120000);	 
//	CPU_IntEn();  
	n = KeyScan();			 	
 	DspRst(); 
				

//	CheckLight();	
//	OSTimeDly(250);
															    
	ConfigBCK(); 

 	InitStart();

	GR_DBG_PRINTF("Variable System length %d ",sizeof(System) ); 
	
	TIMER_Configuration(); 
	TIMER1_Configuration();
   	System.Usb.OldUsbStatu = USB_STATUS ;	   
	switch(n)
	{
		case 1 :  TESTA(); 	  break ; 
	//	case 2 :  TESTB(); 	  break ;
	//	case 3 :  TESTC(); 	  break ;
	//	case 4 :  TESTD(); 	  break ;
		case 3 :  TESTE(); 	  break ;
		default :break ; 
	}
		
	for(;;)   
	{	
		KeyDispose();	
		OSTimeDly(5); 			
	}
}
Ejemplo n.º 6
0
void vidInit(void)
{
	SPI_Configuration();
	TIMER_Configuration();
	vidClearScreen();
}