From 826cfaf81cc989897b719a54321319aff9088f77 Mon Sep 17 00:00:00 2001 From: kraus Date: Sat, 27 Apr 2024 12:12:48 +0200 Subject: [PATCH] update, issue #2421 --- csrc/u8x8_d_pcf8812.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/csrc/u8x8_d_pcf8812.c b/csrc/u8x8_d_pcf8812.c index b0881e41..aae8993a 100644 --- a/csrc/u8x8_d_pcf8812.c +++ b/csrc/u8x8_d_pcf8812.c @@ -60,6 +60,7 @@ static const uint8_t u8x8_d_pcf8812_96x65_init_seq[] = { U8X8_END() /* end of sequence */ }; + static const uint8_t u8x8_d_pcf8812_96x65_powersave0_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_C(0x020), /* power on */ @@ -190,7 +191,6 @@ uint8_t u8x8_d_pcf8812_96x65(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a return u8x8_d_pcf8812_96x65_generic(u8x8, msg, arg_int, arg_ptr); } - /* https://github.com/olikraus/u8g2/issues/2421 */ static const u8x8_display_info_t u8x8_pcf8812_101x64_display_info = { @@ -216,6 +216,20 @@ static const u8x8_display_info_t u8x8_pcf8812_101x64_display_info = /* pixel_height = */ 64 }; +static const uint8_t u8x8_d_pcf8812_101x64_init_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(0x21), // PowerON, ExtCommandSet + U8X8_C(0x09), // Internal HV-gen x3 + U8X8_C(0xB7), // Set Vop + U8X8_C(0x16), // Bias n=2 //15 + U8X8_C(0x06), // Temperature coeff 2 + U8X8_C(0x20), // StandartCommandSet + U8X8_C(0x0C), // normal mode, display non-inverted + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ +}; + + uint8_t u8x8_d_pcf8812_101x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { if ( msg == U8X8_MSG_DISPLAY_SETUP_MEMORY ) @@ -223,6 +237,11 @@ uint8_t u8x8_d_pcf8812_101x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void * u8x8_d_helper_display_setup_memory(u8x8, &u8x8_pcf8812_101x64_display_info); return 1; } + else if ( msg == U8X8_MSG_DISPLAY_INIT ) + { + u8x8_d_helper_display_init(u8x8); + u8x8_cad_SendSequence(u8x8, u8x8_d_pcf8812_101x64_init_seq); + } return u8x8_d_pcf8812_96x65_generic(u8x8, msg, arg_int, arg_ptr); }