{
gpio_put( P_LCD2_RESET , 1 );
lcd2_timer_1ms = 0;
while ( lcd2_timer_1ms < 100 ){}
gpio_put( P_LCD2_RESET , 0 );
lcd2_timer_1ms = 0;
while ( lcd2_timer_1ms < 100 ){}
gpio_put( P_LCD2_RESET , 1 );
lcd2_timer_1ms = 0;
while ( lcd2_timer_1ms < 100 ){}
}
{
gpio_put( P_LCD2_CS , 1 );
gpio_put( P_LCD2_CS , 0 );
}
{
Lcd2Send( LCD2_SEND_CMD, 0x11);
lcd2_timer_1ms = 0;
while ( lcd2_timer_1ms < 120 ){}
Lcd2Send( LCD2_SEND_CMD, 0xfd);
Lcd2Send( LCD2_SEND_DATA, 0x06);
Lcd2Send( LCD2_SEND_DATA, 0x08);
Lcd2Send( LCD2_SEND_CMD, 0x61);
Lcd2Send( LCD2_SEND_DATA, 0x07);
Lcd2Send( LCD2_SEND_DATA, 0x04);
Lcd2Send( LCD2_SEND_CMD, 0x62);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x44);
Lcd2Send( LCD2_SEND_DATA, 0x40);
Lcd2Send( LCD2_SEND_CMD, 0x63);
Lcd2Send( LCD2_SEND_DATA, 0x41);
Lcd2Send( LCD2_SEND_DATA, 0x07);
Lcd2Send( LCD2_SEND_DATA, 0x12);
Lcd2Send( LCD2_SEND_DATA, 0x12);
Lcd2Send( LCD2_SEND_CMD, 0x64);
Lcd2Send( LCD2_SEND_DATA, 0x37);
Lcd2Send( LCD2_SEND_CMD, 0x65);
Lcd2Send( LCD2_SEND_DATA, 0x09);
Lcd2Send( LCD2_SEND_DATA, 0x10);
Lcd2Send( LCD2_SEND_DATA, 0x21);
Lcd2Send( LCD2_SEND_CMD, 0x66);
Lcd2Send( LCD2_SEND_DATA, 0x09);
Lcd2Send( LCD2_SEND_DATA, 0x10);
Lcd2Send( LCD2_SEND_DATA, 0x21);
Lcd2Send( LCD2_SEND_CMD, 0x67);
Lcd2Send( LCD2_SEND_DATA, 0x20);
Lcd2Send( LCD2_SEND_DATA, 0x40);
Lcd2Send( LCD2_SEND_CMD, 0x68);
Lcd2Send( LCD2_SEND_DATA, 0x90);
Lcd2Send( LCD2_SEND_DATA, 0x4c);
Lcd2Send( LCD2_SEND_DATA, 0x7c);
Lcd2Send( LCD2_SEND_DATA, 0x06);
Lcd2Send( LCD2_SEND_CMD, 0xb1);
Lcd2Send( LCD2_SEND_DATA, 0x0F);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_CMD, 0xB4);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_CMD, 0xB5);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_DATA, 0x0a);
Lcd2Send( LCD2_SEND_DATA, 0x14);
Lcd2Send( LCD2_SEND_CMD, 0xB6);
Lcd2Send( LCD2_SEND_DATA, 0x04);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_DATA, 0x9f);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_CMD, 0xdf);
Lcd2Send( LCD2_SEND_DATA, 0x11);
Lcd2Send( LCD2_SEND_CMD, 0xE2);
Lcd2Send( LCD2_SEND_DATA, 0x03);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x26);
Lcd2Send( LCD2_SEND_DATA, 0x27);
Lcd2Send( LCD2_SEND_DATA, 0x3f);
Lcd2Send( LCD2_SEND_CMD, 0xE5);
Lcd2Send( LCD2_SEND_DATA, 0x3f);
Lcd2Send( LCD2_SEND_DATA, 0x27);
Lcd2Send( LCD2_SEND_DATA, 0x26);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x03);
Lcd2Send( LCD2_SEND_CMD, 0xE1);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x57);
Lcd2Send( LCD2_SEND_CMD, 0xE4);
Lcd2Send( LCD2_SEND_DATA, 0x58);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_CMD, 0xE0);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_DATA, 0x03);
Lcd2Send( LCD2_SEND_DATA, 0x0d);
Lcd2Send( LCD2_SEND_DATA, 0x0e);
Lcd2Send( LCD2_SEND_DATA, 0x0e);
Lcd2Send( LCD2_SEND_DATA, 0x0c);
Lcd2Send( LCD2_SEND_DATA, 0x15);
Lcd2Send( LCD2_SEND_DATA, 0x19);
Lcd2Send( LCD2_SEND_CMD, 0xE3);
Lcd2Send( LCD2_SEND_DATA, 0x1a);
Lcd2Send( LCD2_SEND_DATA, 0x16);
Lcd2Send( LCD2_SEND_DATA, 0x0c);
Lcd2Send( LCD2_SEND_DATA, 0x0f);
Lcd2Send( LCD2_SEND_DATA, 0x0e);
Lcd2Send( LCD2_SEND_DATA, 0x0d);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_CMD, 0xE6);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0xff);
Lcd2Send( LCD2_SEND_CMD, 0xE7);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_DATA, 0x04);
Lcd2Send( LCD2_SEND_DATA, 0x03);
Lcd2Send( LCD2_SEND_DATA, 0x03);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x12);
Lcd2Send( LCD2_SEND_CMD, 0xE8);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x70);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_CMD, 0xEc);
Lcd2Send( LCD2_SEND_DATA, 0x52);
Lcd2Send( LCD2_SEND_CMD, 0xF1);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_DATA, 0x01);
Lcd2Send( LCD2_SEND_DATA, 0x02);
Lcd2Send( LCD2_SEND_CMD, 0xF6);
Lcd2Send( LCD2_SEND_DATA, 0x09);
Lcd2Send( LCD2_SEND_DATA, 0x10);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_CMD, 0xfd);
Lcd2Send( LCD2_SEND_DATA, 0xfa);
Lcd2Send( LCD2_SEND_DATA, 0xfc);
Lcd2Send( LCD2_SEND_CMD, 0x3a);
Lcd2Send( LCD2_SEND_DATA, 0x05);
Lcd2Send( LCD2_SEND_CMD, 0x35);
Lcd2Send( LCD2_SEND_DATA, 0x00);
Lcd2Send( LCD2_SEND_CMD, 0x36 );
Lcd2Send( LCD2_SEND_DATA, 0x08 );
Lcd2Send( LCD2_SEND_CMD, 0x21);
Lcd2Send( LCD2_SEND_CMD, 0x29);
lcd2_timer_1ms = 0;
while ( lcd2_timer_1ms < 10 ){}
Xstart+= 0; Xend+= 0;
Ystart+=20; Yend+=20;
Lcd2Send( LCD2_SEND_CMD, 0x2a);
Lcd2Send( LCD2_SEND_DATA, Xstart>>8);
Lcd2Send( LCD2_SEND_DATA, Xstart);
Lcd2Send( LCD2_SEND_DATA, Xend>>8);
Lcd2Send( LCD2_SEND_DATA, Xend);
Lcd2Send( LCD2_SEND_CMD, 0x2b);
Lcd2Send( LCD2_SEND_DATA, Ystart>>8);
Lcd2Send( LCD2_SEND_DATA, Ystart);
Lcd2Send( LCD2_SEND_DATA, Yend>>8);
Lcd2Send( LCD2_SEND_DATA, Yend);
Lcd2Send( LCD2_SEND_CMD, 0x2C);
コメント