@@ -22,7 +22,7 @@ void init_lcd(){
22
22
lcd_version = 0 ;
23
23
i2c_address_lcd = 0x78 ;
24
24
}else if (test_i2c_device (0x3E )){// B1.9
25
- lcd_version = 0 ; //later 2
25
+ lcd_version = 2 ;
26
26
i2c_address_lcd = 0x7C ;
27
27
}else {// B1.6 uses UART and is not testable this way
28
28
lcd_version = 1 ;
@@ -41,7 +41,19 @@ void init_lcd(){
41
41
init_lcd_deepsleep ();
42
42
43
43
}else if (lcd_version == 2 ){// B1.9 Hardware
44
- //UNKNOWN LCD VERSION
44
+ send_i2c (i2c_address_lcd ,0xEA , 1 );
45
+ sleep_us (240 );
46
+ send_i2c (i2c_address_lcd , 0xA4 , 1 );
47
+ send_i2c (i2c_address_lcd , 0x9c , 1 );
48
+ send_i2c (i2c_address_lcd , 0xac , 1 );
49
+ send_i2c (i2c_address_lcd , 0xbc , 1 );
50
+ send_i2c (i2c_address_lcd , 0xf0 , 1 );
51
+ send_i2c (i2c_address_lcd , 0xfc , 1 );
52
+
53
+ uint8_t lcd_3E_init_segments [] = {0x00 , 0x00 , 0x00 , 0xff , 0xff , 0xff , 0xff , 0xff , 0xff , 0xff , 0xff , 0xff , 0xff , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
54
+ send_i2c (i2c_address_lcd ,lcd_3E_init_segments , sizeof (lcd_3E_init_segments ));
55
+
56
+ send_i2c (i2c_address_lcd , 0xc8 , 1 );
45
57
}
46
58
send_to_lcd_long (0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 );
47
59
}
@@ -78,7 +90,8 @@ if(lcd_version == 0){// B1.4 Hardware
78
90
}else if (lcd_version == 1 ){// B1.6 Hardware
79
91
uart_send_lcd (byte1 ,byte2 ,byte3 ,byte4 ,byte5 ,byte6 );
80
92
}else if (lcd_version == 2 ){// B1.9 Hardware
81
- //UNKNOWN LCD VERSION
93
+ uint8_t lcd_set_segments [] = {0x04 ,byte1 ,byte2 ,0x00 ,0x00 ,byte3 ,byte4 ,0x00 ,0x00 ,byte5 ,byte6 };
94
+ send_i2c (i2c_address_lcd ,lcd_set_segments , sizeof (lcd_set_segments ));
82
95
}
83
96
}
84
97
@@ -89,7 +102,8 @@ if(lcd_version == 0){// B1.4 Hardware
89
102
}else if (lcd_version == 1 ){// B1.6 Hardware
90
103
uart_send_lcd (byte1 ,byte2 ,byte3 ,byte4 ,byte5 ,byte6 );
91
104
}else if (lcd_version == 2 ){// B1.9 Hardware
92
- //UNKNOWN LCD VERSION
105
+ uint8_t lcd_set_segments [] = {0x04 ,byte1 ,byte2 ,0x00 ,0x00 ,byte3 ,byte4 ,0x00 ,0x00 ,byte5 ,byte6 };
106
+ send_i2c (i2c_address_lcd ,lcd_set_segments , sizeof (lcd_set_segments ));
93
107
}
94
108
}
95
109
0 commit comments