SSD1306 OLED display driver
1.4.10
This library is developed to control SSD1306/SSD1331 RGB i2c/spi OLED displays and spi PCD8544 LED display
src
ssd1331_api.c
1
/*
2
MIT License
3
4
Copyright (c) 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
*/
24
25
#include "
ssd1331_api.h
"
26
#include "
intf/ssd1306_interface.h
"
27
#include "
hal/io.h
"
28
29
#include "lcd/ssd1331_commands.h"
30
31
void
ssd1331_drawLine
(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color)
32
{
33
ssd1306_commandStart
();
34
ssd1306_sendByte
(SSD1331_DRAWLINE);
35
ssd1306_sendByte
(x1);
36
ssd1306_sendByte
(y1);
37
ssd1306_sendByte
(x2);
38
ssd1306_sendByte
(y2);
39
ssd1306_sendByte
( (color & 0x03) << 4 );
40
ssd1306_sendByte
( (color & 0x1C) << 2 );
41
ssd1306_sendByte
( (color & 0xE0) >> 2 );
42
ssd1306_endTransmission
();
43
}
44
ssd1331_drawLine
void ssd1331_drawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color)
Definition:
ssd1331_api.c:31
ssd1306_sendByte
void(* ssd1306_sendByte)(uint8_t data)
Definition:
ssd1306_interface.c:33
io.h
ssd1331_api.h
ssd1306_endTransmission
void(* ssd1306_endTransmission)(void)
Definition:
ssd1306_interface.c:32
ssd1306_interface.h
ssd1306_commandStart
void(* ssd1306_commandStart)(void)
Definition:
ssd1306_interface.c:34
Generated by
1.8.13