SSD1306 OLED display driver
1.5.0
This library is developed to control SSD1306/SSD1331 RGB i2c/spi OLED displays and spi PCD8544 LED display
|
LCD high level API for setup and programming GDRAM. More...
Enumerations | |
enum | { LCD_TYPE_SSD1306, LCD_TYPE_PCD8544, LCD_TYPE_SH1106, LCD_TYPE_SSD1331, LCD_TYPE_CUSTOM } |
Functions | |
void | ssd1306_sendData (uint8_t data) __attribute__((deprecated)) |
uint8_t | ssd1306_displayHeight (void) |
uint8_t | ssd1306_displayWidth (void) |
Variables | |
uint8_t | s_displayHeight |
uint8_t | s_displayWidth |
uint8_t | g_lcd_type |
void(* | ssd1306_setRamBlock )(uint8_t x, uint8_t y, uint8_t w) |
void(* | ssd1306_nextRamPage )(void) |
void(* | ssd1306_sendPixels )(uint8_t data) |
void(* | ssd1306_sendPixel8 )(uint8_t data) |
Sends RGB pixel encoded in 3-3-2 format to OLED driver. Sends RGB pixel encoded in 3-3-2 format to OLED driver. More... | |
void | pcd8544_84x48_init (void) |
Inits 84x48 LED display (based on PCD8544 controller). More... | |
void | pcd8544_84x48_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
void | sh1106_128x64_init (void) |
Inits 128x64 OLED display (based on SH1106 controller). More... | |
void | sh1106_128x64_i2c_init (void) |
Inits 128x64 OLED display over i2c (based on SH1106 controller). More... | |
void | sh1106_128x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x64 OLED display over spi (based on SH1106 controller). More... | |
void | ssd1306_128x64_init (void) |
Inits 128x64 OLED display (based on SSD1306 controller). More... | |
void | ssd1306_128x64_i2c_init (void) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller). More... | |
void | ssd1306_128x64_i2c_initEx (int8_t scl, int8_t sda, int8_t sa) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller). More... | |
void | ssd1306_128x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x64 OLED display over spi (based on SSD1306 controller). More... | |
void | ssd1306_init (void) __attribute__((deprecated)) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller). More... | |
void | ssd1306_128x32_i2c_init (void) |
Inits 128x32 OLED display over i2c (based on SSD1306 controller). More... | |
void | ssd1306_128x32_init (void) |
Inits 128x32 OLED display (based on ssd1306 controller). More... | |
void | ssd1331_96x64_init (void) |
Inits 96x64 RGB OLED display (based on SSD1331 controller). More... | |
void | ssd1331_96x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 96x64 RGB OLED display over spi (based on SSD1331 controller). More... | |
void | ssd1351_setMode (uint8_t vertical) |
Sets GDRAM autoincrement mode. More... | |
void | ssd1351_128x128_init (void) |
Inits 128x128 RGB OLED display (based on SSD1351 controller). More... | |
void | ssd1351_128x128_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x128 RGB OLED display over spi (based on SSD1351 controller). More... | |
LCD high level API for setup and programming GDRAM.
This group contains API functions for OLED displays initialization and direct programming of GDRAM. This API can be used to create your own graphics functions.
anonymous enum |
Definition at line 43 of file lcd_common.h.
void pcd8544_84x48_init | ( | void | ) |
Inits 84x48 LED display (based on PCD8544 controller).
Inits 84x48 LED display (based on PCD8544 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 67 of file lcd_pcd8544.c.
void pcd8544_84x48_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 84x48 LED display over spi (based on PCD8544 controller)
rstPin | - pin controlling LCD reset (-1 if not used) |
cesPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 83 of file lcd_pcd8544.c.
void sh1106_128x64_i2c_init | ( | void | ) |
Inits 128x64 OLED display over i2c (based on SH1106 controller).
Inits 128x64 OLED display over i2c (based on SH1106 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and sh1106_128x64_init().
Definition at line 95 of file oled_sh1106.c.
void sh1106_128x64_init | ( | void | ) |
Inits 128x64 OLED display (based on SH1106 controller).
Inits 128x64 OLED display (based on SH1106 controller). User must init communication interface (i2c or spi) prior to calling this function.
Definition at line 81 of file oled_sh1106.c.
void sh1106_128x64_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x64 OLED display over spi (based on SH1106 controller).
Inits 128x64 OLED display over spi (based on SH1106 controller)
rstPin | - pin controlling LCD reset (-1 if not used) |
cesPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 101 of file oled_sh1106.c.
void ssd1306_128x32_i2c_init | ( | void | ) |
Inits 128x32 OLED display over i2c (based on SSD1306 controller).
Inits 128x32 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x32_init().
Definition at line 186 of file oled_ssd1306.c.
void ssd1306_128x32_init | ( | void | ) |
Inits 128x32 OLED display (based on ssd1306 controller).
Inits 128x32 OLED display (based on ssd1306 controller) spi or i2c bus must be initialized prior to calling this function.
Definition at line 171 of file oled_ssd1306.c.
void ssd1306_128x64_i2c_init | ( | void | ) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller).
Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x64_init(), or you can use ssd1306_128x64_i2c_initEx().
Definition at line 134 of file oled_ssd1306.c.
void ssd1306_128x64_i2c_initEx | ( | int8_t | scl, |
int8_t | sda, | ||
int8_t | sa | ||
) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller).
Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware.
scl | - i2c clock pin. Use -1 if you don't need to change default pin number |
sda | - i2c data pin. Use -1 if you don't need to change default pin number |
sa | - i2c address of lcd display. Use 0 to leave default |
Definition at line 140 of file oled_ssd1306.c.
void ssd1306_128x64_init | ( | void | ) |
Inits 128x64 OLED display (based on SSD1306 controller).
Inits 128x64 OLED display (based on SSD1306 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 120 of file oled_ssd1306.c.
void ssd1306_128x64_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x64 OLED display over spi (based on SSD1306 controller).
Inits 128x64 OLED display over spi (based on SSD1306 controller)
rstPin | - pin controlling LCD reset (-1 if not used) |
cesPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 150 of file oled_ssd1306.c.
uint8_t ssd1306_displayHeight | ( | void | ) |
Returns display height in pixels
Definition at line 50 of file ssd1306_generic.c.
uint8_t ssd1306_displayWidth | ( | void | ) |
Returns display width in pixels
Definition at line 55 of file ssd1306_generic.c.
void ssd1306_init | ( | void | ) |
Inits 128x64 OLED display over i2c (based on SSD1306 controller).
Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x64_init(), or you can use ssd1306_128x64_i2c_initEx().
Definition at line 114 of file oled_ssd1306.c.
void ssd1306_sendData | ( | uint8_t | data | ) |
Sends byte data to SSD1306 controller memory. Performs 3 operations at once: ssd1306_dataStart(); ssd1306_sendPixels( data ); ssd1306_endTransmission();
data | - byte to send to the controller memory |
Definition at line 34 of file lcd_common.c.
void ssd1331_96x64_init | ( | void | ) |
Inits 96x64 RGB OLED display (based on SSD1331 controller).
Inits 96x64 RGB OLED display (based on SSD1331 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 126 of file oled_ssd1331.c.
void ssd1331_96x64_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 96x64 RGB OLED display over spi (based on SSD1331 controller).
Inits 96x64 RGB OLED display over spi (based on SSD1331 controller)
rstPin | - pin controlling LCD reset (-1 if not used) |
cesPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 141 of file oled_ssd1331.c.
void ssd1351_128x128_init | ( | void | ) |
Inits 128x128 RGB OLED display (based on SSD1351 controller).
Inits 128x128 RGB OLED display (based on SSD1351 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 153 of file oled_ssd1351.c.
void ssd1351_128x128_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x128 RGB OLED display over spi (based on SSD1351 controller).
Inits 128x128 RGB OLED display over spi (based on SSD1351 controller)
rstPin | - pin controlling LCD reset (-1 if not used) |
cesPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 181 of file oled_ssd1351.c.
void ssd1351_setMode | ( | uint8_t | vertical | ) |
Sets GDRAM autoincrement mode.
Sets GDRAM autoincrement mode. By default, to make ssd1306_xxx functions compatible with RGB oled display, RGB oled is initialized in vertical auto-increment mode. But for pure rbg oled operations horizontal auto-increment mode is more suitable. So, if you're going to use NanoCanvas8 functions, please call ssd1351_setMode(0) prior to using pure RGB methods.
vertical | - 0 or 1 |
Definition at line 111 of file oled_ssd1351.c.
uint8_t g_lcd_type |
Current selected lcd display type
Definition at line 45 of file ssd1306_generic.c.
uint8_t s_displayHeight |
Current display height
Definition at line 42 of file ssd1306_generic.c.
uint8_t s_displayWidth |
Current display width
Definition at line 43 of file ssd1306_generic.c.
void(* ssd1306_nextRamPage) (void) |
Switches to the start of next RAM page for the block, specified by ssd1306_setRamBlock(). For ssd1306 it does nothing, while for sh1106 the function moves cursor to next page.
Definition at line 30 of file lcd_common.c.
void(* ssd1306_sendPixel8) (uint8_t data) |
Sends RGB pixel encoded in 3-3-2 format to OLED driver. Sends RGB pixel encoded in 3-3-2 format to OLED driver.
data | - byte, representing RGB8 pixel. |
Definition at line 32 of file lcd_common.c.
void(* ssd1306_sendPixels) (uint8_t data) |
Sends 8 monochrome vectical pixels to OLED driver.
data | - byte, representing 8 pixels. |
Definition at line 31 of file lcd_common.c.
void(* ssd1306_setRamBlock) (uint8_t x, uint8_t y, uint8_t w) |
Sets block in RAM of lcd display controller to write data to. For ssd1306 it uses horizontal addressing mode, while for sh1106 the function uses page addressing mode. Width can be specified as 0, thus the library will set the right region of RAM block to the right column of the display.
x | - column (left region) |
y | - page (top page of the block) |
w | - width of the block in pixels to control |
Definition at line 29 of file lcd_common.c.