SSD1306 OLED display driver
1.8.2
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
|
LCD initialization and service functions. More...
Classes | |
struct | ssd1306_lcd_t |
Macros | |
#define | s_displayHeight ssd1306_lcd.height |
#define | s_displayWidth ssd1306_lcd.width |
#define | g_lcd_type ssd1306_lcd.type |
#define | ssd1306_setRamBlock ssd1306_lcd.set_block |
Sets block in RAM of lcd display controller to write data to. More... | |
#define | ssd1306_nextRamPage ssd1306_lcd.next_page |
#define | ssd1306_sendPixels ssd1306_lcd.send_pixels1 |
#define | ssd1306_sendPixelsBuffer ssd1306_lcd.send_pixels_buffer1 |
#define | ssd1306_sendPixel8 ssd1306_lcd.send_pixels8 |
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... | |
#define | SSD1306_COMPAT_SPI_BLOCK_8BIT_CMDS(column_cmd, row_cmd) |
#define | CONTROLLER_NATIVE_SPI_BLOCK_8BIT_CMDS(column_cmd, row_cmd) |
#define | SSD1306_COMPAT_SEND_PIXELS_RGB8_CMDS() |
#define | SSD1306_COMPAT_SEND_PIXELS_RGB16_CMDS() |
Enumerations | |
enum | lcd_type_t { LCD_TYPE_SSD1306, LCD_TYPE_PCD8544, LCD_TYPE_SH1106, LCD_TYPE_SSD1331, LCD_TYPE_CUSTOM } |
enum | lcd_mode_t { LCD_MODE_NORMAL = 0, LCD_MODE_SSD1306_COMPAT = 1 } |
Functions | |
void | ssd1306_sendData (uint8_t data) __attribute__((deprecated)) |
void | ssd1306_configureI2cDisplay (const uint8_t *config, uint8_t configSize) |
Sends configuration being passed to lcd display i2c/spi controller. More... | |
void | ssd1306_configureSpiDisplay (const uint8_t *config, uint8_t configSize) |
Sends configuration being passed to lcd display spi controller. More... | |
void | ssd1306_configureSpiDisplay2 (const uint8_t *config, uint8_t configSize) |
Sends configuration being passed to lcd display spi controller. More... | |
void | ssd1306_setMode (lcd_mode_t mode) |
Sets library display mode for direct draw functions. More... | |
void | ssd1306_resetController (int8_t rstPin, uint8_t delayMs) |
Does hardware reset for oled controller. More... | |
lcduint_t | ssd1306_displayHeight (void) |
lcduint_t | ssd1306_displayWidth (void) |
Variables | |
ssd1306_lcd_t | ssd1306_lcd |
void | composite_video_128x64_mono_init (void) |
Inits 128x64 monochrome VGA display. More... | |
void | il9163_setMode (lcd_mode_t mode) |
Sets GDRAM autoincrement mode. More... | |
void | il9163_128x128_init (void) |
Inits 128x128 RGB OLED display (based on il9163 controller). More... | |
void | il9163_setOffset (lcdint_t x, lcdint_t y) |
Sets screen offset (refer to datasheet of your display) More... | |
void | st7735_128x160_init (void) |
Inits 128x160 RGB OLED display (based on st7735 controller). More... | |
void | il9163_128x128_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x128 RGB TFT display over spi (based on il9163 controller). More... | |
void | st7735_128x160_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x160 RGB TFT display over spi (based on st7735 controller). More... | |
void | ili9341_setMode (lcd_mode_t mode) |
Sets GDRAM autoincrement mode. More... | |
void | ili9341_240x320_init (void) |
Inits 240x320 RGB OLED display (based on ili9341 controller). More... | |
void | ili9341_240x320_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 240x320 RGB TFT display over spi (based on ili9341 controller). 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_128x32_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x32 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 | ssd1306_displayOff (void) |
void | ssd1306_displayOn (void) |
void | ssd1306_setContrast (uint8_t contrast) |
void | ssd1306_invertMode (void) |
void | ssd1306_normalMode (void) |
void | ssd1306_flipHorizontal (uint8_t mode) |
performs horizontal flip More... | |
void | ssd1306_flipVertical (uint8_t mode) |
performs vertical flip More... | |
void | ssd1306_setStartLine (uint8_t line) |
uint8_t | ssd1306_getStartLine (void) |
void | ssd1325_setMode (lcd_mode_t mode) |
Sets GDRAM autoincrement mode. More... | |
void | ssd1325_128x64_init (void) |
Inits 128x64 SSD1325 OLED display (based on SSD1325 controller). More... | |
void | ssd1325_128x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x64 SSD1325 OLED display over spi (based on SSD1325 controller). More... | |
void | ssd1327_128x128_init (void) |
Inits 128x128 SSD1327 OLED display (based on SSD1327 controller). More... | |
void | ssd1327_128x128_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 128x128 SSD1327 OLED display over spi (based on SSD1327 controller). More... | |
void | ssd1331_setMode (lcd_mode_t mode) |
Sets GDRAM autoincrement mode. 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 in 8-bit mode (based on SSD1331 controller). More... | |
void | ssd1331_96x64_spi_init16 (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits 96x64 RGB OLED display over spi in 16-bit mode (based on SSD1331 controller). More... | |
void | ssd1331_drawLine (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color) |
void | ssd1331_copyBlock (uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t newLeft, uint8_t newTop) |
void | ssd1351_setMode (lcd_mode_t mode) |
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... | |
void | template_setMode (lcd_mode_t mode) |
Sets GDRAM autoincrement mode. More... | |
void | template_WxH_init (void) |
Inits WxH TEMPLATE OLED display (based on TEMPLATE controller). More... | |
void | template_WxH_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin) |
Inits WxH TEMPLATE OLED display over spi (based on TEMPLATE controller). More... | |
void | vga_96x40_8colors_init (void) |
Inits 96x40 color VGA display. More... | |
void | vga_128x64_mono_init (void) |
Inits 128x64 monochrome VGA display. More... | |
LCD initialization and service functions.
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.
#define CONTROLLER_NATIVE_SPI_BLOCK_8BIT_CMDS | ( | column_cmd, | |
row_cmd | |||
) |
Macro CONTROLLER_NATIVE_SPI_BLOCK_8BIT_CMDS() generates 2 static functions, applicable for many oled controllers with 8-bit commands: set_block_native(), next_page_native(). These functions are to be used when working in oled controller native mode.
column_cmd | command opcode for setting column address according to oled controller datasheet |
row_cmd | command opcode for setting row address according to oled controller datasheet |
Definition at line 366 of file lcd_common.h.
#define g_lcd_type ssd1306_lcd.type |
Current selected lcd display type
Definition at line 188 of file lcd_common.h.
#define s_displayHeight ssd1306_lcd.height |
Current display height
Definition at line 176 of file lcd_common.h.
#define s_displayWidth ssd1306_lcd.width |
Current display width
Definition at line 182 of file lcd_common.h.
#define SSD1306_COMPAT_SEND_PIXELS_RGB16_CMDS | ( | ) |
Macro SSD1306_COMPAT_SEND_PIXELS_RGB16_CMDS() generates 2 static functions, applicable for many oled controllers in 16-bit RGB mode: send_pixels_compat16(), send_pixels_buffer_compat16(). These functions are to be used when working in ssd1306 compatible mode.
Definition at line 422 of file lcd_common.h.
#define SSD1306_COMPAT_SEND_PIXELS_RGB8_CMDS | ( | ) |
Macro SSD1306_COMPAT_SEND_PIXELS_RGB8_CMDS() generates 2 static functions, applicable for many oled controllers in 8-bit RGB mode: send_pixels_compat(), send_pixels_buffer_compat(). These functions are to be used when working in ssd1306 compatible mode.
Definition at line 390 of file lcd_common.h.
#define SSD1306_COMPAT_SPI_BLOCK_8BIT_CMDS | ( | column_cmd, | |
row_cmd | |||
) |
Macro SSD1306_COMPAT_SPI_BLOCK_8BIT_CMDS() generates 2 static functions, applicable for many oled controllers with 8-bit commands: set_block_compat(), next_page_compat(). These functions are to be used when working in ssd1306 compatible mode.
column_cmd | command opcode for setting column address according to oled controller datasheet |
row_cmd | command opcode for setting row address according to oled controller datasheet |
Definition at line 330 of file lcd_common.h.
#define ssd1306_nextRamPage ssd1306_lcd.next_page |
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 224 of file lcd_common.h.
#define ssd1306_sendPixel8 ssd1306_lcd.send_pixels8 |
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 247 of file lcd_common.h.
#define ssd1306_sendPixels ssd1306_lcd.send_pixels1 |
Sends 8 monochrome vertical pixels to OLED driver.
data | - byte, representing 8 pixels. |
Definition at line 231 of file lcd_common.h.
#define ssd1306_sendPixelsBuffer ssd1306_lcd.send_pixels_buffer1 |
Sends buffer containing 8 monochrome vertical pixels, encoded in each byte.
buffer | - buffer containing monochrome pixels. |
len | - length of buffer in bytes. |
Definition at line 239 of file lcd_common.h.
#define ssd1306_setRamBlock ssd1306_lcd.set_block |
Sets block in RAM of lcd display controller to write data to.
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 boundary to 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 215 of file lcd_common.h.
enum lcd_mode_t |
Available lcd modes used by the library. LCD_MODE_SSD1306_COMPAT is compatible mode, which should be used with standard monochrome functions.
Definition at line 69 of file lcd_common.h.
enum lcd_type_t |
Enumeration, describing display type
Definition at line 50 of file lcd_common.h.
void composite_video_128x64_mono_init | ( | void | ) |
Inits 128x64 monochrome VGA display.
Inits 128x64 monochrome VGA display. This mode supports 2 colors: black and white. User must init communication interface (uart) for vga client mode or init vga interface for host mode prior to calling this function.
Definition at line 127 of file composite_video.c.
void il9163_128x128_init | ( | void | ) |
Inits 128x128 RGB OLED display (based on il9163 controller).
Inits 128x128 RGB OLED display (based on il9163 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 253 of file lcd_il9163.c.
void il9163_128x128_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x128 RGB TFT display over spi (based on il9163 controller).
Inits 128x128 RGB TFT display over spi (based on il9163 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 269 of file lcd_il9163.c.
void il9163_setMode | ( | lcd_mode_t | mode | ) |
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 il9163_setMode(0) prior to using pure RGB methods.
mode | 0 or 1 |
Definition at line 192 of file lcd_il9163.c.
Sets screen offset (refer to datasheet of your display)
Set offset for the display
x | offset in pixels |
y | offset in pixels |
Definition at line 176 of file lcd_il9163.c.
void ili9341_240x320_init | ( | void | ) |
Inits 240x320 RGB OLED display (based on ili9341 controller).
Inits 240x320 RGB OLED display (based on ili9341 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 196 of file lcd_ili9341.c.
void ili9341_240x320_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 240x320 RGB TFT display over spi (based on ili9341 controller).
Inits 240x320 RGB TFT display over spi (based on ili9341 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 212 of file lcd_ili9341.c.
void ili9341_setMode | ( | lcd_mode_t | mode | ) |
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 ili9341_setMode(0) prior to using pure RGB methods.
mode | 0 or 1 |
Definition at line 139 of file lcd_ili9341.c.
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 80 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 100 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 113 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 97 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 119 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 241 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 225 of file oled_ssd1306.c.
void ssd1306_128x32_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x32 OLED display over spi (based on SSD1306 controller).
Inits 128x32 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 251 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 195 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 201 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 179 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 211 of file oled_ssd1306.c.
void ssd1306_configureI2cDisplay | ( | const uint8_t * | config, |
uint8_t | configSize | ||
) |
Sends configuration being passed to lcd display i2c/spi controller.
Sends configuration being passed to lcd display i2c/spi controller. The data bytes are sent to lcd controller as is. In case of spi display this function sends cmd arguments in command mode. If lcd controller requires arguments to be sent in data mode, please use ssd1306_configureSpiDisplay().
config | configuration, located in flash, to send to i2c/spi controller. |
configSize | - size of configuration data in bytes. |
Definition at line 42 of file lcd_common.c.
void ssd1306_configureSpiDisplay | ( | const uint8_t * | config, |
uint8_t | configSize | ||
) |
Sends configuration being passed to lcd display spi controller.
Sends configuration being passed to lcd display spi controller. If data byte value to be sent is less than 255, then data byte is sent in command mode. If data byte is 0xFF, the function does't send it to controller, but switches to spi data mode, and next byte after will be sent in data spi mode. Then the function will switch back to command mode. If lcd controller requires cmd arguments to be sent in command mode, please use ssd1306_configureI2cDisplay().
config | configuration, located in flash, to send to i2c/spi controller. |
configSize | - size of configuration data in bytes. |
Definition at line 53 of file lcd_common.c.
void ssd1306_configureSpiDisplay2 | ( | const uint8_t * | config, |
uint8_t | configSize | ||
) |
Sends configuration being passed to lcd display spi controller.
Sends configuration being passed to lcd display spi controller. If data byte value to be sent is less than 255, then data byte is sent in command mode. Each command has additional parameter: number of arguments. If lcd controller requires cmd arguments to be sent in command mode, please use ssd1306_configureI2cDisplay().
config | configuration, located in flash, to send to i2c/spi controller. |
configSize | - size of configuration data in bytes. |
Definition at line 75 of file lcd_common.c.
lcduint_t ssd1306_displayHeight | ( | void | ) |
Returns display height in pixels
Definition at line 58 of file ssd1306_generic.c.
void ssd1306_displayOff | ( | void | ) |
Turns off display
Definition at line 119 of file oled_ssd1306.c.
void ssd1306_displayOn | ( | void | ) |
Turns on display
Definition at line 125 of file oled_ssd1306.c.
lcduint_t ssd1306_displayWidth | ( | void | ) |
Returns display width in pixels
Definition at line 63 of file ssd1306_generic.c.
void ssd1306_flipHorizontal | ( | uint8_t | mode | ) |
performs horizontal flip
Performs horizontal flip. If you need to turn display by 180 degree, please use both ssd1306_flipHorizontal() and ssd1306_flipVertical().
mode | - 0 to disable horizontal flip 1 to enable horizontal flip |
Definition at line 148 of file oled_ssd1306.c.
void ssd1306_flipVertical | ( | uint8_t | mode | ) |
performs vertical flip
Performs vertical flip. If you need to turn display by 180 degree, please use both ssd1306_flipHorizontal() and ssd1306_flipVertical().
mode | - 0 to disable vertical flip 1 to enable vertical flip |
Definition at line 153 of file oled_ssd1306.c.
uint8_t ssd1306_getStartLine | ( | void | ) |
returns start line in gdram.
Definition at line 164 of file oled_ssd1306.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 173 of file oled_ssd1306.c.
void ssd1306_invertMode | ( | void | ) |
Switches display to inverse mode. LCD will display 0-pixels as white, and 1-pixels as black.
Definition at line 138 of file oled_ssd1306.c.
void ssd1306_normalMode | ( | void | ) |
Switches display to normal mode.
Definition at line 143 of file oled_ssd1306.c.
void ssd1306_resetController | ( | int8_t | rstPin, |
uint8_t | delayMs | ||
) |
Does hardware reset for oled controller.
Does hardware reset for oled controller. The function pulls up rstPin for 10 milliseconds, then pulls down rstPin for delayMs milliseconds and then finally pulls rstPin up.
rstPin | reset pin number |
delayMs | delay in milliseconds to hold rstPin in low state |
Definition at line 139 of file lcd_common.c.
void ssd1306_sendData | ( | uint8_t | data | ) |
Sends byte data to SSD1306 controller memory. Performs 3 operations at once: ssd1306_intf.start(), ssd1306_intf.send(), ssd1306_intf.stop();
data | - byte to send to the controller memory |
Definition at line 35 of file lcd_common.c.
void ssd1306_setContrast | ( | uint8_t | contrast | ) |
Set display contrast, ie light intensity
contrast | - contrast value to see, refer to ssd1306 datasheet |
Definition at line 130 of file oled_ssd1306.c.
void ssd1306_setMode | ( | lcd_mode_t | mode | ) |
Sets library display mode for direct draw functions.
Sets library display mode for direct draw functions. There are currently 2 modes supported: LCD_MODE_SSD1306_COMPAT and LCD_MODE_NORMAL. In general, ssd1306 compatible mode uses different GDRAM addressing mode, than normal mode, intended for using with RBG full-color functions.
mode | lcd mode to activate. |
Definition at line 131 of file lcd_common.c.
void ssd1306_setStartLine | ( | uint8_t | line | ) |
Sets start line in gdram to start display content with
line | start line in range 0 - 63 |
Definition at line 158 of file oled_ssd1306.c.
void ssd1325_128x64_init | ( | void | ) |
Inits 128x64 SSD1325 OLED display (based on SSD1325 controller).
Inits 128x64 SSD1325 OLED display (based on SSD1325 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 154 of file oled_ssd1325.c.
void ssd1325_128x64_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x64 SSD1325 OLED display over spi (based on SSD1325 controller).
Inits 128x64 SSD1325 OLED display over spi (based on SSD1325 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 174 of file oled_ssd1325.c.
void ssd1325_setMode | ( | lcd_mode_t | mode | ) |
Sets GDRAM autoincrement mode.
Sets GDRAM autoincrement mode. By default, to make ssd1306_xxx functions compatible with SSD1325 oled display, SSD1325 oled is initialized in vertical auto-increment mode. But for pure SSD1325 oled operations horizontal auto-increment mode is more suitable. So, if you're going to use NanoCanvas8 functions, please call ssd1325_setMode(0) prior to using pure SSD1325 oled methods.
mode | 0 or 1 |
Definition at line 134 of file oled_ssd1325.c.
void ssd1327_128x128_init | ( | void | ) |
Inits 128x128 SSD1327 OLED display (based on SSD1327 controller).
Inits 128x128 SSD1327 OLED display (based on SSD1327 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 166 of file oled_ssd1327.c.
void ssd1327_128x128_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x128 SSD1327 OLED display over spi (based on SSD1327 controller).
Inits 128x128 SSD1327 OLED display over spi (based on SSD1327 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 187 of file oled_ssd1327.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 201 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 in 8-bit mode (based on SSD1331 controller).
Inits 96x64 RGB OLED display over spi in 8-bit mode (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 239 of file oled_ssd1331.c.
void ssd1331_96x64_spi_init16 | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 96x64 RGB OLED display over spi in 16-bit mode (based on SSD1331 controller).
Inits 96x64 RGB OLED display over spi in 16-bit mode (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 249 of file oled_ssd1331.c.
void ssd1331_copyBlock | ( | uint8_t | left, |
uint8_t | top, | ||
uint8_t | right, | ||
uint8_t | bottom, | ||
uint8_t | newLeft, | ||
uint8_t | newTop | ||
) |
Copies block in GDRAM to new position
left | column start of block to copy |
top | row start of block to copy |
right | column end of block to copy |
bottom | row end of block to copy |
newLeft | new column start |
newTop | new row start |
Definition at line 274 of file oled_ssd1331.c.
void ssd1331_drawLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint16_t | color | ||
) |
Draws line
x1 | - x position in pixels of start point |
y1 | - y position in pixels of start point |
x2 | - x position in pixels of end point |
y2 | - y position in pixels of end point |
color | - color of the line, refer to RGB_COLOR8 macros |
Definition at line 259 of file oled_ssd1331.c.
void ssd1331_setMode | ( | lcd_mode_t | mode | ) |
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 ssd1331_setMode(0) prior to using pure RGB methods.
mode | 0 or 1 |
Definition at line 112 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 184 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 216 of file oled_ssd1351.c.
void ssd1351_setMode | ( | lcd_mode_t | mode | ) |
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.
mode | 0 or 1 |
Definition at line 124 of file oled_ssd1351.c.
void st7735_128x160_init | ( | void | ) |
Inits 128x160 RGB OLED display (based on st7735 controller).
Inits 128x160 RGB OLED display (based on st7735 controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 406 of file lcd_il9163.c.
void st7735_128x160_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits 128x160 RGB TFT display over spi (based on st7735 controller).
Inits 128x160 RGB TFT display over spi (based on st7735 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 422 of file lcd_il9163.c.
void template_setMode | ( | lcd_mode_t | mode | ) |
Sets GDRAM autoincrement mode.
Sets GDRAM autoincrement mode. By default, to make ssd1306_xxx functions compatible with TEMPLATE oled display, TEMPLATE oled is initialized in vertical auto-increment mode. But for pure TEMPLATE oled operations horizontal auto-increment mode is more suitable. So, if you're going to use NanoCanvas8 functions, please call template_setMode(0) prior to using pure TEMPLATE oled methods.
mode | 0 or 1 |
Definition at line 124 of file oled_template.c.
void template_WxH_init | ( | void | ) |
Inits WxH TEMPLATE OLED display (based on TEMPLATE controller).
Inits WxH TEMPLATE OLED display (based on TEMPLATE controller). User must init communication interface (i2c, spi) prior to calling this function.
Definition at line 144 of file oled_template.c.
void template_WxH_spi_init | ( | int8_t | rstPin, |
int8_t | cesPin, | ||
int8_t | dcPin | ||
) |
Inits WxH TEMPLATE OLED display over spi (based on TEMPLATE controller).
Inits WxH TEMPLATE OLED display over spi (based on TEMPLATE 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 165 of file oled_template.c.
void vga_128x64_mono_init | ( | void | ) |
Inits 128x64 monochrome VGA display.
Inits 128x64 monochrome VGA display. This mode supports 2 colors: black and white. User must init communication interface (uart) for vga client mode or init vga interface for host mode prior to calling this function.
Definition at line 134 of file vga_monitor.c.
void vga_96x40_8colors_init | ( | void | ) |
Inits 96x40 color VGA display.
Inits 96x40 color VGA display. This mode supports 8 colors: 3 bits per pixel. User must init communication interface (uart) for vga client mode or init vga interface for host mode prior to calling this function.
Definition at line 121 of file vga_monitor.c.
ssd1306_lcd_t ssd1306_lcd |
Structure containing callback to low level function for currently enabled display
Definition at line 33 of file lcd_common.c.