SSD1306 OLED display driver  1.5.6
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
lcd_common.h
Go to the documentation of this file.
1 /*
2  MIT License
3 
4  Copyright (c) 2017-2018, Alexey Dynda
5 
6  Permission is hereby granted, free of charge, to any person obtaining a copy
7  of this software and associated documentation files (the "Software"), to deal
8  in the Software without restriction, including without limitation the rights
9  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  copies of the Software, and to permit persons to whom the Software is
11  furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in all
14  copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  SOFTWARE.
23 */
28 #ifndef _LCD_COMMON_H_
29 #define _LCD_COMMON_H_
30 
31 #include "hal/io.h"
32 
46 typedef enum
47 {
58 } lcd_type_t;
59 
65 typedef enum
66 {
72 
79 } lcd_mode_t;
80 
84 typedef struct
85 {
88 
91 
94 
110  void (*set_block)(lcduint_t x, lcduint_t y, lcduint_t w);
111 
118  void (*next_page)(void);
119 
124  void (*send_pixels1)(uint8_t data);
125 
131  void (*send_pixels_buffer1)(const uint8_t *buffer, uint16_t len);
132 
138  void (*send_pixels8)(uint8_t data);
139 
153  void (*set_mode)(lcd_mode_t mode);
154 } ssd1306_lcd_t;
155 
160 
165 #define s_displayHeight ssd1306_lcd.height
166 
171 #define s_displayWidth ssd1306_lcd.width
172 
177 #define g_lcd_type ssd1306_lcd.type
178 
186 void ssd1306_sendData(uint8_t data) __attribute__ ((deprecated));
187 
204 #define ssd1306_setRamBlock ssd1306_lcd.set_block
205 
213 #define ssd1306_nextRamPage ssd1306_lcd.next_page
214 
220 #define ssd1306_sendPixels ssd1306_lcd.send_pixels1
221 
228 #define ssd1306_sendPixelsBuffer ssd1306_lcd.send_pixels_buffer1
229 
236 #define ssd1306_sendPixel8 ssd1306_lcd.send_pixels8
237 
249 void ssd1306_configureI2cDisplay(const uint8_t *config, uint8_t configSize);
250 
264 void ssd1306_configureSpiDisplay(const uint8_t *config, uint8_t configSize);
265 
279 void ssd1306_setMode(lcd_mode_t mode);
280 
290 #endif /* _LCD_COMMON_H_ */
void ssd1306_setMode(lcd_mode_t mode)
Sets library display mode for direct draw functions.
Definition: lcd_common.c:74
unsigned int lcduint_t
Definition: io.h:42
void ssd1306_configureSpiDisplay(const uint8_t *config, uint8_t configSize)
Sends configuration being passed to lcd display spi controller.
Definition: lcd_common.c:52
void ssd1306_configureI2cDisplay(const uint8_t *config, uint8_t configSize)
Sends configuration being passed to lcd display i2c/spi controller.
Definition: lcd_common.c:41
lcd_mode_t
Definition: lcd_common.h:65
ssd1306_lcd_t ssd1306_lcd
Definition: lcd_common.c:32
lcduint_t height
Definition: lcd_common.h:93
void ssd1306_sendData(uint8_t data) __attribute__((deprecated))
Definition: lcd_common.c:34
lcduint_t width
Definition: lcd_common.h:90
lcd_type_t
Definition: lcd_common.h:46
lcd_type_t type
Definition: lcd_common.h:87