1616
1717
1818uint8_t display_init_sequence [] = {
19- /*
20- 0, 0xae, // display off
21- 0xd5, 0, 0x80, // set display clock div
22- 0, 0xd3, 0, 0x00, // set display offset
23- 0, 0x40, // set start line
24- 0, 0xa4, // display all on, resume
25- 0, 0xa6, // normal display
26- 0, 0x8d, 0, 0x14, // charge pump
27- 0, 0x20, 0, 0x00, // memory mode
28- 0, 0xa0, // segremap
29- 0, 0xc0, // com scan increment
30- 0, 0x81, 0, 0xff, // set contrast
31- 0, 0xd9, 0, 0xf1, // set precharge
32- 0, 0xd8, 0, 0x20, // set v com detect
33- 0, 0xa8, 0, 40-1, // set multiplex
34- 0, 0xda, 0, 0x12, // set com pins
35- 0, 0xad, 0, 0x30,
36- 0, 0xaf, // on
37- */
38-
39- 0xae , 0 , // sleep
40- 0xd5 , 1 , 0x80 , // fOsc divide by 2
41- 0xd3 , 1 , 0x00 , // set display offset
42- 0x40 , 1 , 0x00 , // set start line
43- 0xa4 , 0 , // display all on, resume
44- 0xa6 , 0 , // normal display
45- 0x8d , 1 , 0x14 , // charge pump
46- 0x20 , 1 , 0x00 , // memory mode
47- 0xa0 , 0 , // segremap
48- 0xc0 , 0 , // com scan increment
49- 0x81 , 1 , 0xff , // set contrast
50- 0xd9 , 1 , 0xf1 , // set precharge
51- 0xd8 , 1 , 0x20 , // set v com detect
52- 0xa8 , 1 , 40 - 1 , // set multiplex
53- 0xda , 1 , 0x12 , // set com pins
54- 0xad , 1 , 0x30 ,
55- 0xaf , 0 , // on
19+ 0xAE , 0 , // DISPLAY_OFF
20+ 0x20 , 1 , 0x00 , // Set memory addressing to horizontal mode.
21+ 0x81 , 1 , 0xcf , // set contrast control
22+ 0xA1 , 0 , // Column 127 is segment 0
23+ 0xA6 , 0 , // Normal display
24+ 0xc8 , 0 , // Normal display
25+ 0xA8 , 1 , 0x3f , // Mux ratio is 1/64
26+ 0xd5 , 1 , 0x80 , // Set divide ratio
27+ 0xd9 , 1 , 0xf1 , // Set pre-charge period
28+ 0xda , 1 , 0x12 , // Set com configuration
29+ 0xdb , 1 , 0x40 , // Set vcom configuration
30+ 0x8d , 1 , 0x14 , // Enable charge pump
31+ 0xAF , 0 , // DISPLAY_ON
5632};
5733
5834void board_init (void ) {
@@ -76,17 +52,17 @@ void board_init(void) {
7652 72 , // Width (after rotation)
7753 40 , // Height (after rotation)
7854 28 , // column start
79- 0 , // row start
55+ 28 , // row start
8056 0 , // rotation
8157 1 , // Color depth
8258 true, // grayscale
8359 false, // pixels in byte share row. only used for depth < 8
8460 1 , // bytes per cell. Only valid for depths < 8
8561 false, // reverse_pixels_in_byte. Only valid for depths < 8
8662 true, // reverse_pixels_in_word
87- 0 , // Set column command
88- 0 , // Set row command
89- 0 , // Write memory command
63+ 0x21 , // Set column command
64+ 0x22 , // Set row command
65+ 44 , // Write memory command
9066 display_init_sequence ,
9167 sizeof (display_init_sequence ),
9268 NULL , // backlight pin
@@ -97,8 +73,8 @@ void board_init(void) {
9773 true, // auto_refresh
9874 60 , // native_frames_per_second
9975 true, // backlight_on_high
100- true , // SH1107_addressing
101- 50000 ); // backlight pwm frequency
76+ false , // SH1107_addressing
77+ 0 ); // backlight pwm frequency
10278}
10379
10480void reset_board (void ) {
0 commit comments