Explorar o código

fix:修改u8g2的st7567驱动,提高对比度

liustu hai 6 meses
pai
achega
cedc1bb060
Modificáronse 1 ficheiros con 23 adicións e 8 borrados
  1. 23 8
      components/u8g2/u8x8_d_st7567.c

+ 23 - 8
components/u8g2/u8x8_d_st7567.c

@@ -143,6 +143,10 @@ static const uint8_t u8x8_d_st7567_132x64_init_seq[] = {
   U8X8_DLY(50),
   U8X8_DLY(50),
   
   
   U8X8_C(0x026),		                /* v0 voltage resistor ratio */
   U8X8_C(0x026),		                /* v0 voltage resistor ratio */
+/* 2025/9/3 刘斌:增加升压步骤 */
+  U8X8_CA(0x082, 0x2f),		/* set contrast bias */
+  U8X8_CA(0x0f8, 0x00),		/* set boost step */
+/* 2025/9/3 刘斌:增加升压步骤 */
   U8X8_CA(0x081, 0x027),		/* set contrast, contrast value*/
   U8X8_CA(0x081, 0x027),		/* set contrast, contrast value*/
   
   
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0ae),		                /* display off */
@@ -284,8 +288,11 @@ static const uint8_t u8x8_st7567_jlx12864_init_seq[] = {
   U8X8_DLY(50),
   U8X8_DLY(50),
   
   
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
-  U8X8_CA(0x081, 42>>2),		/* set contrast, contrast value*/
-  
+/* 2025/9/3 刘斌:增加升压步骤和提高对比度 */
+  U8X8_CA(0x082, 0x2f),		/* set contrast bias */
+  U8X8_CA(0x0f8, 0x00),		/* set boost step */
+  U8X8_CA(0x081, 30),		/* set contrast, contrast value*/
+/* 2025/9/3 刘斌:增加升压步骤和提高对比度 */
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
    
    
@@ -611,8 +618,12 @@ static const uint8_t u8x8_st7567_enh_dg128064_init_seq[] = {
   U8X8_DLY(50),
   U8X8_DLY(50),
   
   
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
-  U8X8_CA(0x081, 200>>2),		/* set contrast, contrast value*/
-  
+/* 2025/9/3 刘斌:增加升压步骤和提高对比度 */
+  U8X8_CA(0x082, 0x2f),		/* set contrast bias */
+  U8X8_CA(0x0f8, 0x00),		/* set boost step */
+  U8X8_CA(0x081, 30),		/* set contrast, contrast value*/
+/* 2025/9/3 刘斌:增加升压步骤和提高对比度 */
+
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
    
    
@@ -1072,8 +1083,10 @@ static const uint8_t u8x8_st7567_os12864_init_seq[] = {
   U8X8_DLY(50),
   U8X8_DLY(50),
   
   
   U8X8_C(0x026),		                /* v0 voltage resistor ratio */
   U8X8_C(0x026),		                /* v0 voltage resistor ratio */
-  U8X8_CA(0x081, 50>>2),		/* set contrast, contrast value*/
-  
+/* 2025/9/3 刘斌:提高对比度 */
+  U8X8_CA(0x081, 30),		/* set contrast, contrast value*/
+/* 2025/9/3 刘斌:提高对比度 */
+
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
    
    
@@ -1362,8 +1375,10 @@ static const uint8_t u8x8_st7567_lw12832_init_seq[] = {
   U8X8_DLY(50),
   U8X8_DLY(50),
   
   
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
   U8X8_C(0x023),		                /* v0 voltage resistor ratio */
-  U8X8_CA(0x081, 42>>2),		/* set contrast, contrast value*/
-  
+/* 2025/9/3 刘斌:提高对比度 */
+  U8X8_CA(0x081, 30),		/* set contrast, contrast value*/
+/* 2025/9/3 刘斌:提高对比度 */
+
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0ae),		                /* display off */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */
   U8X8_C(0x0a5),		                /* enter powersafe: all pixel on, issue 142 */