新用了一个液晶显示器,和以前的接线不一样,这个显示是反向的,在不改变显示字体的情况下,有可以配置寄存器让显示反转吗?
附上ST7567的初使化显示代码和液晶datasheet~
QQ图片20170527104057.jpg (138.6 KB, 下载次数: 0)
下载附件
2017-5-27 10:41 上传
void LCD_Init(void)
{
RCC->APB2ENR|=1<<2;//使能PORTA时钟
// RCC->APB2ENR|=1<<4;//使能PORTC时钟
// RCC->APB2ENR|=1<<0; //??????
// JTAG_Set(SWD_ENABLE); //??SWD
//PORTa3~7
GPIOA->CRL&=0X000000FF;
GPIOA->CRL|=0X33333300;
GPIOA->ODR|=0X00F8;
LCD_RESB = 1;
delay_us(100); //
LCD_RESB = 0;
delay_us(100);
LCD_RESB = 1;
delay_us(100);
write_byte(LCD_CMD,0xe2); // (14) Soft Reset
write_byte(LCD_CMD,0xa1); // Set seg direct
write_byte(LCD_CMD,0xcf); // Set com direct
// write_byte(LCD_CMD,0xB0); //
write_byte(LCD_CMD,0xf8); // Set Booster
write_byte(LCD_CMD,0x00); // 5x
// write_byte(LCD_CMD,0xA2); // set lcd bias = 1/9
write_byte(LCD_CMD,0xA3); // set lcd bias = 1/7
write_byte(LCD_CMD,0x24); // set internal rb/ra=5.0
// write_byte(LCD_CMD,0x24); // set internal rb/ra=5.0
v_LCD_Write_Windows(SEG_ORG_OFFSET,131,0,8,0x00);
write_byte(LCD_CMD,0x2f); // all built-in power circuits on
write_byte(LCD_CMD,0x81); // set contrast
write_byte(LCD_CMD,0x1c); //vop
write_byte(LCD_CMD,0xaf); // dispaly on
}
说明原来的屏有问题啊~
我用量产过,有遇到过类似现象的屏,就是屏的问题~
一周热门 更多>