/* 2864 初始化 IC:SSD1306 */ VCC外部供电方式时初始化 write_com(0xAE); /*display off*/ write_com(0x00); /*set lower column address*/ write_com(0x10); /*set higher column address*/ write_com(0x40); /*set display start line*/ write_com(0xB0); /*set page address*/ write_com(0x81); /*contract control*/ write_com(0xcf); /*128*/ write_com(0xA1); /*set segment remap 0XA0*/ write_com(0xA6); /*normal / reverse*/ write_com(0xA8); /*multiplex ratio*/ write_com(0x3F); /*duty = 1/64*/ write_com(0xC8); /*Com scan direction 0XC0*/ write_com(0xD3); /*set display offset*/ write_com(0x00); write_com(0xD5); /*set osc division*/ write_com(0x80); write_com(0xD9); /*set pre-charge period*/ write_com(0xf1); write_com(0xDA); /*set COM pins*/ write_com(0x12); write_com(0xdb); /*set vcomh*/ write_com(0x40); write_com(0x8d); /*set charge pump disable*/ write_com(0x10); write_com(0xAF); /*display ON*/ VBAT外部供电方式时(IC内部升压)初始化 write_com(0xAE); /*display off*/ write_com(0x00); /*set lower column address*/ write_com(0x10); /*set higher column address*/ write_com(0x40); /*set display start line*/ write_com(0xB0); /*set page address*/ write_com(0x81); /*contract control*/ write_com(0xcf); /*128*/ write_com(0xA1); /*set segment remap 0XA0*/ write_com(0xA6); /*normal / reverse*/ write_com(0xA8); /*multiplex ratio*/ write_com(0x3F); /*duty = 1/64*/ write_com(0xC8); /*Com scan direction 0XC0*/ write_com(0xD3); /*set display offset*/ write_com(0x00); write_com(0xD5); /*set osc division*/ write_com(0x80); write_com(0xD9); /*set pre-charge period*/ write_com(0xf1); write_com(0xDA); /*set COM pins*/ write_com(0x12); write_com(0xdb); /*set vcomh*/ write_com(0x40); write_com(0x8d); /*set charge pump disable*/ write_com(0x14); write_com(0xAF); /*display ON*/