新用了一个液晶显示器,和以前的接线不一样,这个显示是反向的,在不改变显示字体的情况下,有可以配置寄存器让显示反转吗?
附上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
}
if(font) {
点亮字体颜 {MOD}
} else {
熄灭字体颜 {MOD}
}
显示屏肯定有反显,但是都是全局反显,局部可设定反显的显示屏没遇到过!!!至于我说的那个思路,看来你还是没懂!!!!没懂就算了吧,一切都是缘分!!!
write_byte(LCD_CMD,0xcf); // Set com direct
改成
write_byte(LCD_CMD,0xa0);
write_byte(LCD_CMD,0xc8);
试试看.
对了,在啰嗦一句,对于这种点阵屏,不管是是一页一页ram的,还是一个点就是一个byte的。。。。所有思路都是集中在点上面,点、点、点,重要的事情说三遍,这样写驱动的时候,你会发现简单、明了,而且还通用 !!!!要是你还是不懂,那也算了,毕竟一切都是缘分,是不!!!!
一周热门 更多>