SSD1306 I2C Display Driver  1.2.1
This library is developed to control SSD1306 I2C OLED Display
ssd1306_128x64.c
1 /*
2  Copyright (C) 2017 Alexey Dynda
3 
4  This file is part of SSD1306 library.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "ssd1306_128x64.h"
21 #include "lcd_common.h"
22 #include "intf/ssd1306_commands.h"
23 #include "intf/ssd1306_interface.h"
24 #include "i2c/ssd1306_i2c.h"
25 
26 static const uint8_t PROGMEM s_oled128x64_initData[] =
27 {
28  SSD1306_DISPLAYOFF, // display off
29  /* actually 2 commands below can be omitted */
30  SSD1306_SETLOWCOLUMN,
31  SSD1306_SETHIGHCOLUMN,
32  /* normal page addressing mode */
33  SSD1306_SETSTARTLINE,
34  SSD1306_SETCONTRAST, 0x7F, // contast value
35  SSD1306_SEGREMAP | 0x01,
36  SSD1306_COMSCANDIR,
37  SSD1306_NORMALDISPLAY,
38  SSD1306_SETMULTIPLEX, 63,
39  SSD1306_SETDISPLAYOFFSET, 0x00, // --no offset
40  SSD1306_SETDISPLAYCLOCKDIV, 0x80,
41  SSD1306_SETPRECHARGE, 0xF1, // --switch vcc
42  SSD1306_SETCOMPINS, 0x12, // --set divide ratio
43  SSD1306_SETVCOMDETECT, 0x40, // --vcom detect
44  SSD1306_MEMORYMODE, HORIZONTAL_ADDRESSING_MODE, // Page Addressing mode
45  SSD1306_CHARGEPUMP, 0x14,
46  SSD1306_DISPLAYALLON_RESUME,
47  SSD1306_NORMALDISPLAY,
48  SSD1306_DISPLAYON
49 };
50 
51 
53 {
55 }
56 
57 
59 {
63  s_displayHeight = 64;
64  s_displayWidth = 128;
65  for( uint8_t i=0; i<sizeof(s_oled128x64_initData); i++)
66  {
67  ssd1306_sendCommand(pgm_read_byte(&s_oled128x64_initData[i]));
68  }
69 }
void ssd1306_i2cInit()
void(* ssd1306_endTransmission)()
void ssd1306_128x64_i2c_init()
void ssd1306_sendCommand(uint8_t command)
void ssd1306_init()
uint8_t g_lcd_type
Definition: ssd1306.cpp:30
uint8_t s_displayHeight
Definition: ssd1306.cpp:28
uint8_t s_displayWidth
Definition: ssd1306.cpp:29