durongze 发表于 2024-6-2 03:47:29

durongze 发表于 2024-6-2 03:46
你是参考官方的哪个例子呢? 官方的7920好像和7567差别很大吧?7567还要设置电压,偏压比,对比度。7920好 ...

7920 官方的例子里只有几句。
void LCDInit(void) //LCM³õʼ»¯
{
    PSB = 1;    //²¢¿Ú
//PSB = 0;    //SPI¿Ú
    delay_ms(10);
    LCD_RESET = 0;
    delay_ms(10);
    LCD_RESET = 1;
    delay_ms(100);
   
    WriteCommandLCD(0x30,1); //ÏÔʾģʽÉèÖÃ,¿ªÊ¼ÒªÇóÿ´Î¼ì²âæÐźÅ
    WriteCommandLCD(0x01,1); //ÏÔʾÇåÆÁ
    WriteCommandLCD(0x06,1); // ÏÔʾ¹â±êÒÆ¶¯ÉèÖÃ
    WriteCommandLCD(0x0C,1); // ÏÔʾ¿ª¼°¹â±êÉèÖÃ
}

void LCDClear(void) //ÇåÆÁ
{
    WriteCommandLCD(0x01,1); //ÏÔʾÇåÆÁ
    WriteCommandLCD(0x34,1); // ÏÔʾ¹â±êÒÆ¶¯ÉèÖÃ
    WriteCommandLCD(0x30,1); // ÏÔʾ¿ª¼°¹â±êÉèÖÃ
}
页: 1 [2]
查看完整版本: 用STC32G的硬件SPI驱动LCD12864屏幕的程序