Update WiFi SoftAP password to love, update touch pin mappings, and remove unused decoders to resolve compile crash.
This commit is contained in:
@@ -62,95 +62,172 @@ void LCD_Init(void)
|
||||
Backlight_Init();
|
||||
SPI_Init();
|
||||
|
||||
LCD_Reset();
|
||||
//************* Start Initial Sequence **********//
|
||||
LCD_WriteCommand(0x11);
|
||||
// Reset LCD
|
||||
digitalWrite(EXAMPLE_PIN_NUM_LCD_RST, LOW);
|
||||
delay(10);
|
||||
digitalWrite(EXAMPLE_PIN_NUM_LCD_RST, HIGH);
|
||||
delay(50);
|
||||
|
||||
//************* JD9853 Start Initial Sequence **********//
|
||||
LCD_WriteCommand(0x11); // Sleep Out
|
||||
delay(120);
|
||||
LCD_WriteCommand(0x36);
|
||||
|
||||
LCD_WriteCommand(0xDF);
|
||||
LCD_WriteData(0x98);
|
||||
LCD_WriteData(0x53);
|
||||
|
||||
LCD_WriteCommand(0xB2);
|
||||
LCD_WriteData(0x23);
|
||||
|
||||
LCD_WriteCommand(0xB7);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x47);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x6F);
|
||||
|
||||
LCD_WriteCommand(0xBB);
|
||||
LCD_WriteData(0x1C);
|
||||
LCD_WriteData(0x1A);
|
||||
LCD_WriteData(0x55);
|
||||
LCD_WriteData(0x73);
|
||||
LCD_WriteData(0x63);
|
||||
LCD_WriteData(0xF0);
|
||||
|
||||
LCD_WriteCommand(0xC0);
|
||||
LCD_WriteData(0x44);
|
||||
LCD_WriteData(0xA4);
|
||||
|
||||
LCD_WriteCommand(0xC1);
|
||||
LCD_WriteData(0x16);
|
||||
|
||||
LCD_WriteCommand(0xC3);
|
||||
LCD_WriteData(0x7D);
|
||||
LCD_WriteData(0x07);
|
||||
LCD_WriteData(0x14);
|
||||
LCD_WriteData(0x06);
|
||||
LCD_WriteData(0xCF);
|
||||
LCD_WriteData(0x71);
|
||||
LCD_WriteData(0x72);
|
||||
LCD_WriteData(0x77);
|
||||
|
||||
LCD_WriteCommand(0xC4);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0xA0);
|
||||
LCD_WriteData(0x79);
|
||||
LCD_WriteData(0x0B);
|
||||
LCD_WriteData(0x0A);
|
||||
LCD_WriteData(0x16);
|
||||
LCD_WriteData(0x79);
|
||||
LCD_WriteData(0x0B);
|
||||
LCD_WriteData(0x0A);
|
||||
LCD_WriteData(0x16);
|
||||
LCD_WriteData(0x82);
|
||||
|
||||
LCD_WriteCommand(0xC8);
|
||||
const uint8_t c8_data[] = {
|
||||
0x3F, 0x32, 0x29, 0x29, 0x27, 0x2B, 0x27, 0x28, 0x28, 0x26, 0x25, 0x17, 0x12, 0x0D, 0x04, 0x00,
|
||||
0x3F, 0x32, 0x29, 0x29, 0x27, 0x2B, 0x27, 0x28, 0x28, 0x26, 0x25, 0x17, 0x12, 0x0D, 0x04, 0x00
|
||||
};
|
||||
for (int i = 0; i < 32; i++) {
|
||||
LCD_WriteData(c8_data[i]);
|
||||
}
|
||||
|
||||
LCD_WriteCommand(0xD0);
|
||||
LCD_WriteData(0x04);
|
||||
LCD_WriteData(0x06);
|
||||
LCD_WriteData(0x6B);
|
||||
LCD_WriteData(0x0F);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0xD7);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x30);
|
||||
|
||||
LCD_WriteCommand(0xE6);
|
||||
LCD_WriteData(0x14);
|
||||
|
||||
LCD_WriteCommand(0xDE);
|
||||
LCD_WriteData(0x01);
|
||||
|
||||
LCD_WriteCommand(0xB7);
|
||||
LCD_WriteData(0x03);
|
||||
LCD_WriteData(0x13);
|
||||
LCD_WriteData(0xEF);
|
||||
LCD_WriteData(0x35);
|
||||
LCD_WriteData(0x35);
|
||||
|
||||
LCD_WriteCommand(0xC1);
|
||||
LCD_WriteData(0x14);
|
||||
LCD_WriteData(0x15);
|
||||
LCD_WriteData(0xC0);
|
||||
|
||||
LCD_WriteCommand(0xC2);
|
||||
LCD_WriteData(0x06);
|
||||
LCD_WriteData(0x3A);
|
||||
|
||||
LCD_WriteCommand(0xC4);
|
||||
LCD_WriteData(0x72);
|
||||
LCD_WriteData(0x12);
|
||||
|
||||
LCD_WriteCommand(0xBE);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0xDE);
|
||||
LCD_WriteData(0x02);
|
||||
|
||||
LCD_WriteCommand(0xE5);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x02);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0xE5);
|
||||
LCD_WriteData(0x01);
|
||||
LCD_WriteData(0x02);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0xDE);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0x35);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0x3A);
|
||||
LCD_WriteData(0x05);
|
||||
|
||||
LCD_WriteCommand(0x2A);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x22);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0xCD);
|
||||
|
||||
LCD_WriteCommand(0x2B);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x01);
|
||||
LCD_WriteData(0x3F);
|
||||
|
||||
LCD_WriteCommand(0xDE);
|
||||
LCD_WriteData(0x02);
|
||||
|
||||
LCD_WriteCommand(0xE5);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x02);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0xDE);
|
||||
LCD_WriteData(0x00);
|
||||
|
||||
LCD_WriteCommand(0x36); // Rotation control
|
||||
if (HORIZONTAL)
|
||||
LCD_WriteData(0x00);
|
||||
else
|
||||
LCD_WriteData(0x70);
|
||||
|
||||
LCD_WriteCommand(0x3A);
|
||||
LCD_WriteData(0x05);
|
||||
LCD_WriteCommand(0x21); // Display Inversion On
|
||||
|
||||
LCD_WriteCommand(0xB0);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0xE8);
|
||||
|
||||
LCD_WriteCommand(0xB2);
|
||||
LCD_WriteData(0x0C);
|
||||
LCD_WriteData(0x0C);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x33);
|
||||
LCD_WriteData(0x33);
|
||||
|
||||
LCD_WriteCommand(0xB7);
|
||||
LCD_WriteData(0x35);
|
||||
|
||||
LCD_WriteCommand(0xBB);
|
||||
LCD_WriteData(0x35);
|
||||
|
||||
LCD_WriteCommand(0xC0);
|
||||
LCD_WriteData(0x2C);
|
||||
|
||||
LCD_WriteCommand(0xC2);
|
||||
LCD_WriteData(0x01);
|
||||
|
||||
LCD_WriteCommand(0xC3);
|
||||
LCD_WriteData(0x13);
|
||||
|
||||
LCD_WriteCommand(0xC4);
|
||||
LCD_WriteData(0x20);
|
||||
|
||||
LCD_WriteCommand(0xC6);
|
||||
LCD_WriteData(0x0F);
|
||||
|
||||
LCD_WriteCommand(0xD0);
|
||||
LCD_WriteData(0xA4);
|
||||
LCD_WriteData(0xA1);
|
||||
|
||||
LCD_WriteCommand(0xD6);
|
||||
LCD_WriteData(0xA1);
|
||||
|
||||
LCD_WriteCommand(0xE0);
|
||||
LCD_WriteData(0xF0);
|
||||
LCD_WriteData(0x00);
|
||||
LCD_WriteData(0x04);
|
||||
LCD_WriteData(0x04);
|
||||
LCD_WriteData(0x04);
|
||||
LCD_WriteData(0x05);
|
||||
LCD_WriteData(0x29);
|
||||
LCD_WriteData(0x33);
|
||||
LCD_WriteData(0x3E);
|
||||
LCD_WriteData(0x38);
|
||||
LCD_WriteData(0x12);
|
||||
LCD_WriteData(0x12);
|
||||
LCD_WriteData(0x28);
|
||||
LCD_WriteData(0x30);
|
||||
|
||||
LCD_WriteCommand(0xE1);
|
||||
LCD_WriteData(0xF0);
|
||||
LCD_WriteData(0x07);
|
||||
LCD_WriteData(0x0A);
|
||||
LCD_WriteData(0x0D);
|
||||
LCD_WriteData(0x0B);
|
||||
LCD_WriteData(0x07);
|
||||
LCD_WriteData(0x28);
|
||||
LCD_WriteData(0x33);
|
||||
LCD_WriteData(0x3E);
|
||||
LCD_WriteData(0x36);
|
||||
LCD_WriteData(0x14);
|
||||
LCD_WriteData(0x14);
|
||||
LCD_WriteData(0x29);
|
||||
LCD_WriteData(0x32);
|
||||
|
||||
LCD_WriteCommand(0x21);
|
||||
|
||||
LCD_WriteCommand(0x11);
|
||||
delay(120);
|
||||
LCD_WriteCommand(0x29);
|
||||
delay(10);
|
||||
LCD_WriteCommand(0x29); // Display On
|
||||
}
|
||||
/******************************************************************************
|
||||
function: Set the cursor position
|
||||
@@ -219,17 +296,16 @@ void LCD_addWindow(uint16_t Xstart, uint16_t Ystart, uint16_t Xend, uint16_t Yen
|
||||
// backlight
|
||||
void Backlight_Init(void)
|
||||
{
|
||||
ledcAttach(EXAMPLE_PIN_NUM_BK_LIGHT, Frequency, Resolution);
|
||||
ledcWrite(EXAMPLE_PIN_NUM_BK_LIGHT, 100);
|
||||
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // Set backlight to full brightness
|
||||
}
|
||||
|
||||
void Set_Backlight(uint8_t Light) //
|
||||
{
|
||||
|
||||
if(Light > 100 || Light < 0)
|
||||
printf("Set Backlight parameters in the range of 0 to 100 \r\n");
|
||||
else{
|
||||
uint32_t Backlight = Light*10;
|
||||
ledcWrite(EXAMPLE_PIN_NUM_BK_LIGHT, Backlight);
|
||||
pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT);
|
||||
if (Light > 0) {
|
||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH);
|
||||
} else {
|
||||
digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user