issue #921, flip mode support

This commit is contained in:
kraus 2019-06-15 11:03:24 +02:00
parent 982e1f6546
commit 248756a1d3
3 changed files with 38 additions and 36 deletions

View File

@ -69,7 +69,7 @@
Use 16 Bit mode for any display with more than 240 pixel in one
direction.
*/
//#define U8G2_16BIT
#define U8G2_16BIT
/* U8g2 feature selection, see also https://github.com/olikraus/u8g2/wiki/u8g2optimization */

View File

@ -57,6 +57,8 @@ static const uint8_t u8x8_d_st75320_jlx320240_powersave1_seq[] = {
static const uint8_t u8x8_d_st75320_jlx320240_flip0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_CA(0xC4, 0x02), /* COM Output Status, Bits 0 & 1 */
U8X8_C(0xA1), /* Column Address Direction: Bit 0 */
//U8X8_C(0x0a1), /* segment remap a0/a1*/
//U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */
U8X8_END_TRANSFER(), /* disable chip */
@ -67,6 +69,8 @@ static const uint8_t u8x8_d_st75320_jlx320240_flip1_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
//U8X8_C(0x0a0), /* segment remap a0/a1*/
//U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */
U8X8_CA(0xC4, 0x03), /* COM Output Status, Bits 0 & 1 */
U8X8_C(0xA0), /* Column Address Direction: Bit 0 */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
@ -170,51 +174,49 @@ static const uint8_t u8x8_d_st75320_jlx320240_init_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0xAE), //Display OFF
U8X8_CA(0xEA, 0x00), //Power Discharge Control, Discharge OFF
U8X8_C(0xA8), //sleep out
U8X8_C(0xAB), //OSC ON
U8X8_C(0x69), //Temperature Detection ON
U8X8_C(0x4E), //TC Setting
U8X8_C(0xAE), // Display OFF
U8X8_CA(0xEA, 0x00), // Power Discharge Control, Discharge OFF
U8X8_C(0xA8), // sleep out
U8X8_C(0xAB), // OSC ON
U8X8_C(0x69), // Temperature Detection ON
U8X8_C(0x4E), // TC Setting
U8X8_A8(0xff, 0x44, 0x12, 0x11, 0x11, 0x11, 0x22, 0x23),
U8X8_CAA(0x39, 0x00, 0x00), //TC Flag
U8X8_CAA(0x39, 0x00, 0x00), //TC Flag
U8X8_CA(0x2B, 0x00), //Frame Rate Level
U8X8_CAA(0x5F, 0x66, 0x66), //Set Frame Frequency, fFR=80Hz in all temperature range
U8X8_CAAA(0xEC, 0x19, 0x64, 0x6e), //FR Compensation Temp. Range, TA = -15 degree, TB = 60 degree, TC = 70 degree
U8X8_CAA(0xED, 0x04, 0x04), //Temp. Hysteresis Value (thermal sensitivity)
U8X8_C(0xA6), //Display Inverse OFF
U8X8_C(0xA4), //Disable Display All Pixel ON
U8X8_CA(0x2B, 0x00), // Frame Rate Level
U8X8_CAA(0x5F, 0x66, 0x66), // Set Frame Frequency, fFR=80Hz in all temperature range
U8X8_CAAA(0xEC, 0x19, 0x64, 0x6e), // FR Compensation Temp. Range, TA = -15 degree, TB = 60 degree, TC = 70 degree
U8X8_CAA(0xED, 0x04, 0x04), // Temp. Hysteresis Value (thermal sensitivity)
U8X8_C(0xA6), // Display Inverse OFF
U8X8_C(0xA4), // Disable Display All Pixel ON
U8X8_CA(0xC4, 0x02), //COM Output Status
U8X8_CA(0xC4, 0x02), // COM Output Status
U8X8_C(0xA1), // Column Address Direction: MX=0
//Interlace mode, MY=0
U8X8_C(0xA1), //Column Address Direction: MX=0
U8X8_CAA(0x6D, 0x07, 0x00), //Display Area, Duty = 1/240 duty, Start Group = 1
U8X8_C(0x84), //Display Data Input Direction: Column
U8X8_CA(0x36, 0x1e), //Set N-Line
U8X8_C(0xE4), //N-Line On
U8X8_CA(0xE7, 0x19), //LCD Drive Method //NLFR=1//
U8X8_CAA(0x6D, 0x07, 0x00), // Display Area, Duty = 1/240 duty, Start Group = 1
U8X8_C(0x84), // Display Data Input Direction: Column
U8X8_CA(0x36, 0x1e), // Set N-Line
U8X8_C(0xE4), // N-Line On
U8X8_CA(0xE7, 0x19), // LCD Drive Method //NLFR=1//
U8X8_CAA(0x81, 0x4f, 0x01), //OX81: Set EV=64h, 0..255, 0..3
U8X8_CA(0xA2, 0x0a), //BIAS //1/16 BIAS
U8X8_CA(0x25, 0x020), //Power Control //AVDD ON
U8X8_CAA(0x81, 0x4f, 0x01), // OX81: Set EV=64h, 0..255, 0..3
U8X8_CA(0xA2, 0x0a), // BIAS //1/16 BIAS
U8X8_CA(0x25, 0x020), // Power Control //AVDD ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x60), //Power Control//AVDD, MV3 & NAVDD ON
U8X8_CA(0x25, 0x60), // Power Control//AVDD, MV3 & NAVDD ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x70), //Power Control //AVDD, MV3, NAVDD & V3 ON
U8X8_CA(0x25, 0x70), // Power Control //AVDD, MV3, NAVDD & V3 ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x78), //Power Control//AVDD, MV3, NAVDD, V3 & VPF ON
U8X8_CA(0x25, 0x78), // Power Control//AVDD, MV3, NAVDD, V3 & VPF ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x7c), //Power Control//AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_CA(0x25, 0x7c), // Power Control//AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x7e), //Power Control//VOUT, AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_CA(0x25, 0x7e), // Power Control//VOUT, AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_DLY(10),
U8X8_CA(0x25, 0x7f), //Power Control/VOUT, AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_CA(0x25, 0x7f), // Power Control/VOUT, AVDD, MV3, NAVDD, V3, VPF & VNF ON
U8X8_DLY(10),
//U8X8_C(0xaf); //Display ON
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */

View File

@ -198,8 +198,8 @@
//U8G2_ST75256_JLX240160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST75256_JLX25664_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, enable U8g2 16 bit mode for this display
U8G2_ST75320_JLX320240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display
//U8G2_ST75320_JLX320240_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display
//U8G2_ST75320_JLX320240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display
U8G2_ST75320_JLX320240_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display
//U8G2_NT7534_TG12864R_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_NT7534_TG12864R_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_ST7588_JLX12864_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5);
@ -334,8 +334,8 @@ void drawLogo(void)
#endif
u8g2.setFont(u8g2_font_logisoso92_tn);
u8g2.drawStr(20,230,"320x240");
u8g2.setFont(u8g2_font_logisoso58_tr);
u8g2.drawStr(25,180,"320x240");
}