Example #1
0
void ST7565S::lcd_reset()
{
	lcd_command(CMD_RESET);

	// LCD bias select
	if(lcd_mode & ST7565S_BIAS2)
		lcd_command(CMD_BIAS2);
	else
		lcd_command(CMD_BIAS1);
	// ADC select
	if(lcd_mode & ST7565S_H_FLIP)
		lcd_command(CMD_ADC_REVERSE);
	else
		lcd_command(CMD_ADC_NORMAL);

	// SHL select
	if(lcd_mode & ST7565S_V_FLIP)
		lcd_command(CMD_COMMON_REVERSE);
	else
		lcd_command(CMD_COMMON_NORMAL);

	// Initial display line
	lcd_command(CMD_START_LINE(0));

	// turn on voltage converter (VC=1, VR=0, VF=0)
//	lcd_command(CMD_POWER( 0x4));
	// wait for 50% rising
//	tsk_sleep(50);

	// turn on voltage regulator (VC=1, VR=1, VF=0)
//	lcd_command(CMD_POWER(0x6));
	// wait >=50ms
//	tsk_sleep(50);

	// turn on voltage follower (VC=1, VR=1, VF=1)
	lcd_command(CMD_POWER(0x7));
	// wait
//	tsk_sleep(10);

	// set lcd operating voltage (regulator resistor, ref voltage resistor)
	lcd_command(CMD_V5_REGULATOR(lcd_mode & 0x7)); //ST7565S_RaRb_RATIO

	lcd_command(CMD_ELECTRONIC_VOLUME);
	lcd_command((lcd_mode >>8) & 0x3F);		//ST7565S_VOLUME

	lcd_command(CMD_DISPLAY_ON);
	lcd_command(CMD_DISPLAY_ALL_ON);

}
Example #2
0
void hd44780_config(uint8_t cursor, uint8_t blink, uint8_t en) 
{
    output_byte(0, CMD_POWER(1, cursor, blink),en);
}