Пример #1
0
  //-----------------------------------------------------------------------------
  // FUNCTION:    D4DLCD_Init_LS020
  // SCOPE:       Low Level Driver API function
  // DESCRIPTION: The function is used for initialization of this low level driver 
  //              
  // PARAMETERS:  none
  //              
  // RETURNS:     result: 1 - Success
  //                      0 - Failed
  //-----------------------------------------------------------------------------  
  static unsigned char D4DLCD_Init_LS020(void)
  {
      static const unsigned short init_data[] =
    	{ 
    		0xFDFD, 0xFDFD, 
    		// pause 
    		0xEF00, 0xEE04, 0x1B04, 0xFEFE, 0xFEFE, 
    		0xEF90, 0x4A04, 0x7F3F, 0xEE04, 0x4306, 
    		// pause 
    		0xEF90, 0x0983, 0x0800, 0x0BAF, 0x0A00, 
    		0x0500, 0x0600, 0x0700, 0xEF00, 0xEE0C, 
    		0xEF90, 0x0080, 0xEFB0, 0x4902, 0xEF00, 
    		0x7F01, 0xE181, 0xE202, 0xE276, 0xE183, 
    		0x8001, 0xEF90, 0x0000 
    	};  
    
    if(D4D_LLD_LCD_HW.D4DLCDHW_Init == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_SendCmdWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_ReadDataWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_ReadCmdWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_PinCtl == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_FlushBuffer == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_DeInit == NULL)
      return 0;
    
    
    if(!D4D_LLD_LCD_HW.D4DLCDHW_Init())
      return 0;
    
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_BACKLIGHT_PIN, D4DHW_PIN_SET_1);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_BACKLIGHT_PIN, D4DHW_PIN_OUT);    

    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_0);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_OUT);            

    D4DLCD_Delay_ms_Common(300); 
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_0);   D4DLCD_Delay_ms_Common(75);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_1);   D4DLCD_Delay_ms_Common(500);      
    
    D4DLCD_Command_Data(&init_data[0], 2);    D4DLCD_Delay_ms_Common(75); 
    D4DLCD_Command_Data(&init_data[2], 10);   D4DLCD_Delay_ms_Common(75); 
    D4DLCD_Command_Data(&init_data[12], 23);
    
    return 1;  
  }
Пример #2
0
  //-----------------------------------------------------------------------------
  // FUNCTION:    D4DLCD_Init_LGDP4531
  // SCOPE:       Low Level Driver API function
  // DESCRIPTION: The function is used for initialization of this low level driver
  //
  // PARAMETERS:  none
  //
  // RETURNS:     result: 1 - Success
  //                      0 - Failed
  //-----------------------------------------------------------------------------
  static unsigned char D4DLCD_Init_LGDP4531(void)
  {

    if(D4D_LLD_LCD_HW.D4DLCDHW_Init == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_SendCmdWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_ReadDataWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_ReadCmdWord == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_PinCtl == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_FlushBuffer == NULL)
      return 0;
    if(D4D_LLD_LCD_HW.D4DLCDHW_DeInit == NULL)
      return 0;


    if(!D4D_LLD_LCD_HW.D4DLCDHW_Init())
      return 0;

    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_BACKLIGHT_PIN, D4DHW_PIN_SET_1);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_BACKLIGHT_PIN, D4DHW_PIN_OUT);


    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_0);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_OUT);

    D4DLCD_Delay_ms_Common(300);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_0);   D4DLCD_Delay_ms_Common(75);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_PinCtl(D4DLCD_RESET_PIN, D4DHW_PIN_SET_1);   D4DLCD_Delay_ms_Common(500);

    // Initial synchronization transfers
    (void)D4D_LLD_LCD_HW.D4DLCDHW_SendCmdWord(0);
    (void)D4D_LLD_LCD_HW.D4DLCDHW_SendCmdWord(0);

    D4DLCD_Index_Data(init_data1, 12);   D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data2, 2);    D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data3, 32);   D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data4, 16);   D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data5, 2);    D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data6, 2);    D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data7, 2);    D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data8, 2);    D4DLCD_Delay_ms_Common(15);
    D4DLCD_Index_Data(init_data9, 2);    D4DLCD_Delay_ms_Common(20);



    return 1;
  }