⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssd1770.c

📁 ssd192Xv1 液晶驱动程序 驱动程序 彩屏液晶
💻 C
字号:
#include "ssd1770.h"
#include "mainsublcd.h"

int MAINSUBLCD_WIDTH=104;
int MAINSUBLCD_HEIGHT=80;
int MAINSUBLCD_INTERFACE_TYPE=MAINSUBLCD_INTERFACE_6800;
int MAINSUBLCD_PANEL_TYPE=MAINSUBLCD_PANEL_CSTN;

void mainsublcd_hw_init(void)
{
	SSD_REGWB(REG_Sub_Type,SSD_REGRB(REG_Sub_Type)&~0x03);
	SSD_REGWB(REG_Sub_Type,SSD_REGRB(REG_Sub_Type)|0x01);
	SSD_REGWB(REG_Sub_Bpp,0x01);       // 3 byte per 2 pixel (12bpp)
	SSD_REGWB(REG_Sub_CLK_Divide,0x00);        // Clock Divide

    // SSD1770 Initialization code
	SubCmdWriteByte(0xe2);
    SubCmdWriteByte(0xd1);        // Enable oscillator
    SubCmdWriteByte(0x94);        // Exit sleep mode
    SubCmdWriteByte(0x20);        // Set power control
    SubArgWriteByte(0x0f);
    SubCmdWriteByte(0x81);        // Set contrast
    SubArgWriteByte(0x18);
    SubArgWriteByte(0x04);
    SubCmdWriteByte(0xfb);        // Set bias ratio
    SubArgWriteByte(0x02);
    SubCmdWriteByte(0xa7);        // Inverse display
    SubCmdWriteByte(0xca);        // Set Display control
    SubArgWriteByte(0x00);
    SubArgWriteByte(0x13);
    SubArgWriteByte(0x00);
    SubCmdWriteByte(0xf7);        // Set 4bit PWM
    SubArgWriteByte(0x28);
    SubArgWriteByte(0x2c);
    SubArgWriteByte(0x05);
    SubCmdWriteByte(0xf2);        // Set frame frequency
    SubArgWriteByte(0x08);
    SubArgWriteByte(0x00);
    SubCmdWriteByte(0xf1);
    SubArgWriteByte(0x08);
    SubArgWriteByte(0x00);
    SubCmdWriteByte(0xbc);
    SubArgWriteByte(0x00);
    SubArgWriteByte(0x00);
    SubArgWriteByte(0x02);
    SubCmdWriteByte(0xbb);
    SubArgWriteByte(0x01);
    SubCmdWriteByte(0xaf);        // Display on
    SubCmdWriteByte(0x15);        // Set Column Address
    SubArgWriteByte(0x00);
    SubArgWriteByte(0x33);
    SubCmdWriteByte(0x75);        // Set Page Address
    SubArgWriteByte(0x00);
    SubArgWriteByte(0x4f);

    SubCmdWriteByte(0xf5);
    SubArgWriteByte(0x79);
    SubArgWriteByte(0x9d);
    SubArgWriteByte(0x01);
    SubArgWriteByte(0x0c);

    SubCmdWriteByte(0x5c);        // Write Display Data

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -