SSD1306 I2C Display Driver  1.2.2
This library is developed to control SSD1306 I2C OLED Display
ssd1306_128x32.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_128x32.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_oled128x32_initData[] =
27 {
28  SSD1306_DISPLAYOFF, // display off
29  SSD1306_SETDISPLAYCLOCKDIV, 0x80,
30  SSD1306_SETMULTIPLEX, 31,
31  SSD1306_SETDISPLAYOFFSET, 0x00, // --no offset
32  SSD1306_SETSTARTLINE,
33  SSD1306_CHARGEPUMP, 0x14, // 0x10
34  SSD1306_SEGREMAP | 0x01,
35  SSD1306_COMSCANDIR,
36  SSD1306_SETCOMPINS, 0x02,
37  SSD1306_SETCONTRAST, 0x7F, // contast value
38  SSD1306_SETPRECHARGE, 0x22, // 0x1F
39  SSD1306_SETVCOMDETECT, 0x40,
40  SSD1306_MEMORYMODE, HORIZONTAL_ADDRESSING_MODE,
41  SSD1306_DISPLAYALLON_RESUME,
42  SSD1306_NORMALDISPLAY,
43  SSD1306_DISPLAYON
44 };
45 
47 {
51  s_displayHeight = 32;
52  s_displayWidth = 128;
53  for( uint8_t i=0; i < sizeof(s_oled128x32_initData); i++)
54  {
55  ssd1306_sendCommand(pgm_read_byte(&s_oled128x32_initData[i]));
56  }
57 }
void ssd1306_i2cInit()
void ssd1306_128x32_i2c_init()
void(* ssd1306_endTransmission)()
void ssd1306_sendCommand(uint8_t command)
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