예제 #1
0
static int hx8352_on(struct platform_device *pdev)
{
	if (!driver_state.disp_initialized) {
		/* Power Supply -> reset -> initail */
		lcdc_hx8352_config_gpios();
		hx8352_hw_reset();
#ifdef CONFIG_DEBUG_FS
		hx8352_do_init_tbl();
#else
		Lcd_init();
#endif
		if(0x52 == readreg(0x0))
			driver_state.disp_initialized = TRUE;
	}

	driver_state.display_on = TRUE;

	return 0;
}
예제 #2
0
void main(){

Lcd_init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR);               // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);
I2C1_Init(100000);
TRISB.F0=0;
TRISB.F1=0;

while(1){

   Read_Compass();
   WordToStr(angle,to_LCD);
   Lcd_Out(1,1,to_LCD);
   straight();
   // delay_ms(500);
  // Lcd_Out(1,1,"Piyumal");
   //delay_ms(1000);
   
}



}
예제 #3
0
static void gsm_thread_entry(void* parameter)  
{
    u8 atd_str[25];
    rt_size_t  res=RT_ERROR;
        //     finsh_init(&shell->parser);
	 //	  	 
		//	step 1:  Init Dataflash
	   DF_init();  
	   APP_IOpinInit();	
	   rt_kprintf("\r\n ---> gsm thread start !\r\n");	    
	   HardWareVerion=HardWareGet(); 
	   
	   //  step 2:	 process config data   
		 SysConfiguration();	// system config				
		 
		 total_ergotic();
	   Gsm_RegisterInit();	 //  init register states	 ,then	it	will  power on	the module	 
          
		 SIMID_Convert_SIMCODE(); //   translate		   
      #ifdef HMI
		   HMI_app_init();	
      #endif           
       gps_init();
  	   Lcd_init();
	  
	   
	 //--------------------------------------  
	while (1)
	{
	 if((GSM_PWR.result==result_success)&&(dwlcd_contr<=5))
	   	{
			if(Login_Menu_Flag!=1)
			{
			
				Lcd_write(Big_lcd.status,LCD_PAGE,0x15);
				dwlcd_contr++;
			}
			else
			{
				Lcd_write(Big_lcd.status,LCD_PAGE,0x01);
				dwlcd_contr++;
			}
			;
	   	}
            // 1.  after power  on    get imsi code  	 	
              IMSIcode_Get(); 
            //  2. after get imsi   Comm   AT  initial   start 
              GSM_Module_TotalInitial();  
            // 3. Receivce & Process   Communication  Module   data ----
	       GSM_Buffer_Read_Process(); 
		   rt_thread_delay(20);      	
	       DataLink_Process();	
		   //++++++++++++++++++++++++DWLCD+++++++++++++++++++++
	       //_485_RxHandler_01();
	       if(Big_lcd.RX_enable==LCD_BUSY)
	       	{
		   	Lcd_Data_Process();
			Big_lcd.RX_enable=LCD_IDLE;
	       	}
		   /*
		   Lcd_write(Big_lcd.status,LCD_SETSPD,0);
			Lcd_write(Big_lcd.status,LCD_GPSNUM,Satelite_num);
		   Lcd_write(Big_lcd.status,LCD_GSMNUM,ModuleSQ);
		   */
		   if(ModuleStatus&Status_GPS )
		   	{
		   	if(Big_lcd.RX_enable==LCD_IDLE)
		   	{
		   	    if(lcd_contrl==0)
		   	    {
		   		Lcd_write(Big_lcd.status,LCD_SETTIME,0);
				delay_ms(5);
				lcd_contrl++;
				
		   	    }
		   		}
		   	}
		   //++++++++++++++++++++++++DWLCD+++++++++++++++++++++
		   if(BD1_struct.Rx_enable==RT_EOK)
		   	{
		   		BD1_RxProcess();
		   	}
             //------------------------------------------------
		    if (Send_DataFlag== 1) 
               {
			   res=rt_device_control(&Device_GSM, query_online, NULL);
			    if(res==RT_EOK)
			             rt_device_write(&Device_GSM, LinkNum,( const void *)GPRS_info,(rt_size_t) GPRS_infoWr_Tx); 
			    Send_DataFlag=0;          
	
	         }    
			//监听
			if(CallState==CallState_rdytoDialLis)
			{
             CallState=CallState_Dialing;
			 memset(atd_str,0,sizeof(atd_str));
			 memcpy(atd_str,"ATD",3);
			 memcpy(atd_str+3,JT808Conf_struct.LISTEN_Num,strlen((const char*)JT808Conf_struct.LISTEN_Num));
			 memcpy(atd_str+3+strlen((const char*)JT808Conf_struct.LISTEN_Num),";\r\n",3);
			 rt_hw_gsm_output(atd_str);
			 rt_kprintf("\r\n拨打%s\r\n",atd_str);
			}
		     //---------  Step timer
		     //  Dial_step_Single_10ms_timer();    
		  	 //   TTS	
             TTS_Data_Play();		 
             //   Get  CSQ value
	         if(GSM_CSQ_Query()==false)	 
	         {
	             if(Calling_ATA_flag==1)
	             	{
                        delay_ms(10);  
		                rt_hw_gsm_output("ATA\r\n");    //检查信号强度
					    if(DispContent)	
					        rt_kprintf(" 接听   ATA\r\n");   

                       Calling_ATA_flag=0;
	             	}
			 } 
			 
			 //   SMS  Service
			 SMS_Process();            
			   
	}
}