Exemple #1
0
void next_kbd_init(void)
{
    out_hi();
    NEXT_KBD_IN_DDR   &= ~(1<<NEXT_KBD_IN_BIT);   // KBD_IN  to input
    NEXT_KBD_IN_PORT  |=  (1<<NEXT_KBD_IN_BIT);   // KBD_IN  pull up
    
    query_delay(5);
    reset_delay(8);
    
    query_delay(5);
    reset_delay(8);
}
/*******************************************************************************
* Function Name  : STM3210E_LCD_Init
* Description    : Initializes the LCD.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void STM3210E_LCD_Init(void)
{ 
#ifndef NO_LCD  
/* Configure the LCD Control pins --------------------------------------------*/
  LCD_CtrlLinesConfig();

/* Configure the FSMC Parallel interface -------------------------------------*/
  LCD_FSMCConfig();
  

  LCD_Command = Display_Off; //
  delay();
  LCD_Command = LCD_Reset; //
  reset_delay();
  
  LCD_Command = Set_LCD_Bias_9;
  delay();
  LCD_Command = Set_ADC_Normal;
  delay();
  LCD_Command = COM_Scan_Dir_Reverse;
  delay();
  LCD_Command = Set_Start_Line_X|0x0;
  delay();
  
  LCD_Command = 0x2c;
  power_delay(); // 50ms requried
  LCD_Command = 0x2e;
  power_delay(); // 50ms
  LCD_Command = 0x2f;
  power_delay(); // 50ms
  
  LCD_Command = Set_Ref_Vol_Reg|0x05;
  delay();
  LCD_Command = Set_Ref_Vol_Mode;
  delay();
  LCD_Command = Set_Ref_Vol_Reg;
  delay();
  
  LCD_Clear();
  delay();
  
  LCD_Command = Set_Page_Addr_X|0x0;
  delay();
  LCD_Command = Set_ColH_Addr_X|0x0;
  delay();
  LCD_Command = Set_ColL_Addr_X|0x0;
  delay();
 
  LCD_Command = Display_On; //
  delay();
#endif
}