123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- Void ST7789SCMI24panelinitialcode(void)
- {
- //-----------------------------------ST7789S reset sequence------------------------------------//
- LCD_RESET=1;
- Delayms(1); //Delay 1ms
- LCD_RESET=0;
- Delayms(10); //Delay 10ms
- LCD_RESET=1;
- Delayms(120); //Delay 120ms
- //--------------------------------------------------------------------------------------------//
- Write command (0x11);
- Delayms(120); //Delay 120ms
- //--------------------------------------Display Setting---------------------------------------//
- Write command (0x36);
- Write data (0x00);
- Write command (0x3a);
- Write data (0x05);
- //--------------------------------ST7789S Frame rate setting----------------------------------//
- Write command (0xb2);
- Write data (0x0c);
- Write data (0x0c);
- Write data (0x00);
- Write data (0x33);
- Write data (0x33);
- Write command (0xb7);
- Write data (0x35);
- //---------------------------------ST7789S Power setting--------------------------------------//
- Write command (0xbb);
- Write data (0x35);
- Write command (0xc0);
- Write data (0x2c);
- Write command (0xc2);
- Write data (0x01);
- Write command (0xc3);
- Write data (0x11);
- Write command (0xc4);
- Write data (0x20);
- Write command (0xc6);
- Write data (0x0f);
- Write command (0xd0);
- Write data (0xa4);
- Write data (0xa1);
- //--------------------------------ST7789S gamma setting---------------------------------------//
- Write command (0xe0);
- Write data (0xd0);
- Write data (0x00);
- Write data (0x05);
- Write data (0x0e);
- Write data (0x15);
- Write data (0x0d);
- Write data (0x37);
- Write data (0x43);
- Write data (0x47);
- Write data (0x09);
- Write data (0x15);
- Write data (0x12);
- Write data (0x16);
- Write data (0x19);
- Write command (0xe1);
- Write data (0xd0);
- Write data (0x00);
- Write data (0x05);
- Write data (0x0d);
- Write data (0x0c);
- Write data (0x06);
- Write data (0x2d);
- Write data (0x44);
- Write data (0x40);
- Write data (0x0e);
- Write data (0x1c);
- Write data (0x18);
- Write data (0x16);
- Write data (0x19);
- Write command (0x29);
- }
- Void ST7789sPanelTurnOnDisplay (void)
- {
- Write command (0x29);
- }
- Void ST7789sPanelTurnOffDisplay (void)
- {
- Write command (0x28);
- }
- Void ST7789sPanelTurnOnPartial (void)
- {
- Write command (0x30);
- Write data (0x00);
- Write PSL); //PSL: Start Line
- Write data (0x00);
- Write PEL); //PEL: End Line
- Write command (0x12);
- }
- Void ST7789sPanelTurnOffPartial (void)
- {
- Write command (0x13);
- }
- Void ST7789sPanelTurnOnIdle (void)
- {
- Write command (0x39);
- }
- Void ST7789sPanelTurnOffIdle (void)
- {
- Write command (0x38);
- }
- Void ST7789sPanelSleepInMode (void)
- {
- Write command (0x10);
- Delayms (120);
- }
- Void ST7789sPanelSleepOutMode (void)
- {
- Write command (0x11);
- Delayms (120);
- }
|