- /*
- * 三线SPI模式 ST7701S
- *
- */
- aw_local void __ST7701S_Init(struct __st7701s *p_this)
- {
- __spi_st7701s_WriteCommand(p_this,0xFF); //手册P261
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x13);
- __spi_st7701s_WriteCommand(p_this,0xEF);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x10);
- __spi_st7701s_WriteCommand(p_this,0xC0);
- __spi_st7701s_WriteData(p_this,0x63);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0xC1);
- __spi_st7701s_WriteData(p_this,0x10);
- __spi_st7701s_WriteData(p_this,0x02);
- __spi_st7701s_WriteCommand(p_this,0xC2);
- __spi_st7701s_WriteData(p_this,0x31);
- __spi_st7701s_WriteData(p_this,0x02);
- __spi_st7701s_WriteCommand(p_this,0xCC);
- __spi_st7701s_WriteData(p_this,0x10);
- __spi_st7701s_WriteCommand(p_this,0xB0);
- __spi_st7701s_WriteData(p_this,0xC0);
- __spi_st7701s_WriteData(p_this,0x0C);
- __spi_st7701s_WriteData(p_this,0x92);
- __spi_st7701s_WriteData(p_this,0x0C);
- __spi_st7701s_WriteData(p_this,0x10);
- __spi_st7701s_WriteData(p_this,0x05);
- __spi_st7701s_WriteData(p_this,0x02);
- __spi_st7701s_WriteData(p_this,0x0D);
- __spi_st7701s_WriteData(p_this,0x07);
- __spi_st7701s_WriteData(p_this,0x21);
- __spi_st7701s_WriteData(p_this,0x04);
- __spi_st7701s_WriteData(p_this,0x53);
- __spi_st7701s_WriteData(p_this,0x11);
- __spi_st7701s_WriteData(p_this,0x6A);
- __spi_st7701s_WriteData(p_this,0x32);
- __spi_st7701s_WriteData(p_this,0x1F);
- __spi_st7701s_WriteCommand(p_this,0xB1);
- __spi_st7701s_WriteData(p_this,0xC0);
- __spi_st7701s_WriteData(p_this,0x87);
- __spi_st7701s_WriteData(p_this,0xCF);
- __spi_st7701s_WriteData(p_this,0x0C);
- __spi_st7701s_WriteData(p_this,0x10);
- __spi_st7701s_WriteData(p_this,0x06);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x03);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteData(p_this,0x1D);
- __spi_st7701s_WriteData(p_this,0x06);
- __spi_st7701s_WriteData(p_this,0x54);
- __spi_st7701s_WriteData(p_this,0x12);
- __spi_st7701s_WriteData(p_this,0xE6);
- __spi_st7701s_WriteData(p_this,0xEC);
- __spi_st7701s_WriteData(p_this,0x0F);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x11);
- __spi_st7701s_WriteCommand(p_this,0xB0);
- __spi_st7701s_WriteData(p_this,0x5D);
- __spi_st7701s_WriteCommand(p_this,0xB1);
- __spi_st7701s_WriteData(p_this,0x62);
- __spi_st7701s_WriteCommand(p_this,0xB2);
- __spi_st7701s_WriteData(p_this,0x82);
- __spi_st7701s_WriteCommand(p_this,0xB3);
- __spi_st7701s_WriteData(p_this,0x80);
- __spi_st7701s_WriteCommand(p_this,0xB5);
- __spi_st7701s_WriteData(p_this,0x42);
- __spi_st7701s_WriteCommand(p_this,0xB7);
- __spi_st7701s_WriteData(p_this,0x85);
- __spi_st7701s_WriteCommand(p_this,0xB8);
- __spi_st7701s_WriteData(p_this,0x20);
- __spi_st7701s_WriteCommand(p_this,0xC0);
- __spi_st7701s_WriteData(p_this,0x09);
- __spi_st7701s_WriteCommand(p_this,0xC1);
- __spi_st7701s_WriteData(p_this,0x78);
- __spi_st7701s_WriteCommand(p_this,0xC2);
- __spi_st7701s_WriteData(p_this,0x78);
- __spi_st7701s_WriteCommand(p_this,0xD0);
- __spi_st7701s_WriteData(p_this,0x88);
- __spi_st7701s_WriteCommand(p_this,0xEE);
- __spi_st7701s_WriteData(p_this,0x42);
- aw_mdelay(100);
- __spi_st7701s_WriteCommand(p_this,0xE0);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x02);
- __spi_st7701s_WriteCommand(p_this,0xE1);
- __spi_st7701s_WriteData(p_this,0x04);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x06);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x05);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x07);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteCommand(p_this,0xE2);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0xE3);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteCommand(p_this,0xE4);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteCommand(p_this,0xE5);
- __spi_st7701s_WriteData(p_this,0x0C);
- __spi_st7701s_WriteData(p_this,0x30);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x0E);
- __spi_st7701s_WriteData(p_this,0x32);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteData(p_this,0x2C);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x0A);
- __spi_st7701s_WriteData(p_this,0x2E);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteCommand(p_this,0xE6);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteCommand(p_this,0xE7);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteCommand(p_this,0xE8);
- __spi_st7701s_WriteData(p_this,0x0D);
- __spi_st7701s_WriteData(p_this,0x31);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x0F);
- __spi_st7701s_WriteData(p_this,0x33);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x09);
- __spi_st7701s_WriteData(p_this,0x2D);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0x0B);
- __spi_st7701s_WriteData(p_this,0x2F);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteData(p_this,0xA0);
- __spi_st7701s_WriteCommand(p_this,0xEB);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0xE4);
- __spi_st7701s_WriteData(p_this,0xE4);
- __spi_st7701s_WriteData(p_this,0x44);
- __spi_st7701s_WriteData(p_this,0x88);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0xED);
- __spi_st7701s_WriteData(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0xF5);
- __spi_st7701s_WriteData(p_this,0x47);
- __spi_st7701s_WriteData(p_this,0x6F);
- __spi_st7701s_WriteData(p_this,0x0B);
- __spi_st7701s_WriteData(p_this,0xA1);
- __spi_st7701s_WriteData(p_this,0xA2);
- __spi_st7701s_WriteData(p_this,0xBF);
- __spi_st7701s_WriteData(p_this,0xFB);
- __spi_st7701s_WriteData(p_this,0x2A);
- __spi_st7701s_WriteData(p_this,0x1A);
- __spi_st7701s_WriteData(p_this,0xB0);
- __spi_st7701s_WriteData(p_this,0xF6);
- __spi_st7701s_WriteData(p_this,0x74);
- __spi_st7701s_WriteData(p_this,0x5F);
- __spi_st7701s_WriteData(p_this,0xFF);
- __spi_st7701s_WriteCommand(p_this,0xEF);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteData(p_this,0x08);
- __spi_st7701s_WriteData(p_this,0x40);
- __spi_st7701s_WriteData(p_this,0x3F);
- __spi_st7701s_WriteData(p_this,0x64);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x13);
- __spi_st7701s_WriteCommand(p_this,0xE8);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x0E);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0x11);
- aw_mdelay(200);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x13);
- __spi_st7701s_WriteCommand(p_this,0xE8);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x0C);
- aw_mdelay(10);
- __spi_st7701s_WriteCommand(p_this,0xE8);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0xFF);
- __spi_st7701s_WriteData(p_this,0x77);
- __spi_st7701s_WriteData(p_this,0x01);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteData(p_this,0x00);
- __spi_st7701s_WriteCommand(p_this,0x3A);
- __spi_st7701s_WriteData(p_this,0x50);
- __spi_st7701s_WriteCommand(p_this,0x29);
- aw_mdelay(50);
- }
复制代码
|