LCDGFX LCD display driver  1.0.2
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
interface.h
Go to the documentation of this file.
1 /*
2  MIT License
3 
4  Copyright (c) 2017-2019, 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_HAL_INTERFACE_H_
29 #define _LCD_HAL_INTERFACE_H_
30 
31 #include <stdint.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
55 typedef struct
56 {
61  int8_t busId;
62 
66  uint8_t addr;
67 
72  int8_t scl;
73 
78  int8_t sda;
79 
84  uint32_t frequency;
86 
92 typedef struct
93 {
98  int8_t busId;
99 
105  union
106  {
107  int8_t cs;
108  int8_t devId;
109  };
110 
114  int8_t dc;
115 
120  uint32_t frequency;
121 
126  int8_t scl; // clk
127 
132  int8_t sda; // mosi
134 
136 typedef struct
137 {
141  uint8_t spi;
145  void (*start)(void);
149  void (*stop)(void);
154  void (*send)(uint8_t data);
164  void (*send_buffer)(const uint8_t *buffer, uint16_t size);
172  void (*close)(void);
174 
179 
184 extern int8_t s_ssd1306_cs;
185 
190 extern int8_t s_ssd1306_dc;
191 
196 extern uint32_t s_ssd1306_spi_clock;
197 
204 void ssd1306_sendCommand(uint8_t command);
205 
210 void ssd1306_commandStart(void);
211 
216 void ssd1306_dataStart(void);
217 
224 void ssd1306_spiDataMode(uint8_t mode);
225 
226 #ifndef DOXYGEN_SHOULD_SKIP_THIS
227 void ssd1306_resetController(int8_t rstPin, uint8_t delayMs);
228 void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs);
229 #endif
230 
231 #ifdef __cplusplus
232 }
233 #endif
234 
239 // ----------------------------------------------------------------------------
240 #endif
int8_t s_ssd1306_dc
Definition: interface.c:29
void ssd1306_dataStart(void)
Definition: interface.c:56
uint32_t s_ssd1306_spi_clock
Definition: interface.c:30
void ssd1306_resetController2(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void ssd1306_spiDataMode(uint8_t mode)
Definition: interface.c:39
ssd1306_interface_t ssd1306_intf
Definition: interface.c:34
uint32_t frequency
Definition: interface.h:120
uint32_t frequency
Definition: interface.h:84
void ssd1306_commandStart(void)
Definition: interface.c:47
void ssd1306_sendCommand(uint8_t command)
Definition: interface.c:65
int8_t s_ssd1306_cs
Definition: interface.c:28